difference sift matching output in matlab and opencv ?????

asked 2016-07-05 08:29:50 -0600

Amir.t gravatar image

updated 2016-07-05 08:30:58 -0600

hi guys i trying sift matching in opencv and got bad result , but with same picture in matlab result is excellent...why ??? image description

in above picture , left picture is output of opencv sift matching and in right sift matching by matlab pictures is equal and output is different...

is there anybody to help me ???? thank a lot

edit retag flag offensive close merge delete

Comments

1

It seems that Matlab doesn't have SIFT. Can you link to the Matlab implementation you used?

Also, is it normal that the image sizes are not the same between the two?

Eduardo gravatar imageEduardo ( 2016-07-05 10:42:08 -0600 )edit

thank for answer images size are same.but the left picture has cropped and zoomed.it not seems that have effect on result. i think that matlab code is correct but in result of opencv is not good i need a correct opencv code about Sift image matching

Amir.t gravatar imageAmir.t ( 2016-07-07 02:35:44 -0600 )edit

enter code here

    I1=imreadbw('c:\st11.jpg') ;
    I2=imreadbw('c:\test1.jpg') ;
    I1=I1-min(I1(:)) ;
    I1=I1/max(I1(:)) ;
    I2=I2-min(I2(:)) ;
    I2=I2/max(I2(:)) ;
    fprintf('Computing frames and descriptors.\n') ;
    [frames1,descr1,gss1,dogss1] = sift( I1, 'Verbosity', 1 ) ;
    [frames2,descr2,gss2,dogss2] = sift( I2, 'Verbosity', 1 ) ;
    figure(11) ; clf ; plotss(dogss1) ; colormap gray ;
    figure(12) ; clf ; plotss(dogss2) ; colormap gray ;
    drawnow ;
    figure(2) ; clf ;
    subplot(1,2,1) ; imagesc(I1) ; colormap gray ;
    hold on ;
    h=plotsiftframe( frames1 ) ; set(h,'LineWidth',2,'Color','g') ;
    h=plotsiftframe( frames1 ) ; set(h,'LineWidth',1,'Color','k') ;
Amir.t gravatar imageAmir.t ( 2016-07-07 02:45:29 -0600 )edit

enter code here

fprintf('Computing matches.\n') ;
        descr1=uint8(512*descr1) ;
        descr2=uint8(512*descr2) ;
        tic ;
        matches=siftmatch( descr1, descr2 ) ;
        fprintf('Matched in %.3f s\n', toc) ;
        figure(3) ; clf ;
        plotmatches(I1,I2,frames1(1:2,:),frames2(1:2,:),matches) ;
        drawnow ;
Amir.t gravatar imageAmir.t ( 2016-07-07 02:51:17 -0600 )edit

this codes is image matching by sift in matlab

Amir.t gravatar imageAmir.t ( 2016-07-07 02:52:40 -0600 )edit

You should edit your question and add the C++ code you used. If you can, you should also add the individual images.

If the image of the front car for the C++ case has the same size than in your right example, you should check which criterion you used to retain the matches.

Eduardo gravatar imageEduardo ( 2016-07-07 06:42:39 -0600 )edit

i use this code c++

Amir.t gravatar imageAmir.t ( 2016-07-09 12:13:44 -0600 )edit

i think my code is wrong and anybody have a correct code Sift image matching by Opencv C++????

Amir.t gravatar imageAmir.t ( 2016-07-09 12:16:05 -0600 )edit