OpenCV Light Reflection Reduction

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

Original Image taken with 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 After thresholding How can I remove the backlight or connect a polyline from a detected path?

+7
java android opencv
source share
1 answer

The problem is that reflection oversaturated pixels. There are two possible ways:

Adjust condition

Setting up a condition is the easiest way. Just by controlling the conditions under which the image is executed, you can remove most (if not all) complex situations (such as these). Consider using polarized filters, improve (e.g. diffuse) lighting, improve exposure settings, etc.

Adjust image

Another option (for example, removing the backlight later) is much more complicated. This is mainly because oversaturation destroys a lot of data. The most common method for this is to use HDR images, which tend to store a lot more data, since images are taken at different exposures. In some cases, the problem may arise due to the conversion of RAW; but the improvement is usually quite tedious.

+1
source share

All Articles