Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

please convert your gray image to np.uint8, not to np.float32.

(CascadeClassifier needs uchar data as input, while for a neural network, you'd use floats)

also, please check, if your cascades were loaded correctly, like:

if zero.empty(): raise BadData()

please convert your gray image to np.uint8, not to np.float32.

(CascadeClassifier needs uchar data as input, while for a neural network, you'd use floats)

also, please check, if your cascades were loaded correctly, like:

if zero.empty(): raise BadData()

Each digit within this image would be around 11x11 pixels. The cascade sizes are 20x30.

so, 20x30 is the minimum size , that can be detected. this means, you have to upscale your images by a factor of 3 or 4.

the signature for detectMultiScale is this:

detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects

so your usage is wrong, you have scaleFactor 2 times, and that must be > 1.0, too !

then, please convert your gray image to np.uint8, not to np.float32.

(CascadeClassifier needs uchar data as input, while for a neural network, you'd use floats)

also, please check, if your cascades were loaded correctly, like:

if zero.empty(): raise BadData()

Each digit within this image would be around 11x11 pixels. The cascade sizes are 20x30.

so, 20x30 is the minimum size , that can be detected. this means, you have to upscale your images by a factor of 3 or 4.

last, but not least - imho the attempt at using 10 cascades to detect numbers is kinda a rotten idea. how do you plan to deal with multiple, conflicting false predictions ? it will also take ages to process. good luck with that !