-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find_Scale_Space_Extrema questions #30
Comments
and to add on a question, In the above picture assume both the orange and blue extremas (small circle pixel, larger circle extrema search radius) are in the same evolution and the red is in the next evolution. For simplicity lets assume orange's response is 1, red's is 2 and blue's is 3. On orange and blue's find iteration both are selected as feature points as the are the maximum for the search radius and don't overlap with each other. When red's iteration occurs red is selected as a feature (assuming orange is first in the feature list) via this code
Since red's response is higher than orange's, red is listed as a repeat of orange and will later replace orange. However since there is a "break" upon finding any feature point within distance the blue point is never checked against the red. Later when this code executes
} Blue never gets compared to red either as red is outside the distance searched by blue. Even if it had been since red is a lower value it would not have considered it a repeat. In the end we end up with 2 feature points, blue which clearly should be and red which has an extrema within its range that is higher, is this the intent? |
Even worse I think is if red's response is 3, orange's is 2 and blue's is 1. First iteration orange and blue are selected. Next iteration red replace orange and we end up with 2 feature points red which is clear but also blue which is smallest of the 3. |
Regarding your last message, in the OpenMVG AKAZE implementation we (@rperrot, @pmoulon) choose to do a full search in order to avoid the selection problem of the original method https://github.com/openMVG/openMVG/blob/master/src/openMVG/features/akaze/AKAZE.cpp#L243 |
Hi,
The reasoning behind the current conversion is as follows:
- each pixel gives the intensity of the image at the pixel center (not in
the top left pixel corner)
- octave 1 is generated from octave 0 by down sampling with cv::resize()
- cv::resize() generates the intensity values by interpolation, so the
intensity of pixel (0/0) on octave 1 is equal to the interpolated intensity
between the pixels (0/0), (0/1), (1/0), (1/1) on octave 0 therefore pixel
(0/0) on octave 1 is located on (0.5/0.5) wrt. octave 0
- similarly pixel (0/0) on octave 2 is located on (0.5/0.5) wrt. octave 1
and therefore on (1.5/1.5) wrt. octave 0
- this results in the shift of the pixel centers between the octaves as
given by the current conversion formula x*2^(O2-O1) + .5*(2^(O2-O1)-1)
Does this make sense to you?
*Second why does the repeat filtering only look down/up 1 level of
evolution? If multiple feature points consistently show up centered in
close proximity in multiple evolution (no matter how far away they are in
evolution) why are they not considered the same point? It might make sense
to filter any feature point clusters after sub-pixel positions are
calculated.*
This is an algorithmic decision. Some other methods like SURF look in a
3x3x3 neighborhood for scale space extrema. Other methods like ORB do not
perform any non-maxima suppression in the scale space. If you find another
non-maxima criteria that looks through more evolution levels, works
reasonably well and it is fast, please let me know.
Regards,
Pablo
…On 20 February 2017 at 21:35, caseymcc ***@***.***> wrote:
I am writing an OpenCL version of the code and I have most things working
in a basic manner (optimization is still needed). But when locating the
extrema my implementation is locating about a 3rd less feature points and
closer examination of Find_Scale_Space_Extrema in the original code I am
slowing finding the subtle differences. But it has left me with some
lingering questions.
First it seems that higher octave pixels position are not properly
centered in regards to the original resolution. The algorithm seems to
center the pixel over the top left pixel that the higher octave represents,
meaning that all distance calculations seem to have a shift.
[image: image]
<https://cloud.githubusercontent.com/assets/2903823/23142003/4d6eebee-f77f-11e6-986b-279de9f30868.png>
I would have expect more like this
[image: image]
<https://cloud.githubusercontent.com/assets/2903823/23142008/554485d6-f77f-11e6-83dd-578869c2f439.png>
Shouldn't there be a half pixel shift added to all the calculations for
pixel position during the extrema search?
Second why does the repeat filtering only look down/up 1 level of
evolution? If multiple feature points consistently show up centered in
close proximity in multiple evolution (no matter how far away they are in
evolution) why are they not considered the same point? It might make sense
to filter any feature point clusters after sub-pixel positions are
calculated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#30>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABOPCHIk9UBGqxCHKnA8vy_VPjeuOOR5ks5regcPgaJpZM4MGo6Q>
.
|
I see where the center offset ".5*(ratio-1.0)" is used in the calculation of the final pixel location in both Find_Scale_Space_Extrema and Do_Subpixel_Refinement. However I was more questioning why is it not used in the distance calculation between pixels that are being compared. ~line 290
If the current pixel is in a higher octave, the pixel is calculating its distance from the top left corner of the top left pixel of the base resolution that the octave pixel represents. At octave 3 I believe that is a 4 pixel shift from center. And the keypoint is calculating from a center shifted position. Seems the points should be immediately center shifted before the distance calculation like:
and later when the ratio is used it will be in the center of the 4 pixels it represents in the lower octave. |
The main reason why the pixel location correction was not used in the
distance calculation was because of speed. And also because I did not find
improvements in my evaluation of the feature extractor with respect to
using the correction before distance calculation. I have also investigated
the use of kd-trees to perform the maxima selection and full search but did
not find much difference in the results. But please let me know if you
obtain significant performance differences.
…On 24 February 2017 at 16:58, caseymcc ***@***.***> wrote:
I see where the center offset ".5*(ratio-1.0)" is used in the calculation
of the final pixel location in both Find_Scale_Space_Extrema and
Do_Subpixel_Refinement. However I was more questioning why is it not used
in the distance calculation between pixels that are being compared.
~line 290
ratio = pow(2.0f, point.octave);
...
point.pt.x = jx;
point.pt.y = ix;
...
dist = (point.pt.x*ratio-kpts_aux[ik].pt.x)*(point.pt.x*ratio-kpts_aux[ik].pt.x) +
(point.pt.y*ratio-kpts_aux[ik].pt.y)*(point.pt.y*ratio-kpts_aux[ik].pt.y);
If these pixels are from different octaves then the higher octave pixel is
calculating its distance from the top left pixel of the lower octave. Seems
the points should be immediately center shifted before the distance
calculation like:
point.pt.x = jx+0.5f;
point.pt.y = ix+0.5f;
and later when the ratio is used it will be in the center of the 4 pixels
it represents in the lower octave.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABOPCH8F5yR8E9NsG0DoxUI0AESCg4ljks5rfwxQgaJpZM4MGo6Q>
.
|
Thanks for the reply. I was just checking to make sure there wasn't some mathematical/reliability/quality of result reason for the choices that were made. Performance will be a little arbitrary between the original and the GPU version and some algorithmic choices will have positive/negative results depending on the platform, so knowing that these choice have more to do with performance rather than the quality of the results gives more leeway in how I set it up for the GPU. I haven't got around to performance testing just yet as I still have some lingering result differences that I am trying to tract down. What led me down this path was that I was getting far fewer results than what the original was getting (after verifying that derivatives and evolutions were approximately the same if not exact). So I am back tracking to see where the differences are, one of the main ones was that I was comparing all levels of evolution when removing repeats rather than just 1 up/down. I have since altered it to work only 1 up/down and I believe that results in a better quality result. I can see now that it is more than just getting more points when doing that. The end result is that comparing a high octave to a low octave based on the proximity of point size invalidates some extremas that are truly unique. In the end I think I would like to filter based on some other metric than just the point size and after sub pixel is calculated (although this obvious adds more to the processing it is orders of magnitude lower than it is on the CPU). Ill post benchmarks once I can find the last linger issues and get a run or two at performance (some of the code I have written is grossly inadequate for the GPU). Thanks again. |
Ok, please keep me updated. Maybe you will also would like to take a look
at this CUDA A-KAZE implementation:
https://github.com/nbergst/akaze
I have not had the time to play with the CUDA implementation, but as far as
I have been told, it should produce similar results as the CPU version.
…On 27 February 2017 at 18:55, caseymcc ***@***.***> wrote:
Thanks for the reply.
I was just checking to make sure there wasn't some
mathematical/reliability/quality of result reason for the choices that
were made. Performance will be a little arbitrary between the original and
the GPU version and some algorithmic choices will have positive/negative
results depending on the platform, so knowing that these choice have more
to do with performance rather than the quality of the results gives more
leeway in how I set it up for the GPU. I haven't got around to performance
testing just yet as I still have some lingering result differences that I
am trying to tract down. What led me down this path was that I was getting
far fewer results than what the original was getting (after verifying that
derivatives and evolutions were approximately the same if not exact). So I
am back tracking to see where the differences are, one of the main ones was
that I was comparing all levels of evolution when removing repeats rather
than just 1 up/down.
I have since altered it to work only 1 up/down and I believe that results
in a better quality result. I can see now that it is more than just getting
more points when doing that. The end result is that comparing a high octave
to a low octave based on the proximity of point size invalidates some
extremas that are truly unique. In the end I think I would like to filter
based on some other metric than just the point size and after sub pixel is
calculated (although this obvious adds more to the processing it is orders
of magnitude lower than it is on the CPU).
Ill post benchmarks once I can find the last linger issues and get a run
or two at performance (some of the code I have written is grossly
inadequate for the GPU).
Thanks again.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABOPCKLYoLsuda6ELSe97N72OEUW6S8Eks5rgxwdgaJpZM4MGo6Q>
.
|
I am writing an OpenCL version of the code and I have most things working in a basic manner (optimization is still needed). But when locating the extrema my implementation is locating about a 3rd less feature points and closer examination of Find_Scale_Space_Extrema in the original code I am slowing finding the subtle differences. But it has left me with some lingering questions.
First it seems that higher octave pixels position are not properly centered in regards to the original resolution. The algorithm seems to center the pixel over the top left pixel that the higher octave represents, meaning that all distance calculations seem to have a shift.
I would have expect more like this
Shouldn't there be a half pixel shift added to all the calculations for pixel position during the extrema search?
Second why does the repeat filtering only look down/up 1 level of evolution? If multiple feature points consistently show up centered in close proximity in multiple evolution (no matter how far away they are in evolution) why are they not considered the same point? It might make sense to filter any feature point clusters after sub-pixel positions are calculated.
The text was updated successfully, but these errors were encountered: