FREAK detector causes segmentation fault on detect (Bug #2302)
Description
I have the following code which works great for SURF:
im = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) surfDetector = cv2.FeatureDetector_create("SURF") surfDescriptorExtractor = cv2.DescriptorExtractor_create("SURF") keypoints = surfDetector.detect(im) (kp, descritors) = surfDescriptorExtractor.compute(im,keypoints)
However, I want to use the new FREAK descriptor so I have updated the code to the following:
im = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) freakDetector = cv2.FeatureDetector_create('FREAK'); freakDescriptorExtractor = cv2.DescriptorExtractor_create("FREAK") keypoints2 = freakDetector.detect(im) (kp2, descritors2) = freakDescriptorExtractor.compute(im,keypoints2)
But then I get an empty response with the following error in the log:
child pid 915 exit signal Segmentation fault (11)
Have I missed something or is this a bug?
History
Updated by Joe Palmer over 12 years ago
Any luck on this?
I have tried many things but always get a segmentation fault
Updated by Rafael Saracchini about 12 years ago
Try to use another feature detector. As far I know, FREAK is only a feature descriptor. The call "cv2.FeatureDetector_create('FREAK')" will return NULL, thus causing a segfault when you try to use "detect". The SURF algorithm, instead can perform both, that's why the first code works well.
Updated by Kirill Kornyakov about 12 years ago
Joe, anybody, could you confirm that FREAK descriptor extractor works with other detectors? If so, we can cancel this bug. But it is possible that we need to update either documentation or to print an informative error message, rather than crash with segfault.
- Priority changed from Normal to Low
- Affected version set to branch '2.4'
Updated by Rafael Saracchini about 12 years ago
Kirill Kornyakov wrote:
Joe, anybody, could you confirm that FREAK descriptor extractor works with other detectors? If so, we can cancel this bug. But it is possible that we need to update either documentation or to print an informative error message, rather than crash with segfault.
I had compared FREAK against all feature detectors (by the "create" method) without segfaults. It barely detects something in most of my tests when trying to detect objects, but it does not crashes at all.
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4414