D-Alex / ropencv

ffi ruby wrapper for opencv
Other
67 stars 14 forks source link

Creating a feature detector with parameters? #14

Closed robertjpayne closed 10 years ago

robertjpayne commented 10 years ago

I'm trying to figure out how to create GoodFeaturesToTrackDetector but be able to specify the parameters it takes.

Going off the C++ documentation:

GoodFeaturesToTrackDetector( const GoodFeaturesToTrackDetector::Params& params=
                                            GoodFeaturesToTrackDetector::Params() );
    GoodFeaturesToTrackDetector( int maxCorners, double qualityLevel,
                                 double minDistance, int blockSize=3,
                                 bool useHarrisDetector=false, double k=0.04 );

It would seem we can do this but I cannot figure out how rbopencv is binding this properly.

I've tried:

cv::GoodFeaturesToTrackDetector.new
cv::FeatureDetector::GoodFeaturesToTrackDetector.new

But no luck.

Thanks!

D-Alex commented 10 years ago

Apparently OpenCV declares GoodFeatureToTrackDetector as GFTTDetector and uses a typedef to define GoodFeatureToTrackDetector which is not reflected by ropencv.

Therefore the syntax is: cv::GFTTDetector.new

I am going to add an alias and close the ticket when it is pushed.

robertjpayne commented 10 years ago

Thanks! Appreciate the quick response, if I have more bindings questions/oddness should I post them up here or elsewhere?

Actually I found the Yard Docs which are incredibly helpful for mapping OpenCV documentation to the ruby api! Thanks a ton for this library!

D-Alex commented 10 years ago

To not hijack this ticket maybe you could open a new one with an appropriate name. In general everyone is more than welcome to post any improvements or suggestions.

D-Alex commented 10 years ago

gem was released