Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

OpenCV 3 constants not recognized #220

Closed
zj88 opened this issue Jun 17, 2018 · 4 comments
Closed

OpenCV 3 constants not recognized #220

zj88 opened this issue Jun 17, 2018 · 4 comments

Comments

@zj88
Copy link

zj88 commented Jun 17, 2018

I have latest version of OpenCV. I uncomment OPENCV_VERSION := 3 in Makefile.config and run make all. I get:

CXX src/caffe/layers/lstm_layer.cpp
src/caffe/layers/video_data_layer.cpp: In member function 'virtual void caffe::VideoDataLayer::DataLayerSetUp(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&)':
src/caffe/layers/video_data_layer.cpp:92:30: error: 'CV_CAP_PROP_FRAME_COUNT' was not declared in this scope
total_frames_ = cap_.get(CV_CAP_PROP_FRAME_COUNT);
^~~~~~~~~~~~~~~~~~~~~~~
src/caffe/layers/video_data_layer.cpp:97:14: error: 'CV_CAP_PROP_POS_FRAMES' was not declared in this scope
cap_.set(CV_CAP_PROP_POS_FRAMES, 0);
^~~~~~~~~~~~~~~~~~~~~~
make: *** [.build_release/src/caffe/layers/video_data_layer.o] Error 1

Changing to cv::CAP_PROP_FRAME_COUNT fixes, but there are many other constants not recognized. Is Intel Caffe only working with OpenCV 2.4?

@chuanqi129
Copy link
Contributor

We also support OpenCV3. What's your build method, make or cmake ? And what's your platform and env? could you try it again after you remove opencv and install it?

@ftian1
Copy link
Contributor

ftian1 commented Nov 28, 2018

We have no problem with OpenCV version being 3. maybe it's your env issue, such as forgetting to set INCLUDE_PATH/LD_LIBRARY_PATH. I would suggest you to use cmake build, which can automatically find corresponding opencv path as soon as you set right CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH.

so close it first.

@ftian1 ftian1 closed this as completed Nov 28, 2018
@jw-redpanda
Copy link

CV_CAP_PROP_POS_FRAMES and CV_CAP_PROP_FRAME_COUNT are legacy C constant. Use the following instead (removing prefix CV_):
using namespace cv;
// CAP_PROP_POS_FRAMES
// CAP_PROP_FRAME_COUNT

@catmasteryip
Copy link

CV_CAP_PROP_POS_FRAMES and CV_CAP_PROP_FRAME_COUNT are legacy C constant. Use the following instead (removing prefix CV_):
using namespace cv;
// CAP_PROP_POS_FRAMES
// CAP_PROP_FRAME_COUNT

The problem persists

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants