Hi Sindhurakshak,
I have tried to look around for more info. I think it may be due to the light condition, which you provide from the external illumination, may not be correct. Heve you tried your code to do the following (for let's say night under external illumination)?:
- Acquire the image
- Measure histogram
- Image to dark? If yes go to the next step if not move to step 5
- Increase exposure time of the camera and go back to step 1
- Do image processing
Another option would be to increase the exposure time and use a polorized light. From what I know this will reduce the reflections and increase the contrast.
Hope it helps
Warmest regards,
Lennard.C