I have a problem with the reflection of light, here is an image made using a standard camera

and the process that I do
1. blur the image Imgproc.GaussianBlur(blurred, blurred, new Size(17, 17), Imgproc.BORDER_ISOLATED); 2. create second empty image that using hsv Imgproc.cvtColor(gray0, gray0, Imgproc.COLOR_BGR2HSV); 3. mix the image color chanel (fromto {0,0}) Core.mixChannels(blurredlist, graylist, fromto); 4. Threshold, Canny, and delate Imgproc.threshold(gray0, gray0, 126, 255, Imgproc.THRESH_TRUNC); Imgproc.Canny(gray0, gray0, 50, 70); Imgproc.dilate(gray0, gray0, Mat.ones(new Size(3, 3), 0)); 5. finding the contour Imgproc.findContours(gray0, contours, new Mat(), Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); 6. magicall filter for biggest contour and stuff
and here is the result
How can I remove the backlight or connect a polyline from a detected path?
java android opencv
Afriyandi setiawan
source share