Skip to content Skip to sidebar Skip to footer

Convert Merged Rgb Image To Grayscale Opencv Android

I tried to split RGB image (http://www.kavim.com/uploads/signs/tn__51A2376.JPG) into seperate channels, threshold each channel and merge it back together resulting in something li

Solution 1:

The problem was that, I was trying to convert object set as inputFrame.rgba() to gray.

For this I had to create another mat set as inputFrame.gray() and then try to convert it.

Matrgb= inputFrame.rgba();
Matgray= inputFrame.gray();
MatgrayInnerWindow= gray.submat(top, top + height, left, left + width);
MatrgbaInnerWindow= rgba.submat(top, top + height, left, left + width);
//SOME CODE
Imgproc.cvtColor(rgbaInnerWindow,grayInnerWindow, Imgproc.COLOR_BGR2GRAY);

This now works as it should!

Post a Comment for "Convert Merged Rgb Image To Grayscale Opencv Android"