Ask Your Question

AMH's profile - activity

2018-08-10 01:43:28 -0600 received badge  Popular Question (source)
2014-09-26 14:45:30 -0600 commented question Opencv Repeatability Result not make sense?

zedv thanks for your answer . i answered your comment on stackoverflow .by the way thanks for joining both opencv and Stackoverflow for helping.

2014-09-25 00:54:51 -0600 commented question Opencv Repeatability Result not make sense?

@thdrksdfthmn its getting worse on other image sequence . i use mikolajczyk Dataset. if i use function of opencv for changing image such as adding noise, rotation , GaussianBlur filter and ... the repeatability values match the result of formula. same code for finding keypoints have been use in these two case.

2014-09-23 05:17:36 -0600 asked a question Opencv Repeatability Result not make sense?

Hi i'm trying to evaluate SIFT and SURF Detectors by Repeatability criteria.

i find out that below method can find Repeatability ,Correspondence of SIFT and SURF

 cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter);

some of the result are listed below:

Number  Repeatibility   Correspond  Keypoint 1st    Keypoint 2th    
1to2    0.7777778            140        224              180    
1to3    0.7125               114        224              161    
1to4    0.704918              86        224              123    
1to5    0.6853933             61        224               89    
1to6    0.6521739             45        224               69

for first row repeatibility can compute as --> (correnspond)/min(keypoint1st,keypoint2th) = (140/180) = 0.7777778 but for other rows it's value is different from what i compute with above formula.

can somebody tell why is that happening? Best Regards.

2014-08-23 09:55:29 -0600 asked a question synthesis Rotation Repeatability with SIFT and SURF

Hi

i rotate images with below code which i find on Stackoverflow website

                 int theta = 10*(counter);
                 counter++ ; 
                 Mat src,frame, frameRotated;
                 src = img_1c;


                 int diagonal = (int)sqrt((double)    (src.cols*src.cols+src.rows*src.rows));
                 int newWidth = diagonal;
                 int newHeight =diagonal;

                 int offsetX = (newWidth - src.cols) / 2;
                 int offsetY = (newHeight - src.rows) / 2;
                 Mat targetMat(newWidth, newHeight, src.type());
                 Point2f src_center(targetMat.cols/2.0F, targetMat.rows/2.0F);

             src.copyTo(frame);
                 double radians = theta * M_PI / 180.0;
                 double sin = abs(std::sin(radians));
                 double cos = abs(std::cos(radians));

             frame.copyTo(targetMat.rowRange(offsetY, offsetY + frame.rows).colRange(offsetX, offsetX + frame.cols));
                 Mat rot_mat = getRotationMatrix2D(src_center, theta, 1.0);
                 warpAffine(targetMat, frameRotated, rot_mat, targetMat.size());
                 Rect bound_Rect(frame.cols,frame.rows,0,0);

             int x1 = offsetX;
             int x2 = offsetX+frame.cols;
                 int x3 = offsetX;
                 int x4 = offsetX+frame.cols;

             int y1 = offsetY;
                 int y2 = offsetY;
                 int y3 = offsetY+frame.rows;
                 int y4 = offsetY+frame.rows;

                 Mat co_Ordinate = (Mat_<double>(3,4) << x1, x2, x3, x4,
                             y1, y2, y3, y4,
                             1,  1,  1,  1 );
            Mat RotCo_Ordinate = rot_mat * co_Ordinate;

                     for(int i=0;i<4;i++){
                if(RotCo_Ordinate.at<double>(0,i)<bound_Rect.x)
                 bound_Rect.x=(int)RotCo_Ordinate.at<double>(0,i); //access smallest 
                     if(RotCo_Ordinate.at<double>(1,i)<bound_Rect.y)
                  bound_Rect.y=RotCo_Ordinate.at<double>(1,i); //access smallest y
                         }

                 for(int i=0;i<4;i++){
                 if(RotCo_Ordinate.at<double>(0,i)>bound_Rect.width)
                 bound_Rect.width=(int)RotCo_Ordinate.at<double>(0,i); //access largest x
                 if(RotCo_Ordinate.at<double>(1,i)>bound_Rect.height)
                bound_Rect.height=RotCo_Ordinate.at<double>(1,i); //access largest y
                         }

             bound_Rect.width=bound_Rect.width-bound_Rect.x;
             bound_Rect.height=bound_Rect.height-bound_Rect.y;

             Mat cropedResult;
             Mat ROI = frameRotated(bound_Rect);
             ROI.copyTo(cropedResult);

and compute homography with below code which i have written:

 int im1rows = img_1.rows;
                 int im1cols = img_1.cols;
                 cv::Size s1 = img_1.size();
                 im1rows = s1.height;
                 im1cols = s1.width;
                 float centerX1 ;
                 float centerY1 ;
                 int im2rows = img_2.rows;
                 int im2cols = img_2.cols;
                 cv::Size s2 = img_2.size();
                 im2rows = s2.height;
                 im2cols = s2.width ; 
                 float centerX2;
                 float centerY2;
                 if(theta==90)
                 {
                     centerX1=0 ; 
                     centerX2=im2rows;
                     centerY1=0;
                     centerY1=im2cols;
                 }
                 else if(theta==270)
                 {
                     centerX1=0 ; 
                     centerY1=0;
                     centerX2=im2rows;
                     centerY2=im2cols;
                 }

                 else
                 {
                     centerX1 = im1cols/2.0f;
                     centerY1 = im1rows/2.0f;
                     centerX2 = im2cols/2.0f;
                     centerY2 = im2rows/2.0f;
                 }


                 h12.create(3, 3, CV_32FC1);
                 (h12.row(0)).col(0)= cos ; 
                 (h12.row(0)).col(1)=-sin ; 
                 (h12.row(0)).col(2)=centerX2-centerX1 ; 
                 (h12.row(1)).col(0)=sin ;
                 (h12.row(1)).col(1)=cos ;
                 (h12.row(1)).col(2)=centerY2-centerY1;
                 (h12.row(2)).col(0)=0;
                 (h12.row(2)).col(1)=0;
                 (h12.row(2)).col(2)=1;

you can see that i made condition for 90 and 270 degrees since correspondence point was 0 when i evaluated rotated images with reference image with :

cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter);

it's also happennig for 80 110 280 and 260 degrees .

i don't know if i compute homographies incorrectly or the rotation procedure ... (more)

2014-08-21 00:48:01 -0600 commented question How come Surf Detector is better than Sift in my code

x-axis is the sequence of blur images.

2014-08-20 12:06:55 -0600 asked a question How come Surf Detector is better than Sift in my code

Hi Hi i'm evaluating SIFT and SURF Detectors in my project with mikolajczyk Dataset. you can find it here:http://www.robots.ox.ac.uk/~vgg/research/affine/

according to below papers SIFT should outperform SURF in scale, blur and rotation changes:

"A performance evaluation of SIFT and SURF for multispectral image matching"

"A Comparison of SIFT, PCA-SIFT and SURF" Same Dataset has been used.

"SIFT and SURF Performance Evaluation Against Various Image Deformations on Benchmark Dataset"

i get below result for Bike (Blur) images

image description

i also used below codes for SIFT and SURF detector: (it's main code and not all of it) //Notice That SIFT and SURF code run separately and variables not getting overwrite.

SiftFeatureDetector detector;
detector.detect(img_1, key_points_1);
detector.detect(img_2, key_points_2);

int minHessian = 5000;             
SurfFeatureDetector detector(minHessian);   
detector.detect(img_1, key_points_1);
detector.detect(img_2, key_points_2);

cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter); //H12 is homography matrix which was included in the Dataset

Did i miss something ? why my results is different?(also checked scale and rotation change and still SURF outperform SIFT)

2014-07-11 03:01:30 -0600 received badge  Supporter (source)
2014-07-08 06:25:35 -0600 commented question evaluate SIFT and SURF

Thanks steven. i would appreciate if you guide me and show me the way of how can i write it.

2014-07-08 02:20:32 -0600 received badge  Editor (source)
2014-07-08 01:28:27 -0600 received badge  Student (source)
2014-07-08 00:25:23 -0600 asked a question evaluate SIFT and SURF

Hi

i need to evaluate SIFT and SURF with some criteria that mentioned on these papers "A comparison to SIFT PCA-SIFT and SURF" which can be found here : http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.301.7041

and "Evaluation of Local Detectors and Descriptors for Fast Feature Matching" which you can download it from miksik.co.uk/papers/miksik2012icpr.pdf .

i noticed that each paper defined repeatibility differently. in first paper it has been defined

image description

and in second paper

image description

which one should i use for SIFT and SURF evaluation?

and also in OpenCV i found a function named evaluateFeatureDetector. (simple code: cv::evaluateFeatureDetector(img_1c, img_2c, h12, &key_points_1, &key_points_2, repeatability, corrCounter);)

i want to know that which formula OpenCV use for finding repeatibility. also how can i find Precision-recall in OpenCV.

Edited : find evaluateGenericDescriptorMatcher method which can be used for finding recalls. don't know how to use it. also couldn't find any documentation for it.

Best Regards