Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detectMultiScale MAT conversions #186

Open
kernelgurumeditation opened this issue Jun 17, 2017 · 1 comment
Open

detectMultiScale MAT conversions #186

kernelgurumeditation opened this issue Jun 17, 2017 · 1 comment

Comments

@kernelgurumeditation
Copy link

kernelgurumeditation commented Jun 17, 2017

Hi,

I'm trying to add eye detection to a simple face detection demo, but I not able take a section from a MAT object.

local faces = face_cascade:detectMultiScale{image=im2, scaleFactor=1.2,minNeighbors=2, flags=2 , minSize={150,150}, maxSize={200,200}}

for i=1,faces.size do
local f = faces.data[i]
local x = f.x/fx
local y = f.y/fx
local w = f.width/fx
local h = f.height/fx

local facegray= im2[f] --- >How to do this in lua????
.....

local eyes = eye_cascade:detectMultiScale{image=facegray, scaleFactor=1.2,minNeighbors=2,flags=2 , minSize={50,50}, maxSize={0,0}}

Any help will be very appreciated

@shrubb
Copy link
Contributor

shrubb commented Jun 18, 2017

See my answer in szagoruyko/torch-opencv-demos#23.

I would do:

cv.getRectSubPix{im2, {w-2, h-2}, {x + w/2, y + h/2}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants