Detect specific object with haar cascade clasifier

asked 2018-05-15 12:59:42 -0500

Hi All,

I want to detect some specific objects like brush or watch , so i created cascade clasifier by using train cascase classifier. the width and height i gave was 20 and 20 by following this post . Image used was C:\fakepath\watch5050.jpg

I wrote java program to detect this image where i read the image and convert to gray background and use detectMultiscale mthod below is the arguments passed

Imgproc.cvtColor(image, grayFrame, Imgproc.COLOR_BGR2GRAY);
//faceDetector.detectMultiScale(grayFrame, faceVectors); faceDetector.detectMultiScale(grayFrame, faceVectors, 1.1, 2, 0 | Objdetect.CASCADE_DO_ROUGH_SEARCH, new Size(20,20), new Size(50,50));

but when i run code and use worng image where there should not be any image detected i see 5 images detected C:\fakepath\detectoin.png

I am following wrong approach or have not trained cascade clasifier rightly ?

edit retag flag offensive close merge delete

Comments

do not read blogposts, but docs

also don't try to train this with a single image.

berak gravatar imageberak ( 2018-05-16 00:04:09 -0500 )edit

how do i know if the cascade classifier is done properly.

OpencvStudent gravatar imageOpencvStudent ( 2018-05-17 10:36:31 -0500 )edit