Updated by Andrey Kamaev almost 13 years ago

Hi all,
When using a Descriptor extractor based on the OpponentSIFT descriptor and using the @DenseFeatureDetector@ DenseFeatureDetector keypoint detector, a segmentation fault occurs.

This error is not encountered when the descriptor is SIFT, SURF or OpponentSURF

The problem seems to come from the fact that the number of keypoints returned by the SIFT descriptor on each opponent channel is not the same for each channels... which is strange if a dense grid is chosen

Explanations :
if the Feature detector object used is a @DenseFeatureDetector@ DenseFeatureDetector and if the feature descriptor is the @OpponentSIFTDescriptor@ OpponentSIFTDescriptor :
in @modules/features2d/src/descriptors.cpp modules/features2d/src/descriptors.cpp : void OpponentColorDescriptorExtractor::computeImpl@ OpponentColorDescriptorExtractor::computeImpl
the single component extractor (SIFT/SURF, etc.) is applied on a dense grid on each Opponent channel in the for loop.
However, in the case of the OpponentSIFT the number of "channelKeypoints" is not the same for each channel
Then, the remaining of the function fails at the while loop level :
<pre><code class="cpp">
while(
"while( channelKeypoints[0][idxs[0][cp[0]]].class_id < maxInitIdx && cp[0] < channelKeypoints[0].size() ) { cp[0]++; }

while( channelKeypoints[1][idxs[1][cp[1]]].class_id < maxInitIdx && cp[1] < channelKeypoints[1].size() ) { cp[1]++; }

while( channelKeypoints[2][idxs[2][cp[2]]].class_id < maxInitIdx && cp[2] < channelKeypoints[2].size() ) { cp[2]++; }
</code></pre>
" here is the segmentation fault location.

hope it helps.

Best regards.
Alex

Back