【发布时间】:2015-12-27 21:54:54
【问题描述】:
我是opencv的新手,你能帮我找到哈里斯使用以下代码检测到的点的坐标吗?
源图片是img
我想将角点的坐标存储在矩阵S
Mat S;
dst = Mat::zeros( img.size(), CV_32FC1 );
cornerHarris( img, dst, 7, 5, 0.0001, BORDER_DEFAULT );
dst = Mat::zeros( img.size(), CV_32FC1 );
cornerHarris( img, dst, 7, 5, 0.0001, BORDER_DEFAULT );
// Normalizing
normalize( dst, dst_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat() );
convertScaleAbs( dst_norm, dst_norm_scaled );
for( int j = 0; j < dst_norm.rows ; j++ ) {
for( int i = 0; i < dst_norm.cols; i++ ) {
if( (int) dst_norm.at<float>(j,i) > thresh ) {
S.at<int >(j,i)= (int) dst_norm.at<int>(j,i);
}
}
}
【问题讨论】: