D-Alex / ropencv

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

Mat constructors missing #24

Closed the911s closed 9 years ago

the911s commented 9 years ago

Several of the constructors for Mat are missing.

For example, an important prototype used for cropping images is Mat::Mat(const Mat& m, const Rect& roi), which yields the error:

[8] pry(main)> mat_crop = OpenCV::Cv::Mat.new(mat, rect)
ArgumentError: no constructor for OpenCV::Cv::Mat([#<OpenCV::Cv::Mat:0x007fd9a620edb0 @__obj_ptr__=#<OpenCV::Cv::MatStruct:0x007fd9a620e9a0>>, #<OpenCV::Cv::Rect:0x007fd9a613cdd8 @__obj_ptr__=#<OpenCV::Cv::RectStruct:0x007fd9a613ccc0>>])

Attempting to construct a Mat using the prototype Mat::Mat(const Mat& m, const Range& rowRange, const Range& colRange=Range::all() ) yields

[13] pry(main)> mat_crop = OpenCV::Cv::Mat.new(mat, row_range, col_range) 
ArgumentError: no constructor for OpenCV::Cv::Mat([#<OpenCV::Cv::Mat:0x007fd9a620edb0  @__obj_ptr__=#<OpenCV::Cv::MatStruct:0x007fd9a620e9a0>>, #<OpenCV::Cv::Range:0x007fd9a51eeae8 @__obj_ptr__=#<OpenCV::Cv::RangeStruct:0x007fd9a51ee098>>, #<OpenCV::Cv::Range:0x007fd9a4e2c298 @__obj_ptr__=#<OpenCV::Cv::RangeStruct:0x007fd9a4e276a8>>])
D-Alex commented 9 years ago

Added additional constructors and updated gem. Thx for reporting

the911s commented 9 years ago

Thank you!