Ask Your Question
0

How to improve homography

asked Jun 9 '15

bjorn89 gravatar image

Hi guys, I'm implementing manually a stitcher from a video.Here's the problem: often,it seems that the homography isn't stimated correctly.I say this because when I'm going to stitch the new frame to the mosaic, only a part fits well, and the other part seems "sliced". How can I improve the ransac algorithm for getting better results? I'm using opencv 3 with AKAZE, with a threshold of 0.00001 (it's very low but it work a lot better respect to SURF!!!) and I'm calculating the homography with this parameters:

Mat H = findHomography(obj, scene, RANSAC,2.5);

(I've read the 2.5 from AKAZE paper)

Hope someone could help

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Jun 9 '15

iamprivate gravatar image

Try using top matched points (like top 10) instead of applying threshold. Usually top matched points are good enough matches. I dont prefer using threshold coz you cant come up with best which fits for all

Preview: (hide)

Comments

How can I take top matches using AKAZE?

bjorn89 gravatar imagebjorn89 (Jun 10 '15)edit

When you match key points , you get result as MatOfDMatch. Convert that to List<dmatch> , then sort the list based on the distance , in ascending order . So now you can take 10 DMatch objects from list from i 0 to 10

DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING); MatOfDMatch matches = new MatOfDMatch(); matcher.match( descriptorsUser, descriptorsTemplate, matches ); List<dmatch> listMatches = matches.toList();

    Collections.sort(listMatches, new Comparator<DMatch>(){

        @Override
        public int compare(DMatch arg0, DMatch arg1) {
            if(arg0.distance<arg1.distance)
            return -1;
            else if(arg0.distance>arg1.distance)
            return 1;
            else
                return 0;
        }});

List<dmatch> goodMatches = listMatches.subList(0, 10);

iamprivate gravatar imageiamprivate (Jun 10 '15)edit

Sorry man but it doesn't work :S

bjorn89 gravatar imagebjorn89 (Jun 10 '15)edit

Question Tools

1 follower

Stats

Asked: Jun 9 '15

Seen: 966 times

Last updated: Jun 09 '15