error while visualizing the cascade stage features

asked 2018-03-03 11:37:57 -0600

Jad gravatar image

I have trained a boosted cascade classifier with opencv and i want to visualize the cascade stages features as shown in the tutorial here:

The problem is that everytime i run the batch: opencv_visualisation --model=sunmodel.xml --image=sunn.bmp

where sunn.bmp is actually a positive sample from the training set, and i have also resized it to 24*24 as the defined dimension in the training process.

I get the following error: the model is not an haar or lbp feature based model! please select a model that can be visualised by the software

Although i am using Haar features in the training, I am also using the cascade parameter mode to be: -mode ALL

Any idea what is happening?

Many thanks in advance

edit retag flag offensive close merge delete


-mode ALL is the exact problem. For my project we did not consider rotated features and thus the drawer does not support this at all. Hence its error message should be more clear =/

StevenPuttemans gravatar imageStevenPuttemans ( 2018-03-07 09:14:15 -0600 )edit

Thank you Steve for getting back to me :)I have actually tried using -mode HAAR too and its still giving the same error!!

Jad gravatar imageJad ( 2018-03-07 09:23:27 -0600 )edit

Can you leave the mode for training unspecified and just use -featureType HAAR. In that case it should work...

StevenPuttemans gravatar imageStevenPuttemans ( 2018-03-07 09:35:16 -0600 )edit

Sure I will do that now :) thank you so much! one more thing, Do you think i can calculate the number of rejected windows in detectMultiScale()? as am trying to compute the value of the True negative and i need to know how many windows were rejected in the search proccess! I have also raised a question on:

Jad gravatar imageJad ( 2018-03-07 09:40:53 -0600 )edit

unfortuntly it didn't work as well even when i left the mode unspecified and used -featureType HAAR. here is what my batch looks like:

haartraining.exe -data cascades -vec vector/arvector.vec -bg negative/bg.txt -npos 350 -nneg 350 -nstages 15 -mem 1024 -featureType HAAR -w 24 -h 24

Jad gravatar imageJad ( 2018-03-07 11:18:00 -0600 )edit