| 1 | initial version |
Here's what I would do:
imgkp is the list of your matched keypoints)img with the size of your rectangleHere's the code (untested, so might contain bugs):
Mat img=zeros(rows,cols,CV_8U);
for(size_t i=0;i<kp.size();i++)
img.at<uchar>(kp[i].pt)=255;
Mat filtimg;
boxFilter(img,filtimg,Size(100,100),Point(0,0),false);
Point min_loc, max_loc;double min,max;
minMaxLoc(your_mat, &min, &max, &min_loc, &max_loc);
rectangle(original,Rect(max.x,max.y,100,100),Scalar(0,0,255);
| 2 | No.2 Revision |
Here's what I would do:
imgkp is the list of your matched keypoints)img with the size of your Here's the code (untested, so might contain bugs):
Mat img=zeros(rows,cols,CV_8U);
for(size_t i=0;i<kp.size();i++)
img.at<uchar>(kp[i].pt)=255;
Mat filtimg;
boxFilter(img,filtimg,Size(100,100),Point(0,0),false);
Point min_loc, max_loc;double min,max;
minMaxLoc(your_mat, &min, &max, &min_loc, &max_loc);
rectangle(original,Rect(max.x,max.y,100,100),Scalar(0,0,255);
| 3 | No.3 Revision |
Here's what I would do:
imgkp is the list of your matched keypoints)img with the size of your rectangle (this will count the active pixel in the area)Here's the code (untested, so might contain bugs):
Mat img=zeros(rows,cols,CV_8U);
for(size_t i=0;i<kp.size();i++)
img.at<uchar>(kp[i].pt)=255;
Mat filtimg;
boxFilter(img,filtimg,Size(100,100),Point(0,0),false);
Point min_loc, max_loc;double min,max;
minMaxLoc(your_mat, minMaxLoc(filtimg, &min, &max, &min_loc, &max_loc);
rectangle(original,Rect(max.x,max.y,100,100),Scalar(0,0,255);
| 4 | No.4 Revision |
Here's what I would do:
imgkp is the list of your matched keypoints)img with the size of your rectangle (this will count the active pixel in the area)Here's the code (untested, so might contain bugs):
Mat img=zeros(rows,cols,CV_8U);
for(size_t i=0;i<kp.size();i++)
img.at<uchar>(kp[i].pt)=255;
Mat filtimg;
boxFilter(img,filtimg,Size(100,100),Point(0,0),false);
Point min_loc, max_loc;double min,max;
minMaxLoc(filtimg, &min, &max, &min_loc, &max_loc);
rectangle(original,Rect(max.x,max.y,100,100),Scalar(0,0,255);
rectangle(original,Rect(max_loc.x,max_loc.y,100,100),Scalar(0,0,255);
| 5 | No.5 Revision |
Here's what I would do:
imgkp is the list of your matched keypoints)img with the size of your rectangle (this will count the active pixel in the area)Here's the code (untested, so might contain bugs):
Mat img=zeros(rows,cols,CV_8U);
img=zeros(original.size(),CV_8U);
for(size_t i=0;i<kp.size();i++)
img.at<uchar>(kp[i].pt)=255;
Mat filtimg;
boxFilter(img,filtimg,Size(100,100),Point(0,0),false);
Point min_loc, max_loc;double min,max;
minMaxLoc(filtimg, &min, &max, &min_loc, &max_loc);
rectangle(original,Rect(max_loc.x,max_loc.y,100,100),Scalar(0,0,255);