I am using ofxOpenCv and my update function has the following code:
void ofApp::update(){
video.update(); //Decode the new frame if needed
if ( video.isFrameNew() ) {
//Convert to ofxCv images
ofPixels & pixels = video.getPixels();
currentColor.setFromPixels( pixels );
gray = currentColor;
Mat img1 = Mat(gray.getHeight(), gray.getWidth(), CV_8UC1, gray.getCvImage(), 0);
Mat img2 = Mat(gray.getHeight(), gray.getWidth(), CV_8UC1, gray.getCvImage(), 0);
Mat flow; //Image for flow
calcOpticalFlowFarneback( img1, img2, flow, 0.7, 3, 11, 5, 5, 1.1, 0 );
Mat imageCV = Mat(gray.getHeight(), gray.getWidth(), CV_8UC1, gray.getCvImage(), 0);
vector<Point2f> corners;
goodFeaturesToTrack(imageCV, corners, 200, 0.01, 4); //param
}
}
When I try to compile it throws an error saying:
use of undeclared identifier goodfeaturestotrack
and
use of undeclared identifier calcOpticalFlowFarneback
I am not sure why this stopped working. I have called the using namespace cv;
command and the image processing function of openCV should be visible. The good features to track function is declared inside here: ofxOpenCv/libs/opencv/include/opencv2/imgproc.hpp so I don’t know why it can’t see that and the optical flow one. This example used to work on ofx 0.0.98. It’s something that changed with 0.10. (Error both on Mac Mojave and Linux Mint 19.01
Any ideas greatly appreciated
The