Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reflection reduction in image

Tags:

Lighting problems are common and difficult. How does one detect and reduce light reflection to save more information from an image? I have tried several methods with OpenCV and Python without luck.

(Image with reflection)

image with light reflection

(Image without reflection)

image without light reflection

I tried converting to HSV color space, and apply Histogram Equalization to the V channel, with Clahe equalization:

import cv2 import numpy as np  image = cv2.imread('glare.png')  hsv_image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV) h, s, v = cv2.split(hsv_image)  clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8)) v = clahe.apply(v)  hsv_image = cv2.merge([h, s, v]) hsv_image = cv2.cvtColor(hsv_image, cv2.COLOR_HSV2RGB)  cv2.imwrite('clahe_h.png', hsv_image) 

results:

image after clahe equalization

As well I tried thresholding to find bright pixels and than use Image Inpainting to replace them with neighbouring pixels.

import cv2 import numpy as np  image = cv2.imread('glare.png')  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray, (3,3), 0) thresh = cv2.threshold(blurred, 225, 255, cv2.THRESH_BINARY)[1]  dst_TELEA = cv2.inpaint(image,thresh,3,cv2.INPAINT_TELEA) cv2.imwrite('after_INPAINT.png',dst_TELEA) 

results: (after threshold) after threshold

after inpainting

like image 884
Streem Avatar asked Jun 15 '17 13:06

Streem


People also ask

How do I remove a reflection from a photo?

Use a polarizing filter. A circular polarizing filter helps reduce or remove glare. Just attach it to the lens and turn it until you see the glare disappear. Keep in mind that you will need to adjust the camera settings to let in more light.

What is reflection in image processing?

Brief Description. The reflection operator geometrically transforms an image such that image elements, i.e. pixel values, located at position in an original image are reflected about a user-specified image axis or image point into a new position. in a corresponding output image.

What are the two techniques used to reduce reflection in a network?

Several techniques like Ghosting Cues, Perceptual Reflection Removal, and ERRNet has been proven effective for removing reflection.


1 Answers

There's no general method for effective glare removal.

HSV + CLAHE is a good and common start, but industry methods "cheat" by assuming some information about the subject (human face, fruit on a conveyor belt, retina through an ophthalmoscope), and sometimes information about the lighting (white ceiling light with very sharp edges, for the images in this question).

like image 96
Camille Goudeseune Avatar answered Sep 19 '22 08:09

Camille Goudeseune