[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libcvd-members] Problems with fast corner code
From: |
Edward Rosten |
Subject: |
Re: [libcvd-members] Problems with fast corner code |
Date: |
Fri, 3 Aug 2007 17:21:42 -0600 (MDT) |
On Fri, 3 Aug 2007, Georg Klein wrote:
This is with fast_corner_detect_10, but probably applies to others as well.
fast_corner_detect_10, when using faster_blah_10, crashes on images whose
width is not a multiple of 16; this is because of the lines
const byte* const end = I[I.size().y - 3]-16;
for (const byte* p = I[3] + 16; p!=end; p+=16) {
^^^^
For images where size isn't a multiple of 16 but the check still works (e.g.
width multiple of 8, even number of rows) the code doesn't crash, but
produces spurious corners at the image edges.
Before the recent fast merge, this was not a problem since I was using slow
FAST for the cases where this comes up. I don't understand the faster code
enough to fix this myself, alas.
OK, This is not my code, but I'll do my best here...
The code runs through the image testing 16 pixels at a time for FAST-ness.
It doesn't bother going row by row, it just treats the image as a large
contiguous block and rejects the corners detected too close to the edge
in a post processing step.
It also checks the first few and last few pixels "by hand" since it can't
use SSE for them.
faster_9 is the same and it probably suffers from the same bug.
What I could do is add checks to the logic
which decides which detector to use, but I don't think that's the right way,
no?
I've checked in some new code, which may or may not contain a fix, but you
can test it if you wish. This one instead goes row by row, but the logic
is simpler. As a bonus, it's also "sub_image ready", in that it is a
trivial change to make it work on subimages.
Please let me know if this works because I think the other detectors will
share the bug, and they need to be fixed.
I don't know if I've really wrecked the speed of it with my changes. I
expect not too much, since my recent experience suggests that the compiler
is exceptionally good at "doing the right thing" when indexing images, and
[] based code can be faster than pointer based code.
-Ed