I am currently working on a system for traffic sign recognition. This is based on colour segmentation using hsv colour space.
I have ported the existing algorithm to Android. However, I realized that the colour recognition does not work realiably.
After various tests I was able to detect the problem (!?). Android uses an automatic white balance, auto gain etc.
Is it possible to prevent Android from using the automatic white balance? I have tested functions such as setAutoWhiteBalanceLock()
which, however, did not provide useful results (black screen). The colours are filtered and segmented quite properly via webcam.
I used the the tutorial from opencv4android called "tutorial-4-mixed".
Any suggestions?
Thank you very much in advance.
It is a nice question that i am also interested in the answer.
When you say "via webcam" you mean opencv running on a desktop right?
WHITE_BALANCE_AUTO
WHITE_BALANCE_INCANDESCENT
WHITE_BALANCE_FLUORESCENT
WHITE_BALANCE_WARM_FLUORESCENT
WHITE_BALANCE_DAYLIGHT
WHITE_BALANCE_CLOUDY_DAYLIGHT
WHITE_BALANCE_TWILIGHT
WHITE_BALANCE_SHADE
I can't see one to just turn off but if you set, for example WHITE_BALANCE_DAYLIGHT, at least the colours would be constant and not changing dynamically.
And don't forget to check first if it is supported by your phone with:
isAutoWhiteBalanceLockSupported()
value | exposure compensation index. The valid value range is
from getMinExposureCompensation() (inclusive) to getMaxExposureCompensation() (inclusive). 0 means exposure is
not adjusted. Application should call
getMinExposureCompensation and getMaxExposureCompensation to
know if exposure compensation is supported.
|
---|
Other setWhiteBalance() options dont work.
I'm going to test the setExposureCompensation ...
But I'm now quite sure that this has sth. to do with those "auto things"!