haar cascade classifiers :: private method `load' called for OpenCV::Cv::CascadeClassifier:Class (NoMethodError)
agenteo opened this issue · comments
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 method
load' called for OpenCV::Cv::CascadeClassifier:Class (NoMethodError)
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