rgiduthuri/openvx_tutorial

Issue while compiling excersises with opencv_camera_display.h

Closed this issue · 5 comments

Hello,

I've tried your openvx_tutorials exercises and it's very interesting with work on. However when i'm trying to execute any of the exercises i've facing issue during the compilation process.

This is the error message that i'm facing when i'm trying to compile. Please help me on this to fix it. Thank you!

In file included from solution_exercise1.cpp:35:0: opencv_camera_display.h: In member function ‘int CGuiModule::GetWidth()’: opencv_camera_display.h:86:33: error: ‘CV_CAP_PROP_FRAME_WIDTH’ was not declared in this scope return (int) m_cap.get( CV_CAP_PROP_FRAME_WIDTH ); ^~~~~~~~~~~~~~~~~~~~~~~ opencv_camera_display.h: In member function ‘void CGuiModule::DrawText(int, int, const char*)’: opencv_camera_display.h:122:87: error: ‘CV_AA’ was not declared in this scope cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar( 128, 0, 0 ), 1, CV_AA ); ^~~~~ opencv_camera_display.h:122:87: note: suggested alternative: ‘CV_8U’ cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar( 128, 0, 0 ), 1, CV_AA ); ^~~~~ CV_8U

Hello @iravikiran ,

Please provide a little bit more information on what OpenCV version are you using.
According to the compilation error that you have posted, it looks like "CV_CAP_PROP_FRAME_WIDTH" is not defined.
I'm assuming you are using OpenCV 4+.

You can try two solutions:

  1. One way is to try out using OpenCV-3.1 version, as mentioned in the requirements.
  2. The "CV_CAP_PROP_FRAME_WIDTH" in OpenCV4+ is referred as "CAP_PROP_FRAME_WIDTH", you can change the code and try it out.

Hi Krishna, Thanks for your response.

Yes, I'm currently using OpenCV version 4.2

I also tried changing to "CAP_PROP_FRAME_WIDTH" in the header code. But still no luck. I'm still facing the error when trying to compile.

In file included from exercise1.cpp:35:0: opencv_camera_display.h: In member function ‘int CGuiModule::GetWidth()’: opencv_camera_display.h:86:33: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope return (int) m_cap.get( CAP_PROP_FRAME_WIDTH ); ^~~~~~~~~~~~~~~~~~~~ opencv_camera_display.h:86:33: note: suggested alternative: In file included from /usr/local/include/opencv2/highgui.hpp:51:0, from /usr/local/include/opencv2/opencv.hpp:68, from opencv_camera_display.h:33, from exercise1.cpp:35: /usr/local/include/opencv2/videoio.hpp:135:8: note: ‘CAP_PROP_FRAME_WIDTH’ CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream. ^~~~~~~~~~~~~~~~~~~~ In file included from exercise1.cpp:35:0: opencv_camera_display.h: In member function ‘void CGuiModule::DrawText(int, int, const char*)’: opencv_camera_display.h:122:87: error: ‘CV_AA’ was not declared in this scope cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar( 128, 0, 0 ), 1, CV_AA ); ^~~~~ opencv_camera_display.h:122:87: note: suggested alternative: ‘CV_8U’ cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar( 128, 0, 0 ), 1, CV_AA ); ^~~~~ CV_8U

kindly please help me on this, Thanks.

Any help with this issue?

Thanks,

@iravikiran Did you try using opencv version 3.1 ?

Updated the build scripts and README.md to work with OpenVINO/OpenCV. It's in master now. Please re-open the issue if the problem still persists.