I am trying to use the cvGoodFeatureToTrack
function in Visual Studio 2010 with the image type as Mat
. Most of the examples I have seen use the I
As a starting point, if using C++ anyway (like your use of cv::Mat
and cv::cvtColor
suggests), then why not use C++ interface for the rest, too?
This would mean the use of cv::goodFeaturesToTrack or a cv::GoodFeaturesToTrackDetector, which are made to work on cv::Mat
and friends instead of making unneccessary casts from cv::Mat
to IplImage*
.
cv::Mat grayFrame;
std::vector<cv::Point2f> corners;
double quality_level = 0.1;
double min_distance = 10;
int eig_block_size = 3;
int use_harris = false;
const int MAX_CORNERS = 10;
cv::cvtColor(CurrFrame, grayFrame, CV_BGR2GRAY);
cv::goodFeaturesToTrack(grayFrame,
corners,
MAX_CORNERS,
quality_level,
min_distance,
cv::noArray(),
eig_block_size,
use_harris);