Closed krishnakumarrs closed 5 years ago
I'm not sure which findhomography.m
sample you're referring to?
shows error on this line 'NormType',detector.defaultNorm()); line number 89
Did you make any changes to the sample by any chance?
cv.FeatureDetector
class is not explicitly used in that demo.
Anyway note how the detector
object was created from one of the classes cv.SURF
, cv.SIFT
, cv.ORB
, cv.AKAZE
, etc, which are both feature detectors and descriptor extractors at the same time.
In other words:
obj = cv.SURF();
[kpts,descs] = obj.detectAndCompute(img);
is equivalent to:
detector = cv.FeatureDetector('SURF');
extractor = cv.DescriptorExtractor('SURF');
kpts = detector.detect(img);
descs = extractor.compute(img, kpts);
This also applies to defaultNorm
as well, which is really a method of descriptor extractors, not feature detectors (it tells you what distance function is appropriate for doing matching on the computed descriptors).
I should point out that SIFT and SURF are part of the contrib modules, so they are only available if you built mexopencv with opencv_contrib support.
I have used opencv_contrib but when i looked into the detector class there is no name defaultNorm. And also even if i use cv.imread or cv.SIFT it gives me error. Is there anything i need to do. thanks for reply.
As I explained in my previous comment, defaultNorm
is a method of DescriptorExtractor
not FeatureDetector
. If you want to modify the sample as you did, you need to create two objects one for each of those classes (detector and extractor).
If you revert your changes, the demo should work as is: http://amroamroamro.github.io/mexopencv/opencv/feature_homography_demo.html
Thanks
i tried to run findhomography.m file from sample i get this error message No appropriate method, property, or field 'defaultNorm' for class 'cv.FeatureDetector'.
please help.
thanks