mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
add haarclassifier's legacy interface
This commit is contained in:
parent
e145a847b2
commit
22ceeb045c
3 changed files with 85 additions and 0 deletions
15
lib/opencv/cvhaarclassifiercascade.rb
Normal file
15
lib/opencv/cvhaarclassifiercascade.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Cv
|
||||
CV_HAAR_DO_CANNY_PRUNING = 1
|
||||
|
||||
class CvHaarClassifierCascade < CascadeClassifier
|
||||
def self.load(filename)
|
||||
new(filename)
|
||||
end
|
||||
|
||||
def detect_objects(image, options = {})
|
||||
rects = detect_multi_scale(image, options)
|
||||
rects.each { |rect| yield rect } if block_given?
|
||||
rects
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue