# Revision history [back]

### OpenCV Java How can I find red lined Rectangles from 12 rectangles.

I am running into a very unique problem statement. I have an image which will have 12 led lights and a few out of them will glow as red. After trying out multiple algorithms, I have reached till this stage (See Image Below ) from an RGB image taken from the camera.

I have reached to this image by applying this algorithms -

Mat detectedEdges = new Mat(ImageMat.rows(), ImageMat.cols(), CvType.CV_8UC1);
//Imgproc.blur(ImageMatNew, detectedEdges, new Size(3,3));
Imgproc.GaussianBlur(ImageMatNew, detectedEdges, new Size(3,3), 7);
Imgproc.Canny(detectedEdges, detectedEdges, 70, 70 * 3, 3, false);