Ask Your Question
0

OpenCV some Functions are "unknown"

asked 2013-01-06 01:04:27 -0500

newbie gravatar image

updated 2013-01-06 03:12:32 -0500

Hello,

I want to use the Rectangel function: void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)

I'm programming in Qt Creator on a Ubuntu PC(x86). Till now my application is working(opening a camera stream and making some filtering) now I want to draw a rectangle in the window, but the compiler says "error: 'Rectangle' was not declared in this scope" and the same happens if I want to use the Function SetImageROI

I guess it's a primitive mistake(any file is missing?), it seems like that I'm "blind" !

Here my .pro file and the headers I included in main.cpp

.pro file:

INCLUDEPATH += /usr/local/include/opencv2

LIBS += -L/usr/local/lib \
-lopencv_core \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_features2d \
-lopencv_calib3d \
-lopencv_flann \
-lopencv_gpu \
-lopencv_legacy \
-lopencv_ml \
-lopencv_nonfree \
-lopencv_objdetect \
-lopencv_photo \
-lopencv_stitching \
-lopencv_ts \
-lopencv_video \`enter code here`
-lopencv_videostab

main.cpp:

#include <opencv2/opencv.hpp>
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-01-06 03:23:06 -0500

There is only rectangle (first r in lower case) function in OpenCV core module. I think it just typo. There is cvSetImageROI function in legacy C API. Do you mean this function? You need to add "opencv/cv.h" to includes for it.

edit flag offensive delete link more

Comments

I love you, thank you so much!!!!!! greets newbie

newbie gravatar imagenewbie ( 2013-01-06 06:59:22 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-01-06 01:04:27 -0500

Seen: 142 times

Last updated: Jan 06 '13