# Revision history [back]

the 1st convolution layer in your network complains, that the number of channnels did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


the 1st convolution layer in your network complains, that the number of channnels channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


### edit:

(see 1st comment !)

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there.

the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


### edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook someting:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there.there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;


the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


### edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook someting:something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;


the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


### edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxPos.x;
mm.maxLoc.x;


the 1st convolution layer in your network complains, that the number of channels in your input did not fit. ;)

we don't know, what kind of model you're using, but most likely it expects BGR or RGB input, not grayscale, so try a

Imgproc.cvtColor(frame, frame, Imgproc.COLOR_RGBA2BGR);


### edit:

(see 1st comment !)

you probably took the code from the android sample here, but mistook something:

leNet is a classification model, NOT a detection one. you simply cannot infer bounding boxes from it.

all you can do is apply minMaxLoc() on the softmax output, and infer the classID from there:

Mat detections = net.forward("Softmax").reshape(1,1);
MinMaxLocResult mm = Core.minMaxLoc(detections);
int classID = mm.maxLoc.x;
double probability = mm.maxVal;