Ask Your Question

namedwindow not defined

asked 2019-01-13 12:00:59 -0500

IanB gravatar image

Hi, I'm just starting, I made a UWP app with an opencv helper project according to this:

link text

I got the blur example working fine.

I thought I would try HoughCircles based on this: link text and I think it is working but I am struggling with display the results. At the end I have

namedWindow("circles", 1);
imshow("circles", img);

.. but it won't compile, namedWindow and imshow are undefined.if I type "cv::" I get code completion showing loads and loads of things but not namedWindow or imshow.

I'd appreciated some assistance with this, Thanks

edit retag flag offensive close merge delete



I made a UWP app

afaik, none of opencv's highgui code is supported / used there

berak gravatar imageberak ( 2019-01-13 12:05:05 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2019-01-13 12:27:08 -0500

berak gravatar image

if you want my 2 ct: no, don't try with UWP, ever. all of opencv's codebase is plain, unmanaged c++

if you're just starting, don't go on such an adventure, instead please try with

edit flag offensive delete link more


Like @berak stated, UWP works not nicely together with C++. It is possible, but it gives you tons of headaches on the way there.

StevenPuttemans gravatar imageStevenPuttemans ( 2019-01-16 04:46:09 -0500 )edit

^^ hmm, have a look at the links below, it seems the ms folks have changed a relevant detail.

while the prev. attempts (like the UWP samples in opencv) tried to do it ALL in managed c++ (gulp !), the newer attempt seems to be: let opencv work, as it is intended (all unmanaged), then run away with a pixel pointer, and do any gui from c# !

seems much less frragile, this way to me !

berak gravatar imageberak ( 2019-01-16 05:48:41 -0500 )edit

answered 2019-01-16 05:28:33 -0500

IanB gravatar image

I found a sample which does everything, it is very impressive, doing blur, houghlines, etc in uwp from webcam smoothly at full framerate 30fps.

edit flag offensive delete link more


yea, you probably meant this one, but again:

for showing images, you will have to use, whatever UWP comes with, not highgui

berak gravatar imageberak ( 2019-01-16 05:40:39 -0500 )edit

yes I think it's that one - but the drawing commands that uses are into opencv (line, drawContours, etc) which just work. So maybe the sample I first started with was an old one and namedWindow and imshow just aren't needed anymore and don't exist. Anyway, I have an excellent platform to start from. Thanks everyone, might be some more silly questions from me soon

IanB gravatar imageIanB ( 2019-01-16 06:12:58 -0500 )edit

you never told us, which opencv you installed, and how.

did you use the ms branch ? (it probably does not come with highgui)

berak gravatar imageberak ( 2019-01-16 06:17:26 -0500 )edit

literally download from the link above, it has loads of sample projects, open the solution CameraOpenCV, and it just works. Unfortunately I have been distracted by some other things so have not got further than that yet

IanB gravatar imageIanB ( 2019-01-16 08:47:32 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-01-13 12:00:59 -0500

Seen: 227 times

Last updated: Jan 16 '19