Closed shaikhibrahim951 closed 6 years ago
Have you been able to train Yolov3 using 1-channel, to generate a working model ?
A simple way could be, to convert C1 to BGRA using something like, cvtColor(src,dst,CV_GRAY2RGB);, before feeding to the detect function.
To do it efficiently with 1 channel itself without conversion, can you provide a trained model, so I can verify the detection changes ?
I am training data using Yolov2a and image type is 1 channel.
The code is giving problem in following line.
Image is getting converted to floatMat
, then following process is happening.
` if (floatMat.channels() != 3) { EPRINTF("Detect: channels = %d \n", floatMat.channels()); return false; } // Get the image to suit darknet cv::Mat floatMatChannels[3]; cv::split(floatMat, floatMatChannels); vconcat(floatMatChannels[0], floatMatChannels[1], floatMat); vconcat(floatMat, floatMatChannels[2], floatMat);
__Detect((float*)floatMat.data, thresh, hier_thresh, objectCount);`
It is going to this if condition if (floatMat.channels() != 3)
Image is not passing to __detect
function.
Thanks
Did you try this suggestion - "A simple way could be, to convert C1 to BGRA using something like, cvtColor(src,dst,CV_GRAY2RGB);, before feeding to the detect function."
Could you also specify which camera you are using so I could try some sample data ?
cvtColor(src,dst,CV_GRAY2RGB);
worked for me and able to detect desired object in frame. I am using Melaxis ToF camera.
Very good and thanks for confirming. If permitted by your project, also please share some sample train images you are using.
Closing as the issue is resolved.
Hi I am giving my video from ToF(Time of flight camera) and video is of 8UC1v type. In
__detect
function it is taking 3 channel data in concatenated form, but I want to take only 1 channel data, can you help me regarding this.Thanks