Ask Your Question
0

Not declared in the scope

asked 2012-11-21 09:00:51 -0500

Szczepan gravatar image

updated 2012-11-21 09:17:03 -0500

Hello. Yesterday I finally install opencv and my first example works fine. But second not, here's my code .

int main()

{

IplImage * img = cvLoadImage("obrazek.jpg");
cvNamedWindow("Przetworzone");
cvNamedWindow("Nie przetworzone");
cvShowImage("Przetworzone",img);
IplImage * img_wyj = cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,3);
cvSmooth(img,img_wyj,CV_GAUSSIAN,11,11);
cvShowImage("Nie przetworzone",img_wyj);
cvWaitKey(0);
cvReleaseImage(&img);
cvReleaseImage(&img_wyj);
cvDestroyWindow("Przetworzone");
cvDestroyWindow("Nie przetworzone");

return 0;

}

path_to_the_open_cv/main.cpp:29: error:'CV_GAUSSIAN' was not declared in this scope path_to_the_open_cv/main.cpp:29: error:'cvSmooth' was not declared in this scope In other example I got error like this. path_to_the_open_cv/main.cpp:14: error:'Cv_Window_Autosize' was not declared in this scope when I want to do this(window called "Kamera" already exist).

cvNamedWindow("Kamera",Cv_Window_Autosize);

Im using QT Creator and im including opencv2/core/core.hpp, opencv2/highgui/highgui.hpp, opencv2/highgui/highgui_c.h.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-11-21 09:28:30 -0500

SR gravatar image

You are missing

#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
edit flag offensive delete link more

Comments

Now is everything ok. I write Cv_Window_Autosize and I should CV_WINDOW_AUTOSIZE. In second example I forgot libraries.

Szczepan gravatar imageSzczepan ( 2012-11-21 09:48:22 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-11-21 09:00:51 -0500

Seen: 7,575 times

Last updated: Nov 21 '12