D-Alex / ropencv

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

haar cascade classifiers :: private method `load' called for OpenCV::Cv::CascadeClassifier:Class (NoMethodError) #11

Closed agenteo closed 10 years ago

agenteo commented 10 years ago

Hi,

congrats on the project, I am using ruby-opencv but wanted to give this gem a go.

I am loosing following this tutorial: http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier

require 'ropencv' include OpenCV face_cascade_name = "haarcascade_frontalface_alt_tree.xml" face_cascade = cv::CascadeClassifier face_cascade.load(face_cascade_name)

and I am getting: run.rb:5:in <main>': private methodload' called for OpenCV::Cv::CascadeClassifier:Class (NoMethodError)

D-Alex commented 10 years ago

Hi,

load is an instance method therefore you have to create an instance of the CascadeClassifier first before loading the configuration (face_cascade = cv::CascadeClassifier.new) The load you are seeing belongs to the ruby base class Object and is private.

You can also have a look at the following address for getting more informations about available methods. http://www.ropencv.aduda.eu/doc/OpenCV/Cv/CascadeClassifier.html