Reputation: 121
I am currently working on a road sign detection application on Android, using OpenCV, and found out that while processing frames in real-time, my camera often get focus on brighter parts of image, such as sky, and everything below (road, trees, and signs) is getting dark. Because of it my application is not able to detect these signs because they are too dark in this particular condition. Have anyone of you had to do with such problem and found decent solution? If so I would appreciate any clues to do this (especially with good performance which is important in real-time processing).
Upvotes: 0
Views: 2657
Reputation: 4453
You said that the camera gets focused on bright objects such as sky. In most modern phones you can set the area of the image which is included in auto focus calculation. Since the sky is always in the upper part of the image (after you take care of phone orientation) you can set the focus zone to the lowest half of the image. This will take care of the problem in the first place.
If however you meant that the camera is not focused on the bright objects but rather does white balancing using the white objects, you can solve this in the same way as described for focus. If that does not help, try histogram equalization and gamma correction techniques. This will help improve the contrast
Upvotes: 1
Reputation: 7919
As a preprocessing, you can apply intensity normalization. As a particular example histogram equalization can be applied: http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.html
with an example code in java: http://answers.opencv.org/question/7490/i-want-a-code-for-histogram-equalization/?answer=11014#post-id-11014
Note that such additional steps may slow down your overall detection operation.To increase overall speed, you can decrease your region-of-interest by sky detection.
Upvotes: 1