-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust Brightness, Contrast & White Balance #95
Comments
@bayudwirp For example, using the included usbCameraTest3 app from which my app is derived, I made the following calls from within my CameraThread:
Just remember that by default, white balance is set to auto, so you will have to disable auto mode before trying to set the value. Example:
Hope this helps! |
Hi @williamdwarke !
To describe my problem, I attach the following script i edited from an example project "USBCameraTest"
And this script below for Changed value from seekbar
So, did you see any mistakes that I made? |
I apologize for the delay; the holiday season has kept me very busy. For starters, why do you have 2 UVCCamera objects? Second, try including an updateCameraParams() before you try and read the value of getAutoWhiteBlance(). In my experience, none of the changes to camera settings actually get written until you call that function. That may actually solve your problem. One more thing - try moving your camera white balance update code from onProgressChanged to onStopTrackingTouch, and just update a variable in onProgressChanged. The reason for this is that it's not a good idea to write camera parameters multiple times per second (onProgressChanged will constantly fire as the seekbar changes). Instead, I implemented something like this:
However, there is a distinct difference which is that I am using a CameraThread (see usbCameraTest3), so my onStopTrackingTouch code triggers a message to the thread that sends the new white balance value to the camera. If you still can't get it to work you may consider switching over to a CameraThread as well, especially if you are you a multi-core device. |
Hi @williamdwarke ! No problem for me. I'm sorry if I always disturb you lately. Firstly, that's totaly my mistake to create double UVCCamera Object, and i try to using just one UVCCamera object. And still have same problem.
From this code, i always to write updateCameraParams before i read status and disable a auto mode. And, if i try to check again, whether the status has changed with command mUVCCamera.getAutoWhiteBlance() and it will always give a true status, which means a command to change value before didn't work because it does not change the status from true to false. And, when i try to set (For Example) Brightness value and I try to look at the processes that occur using debug, i see this part from UVCCamera.java file:
I see that the variable mBrightnessMax and mBrightnessMin always given 0, which causes regardless of the value that my input, will always lead to the results of the calculation is always 0. I think, because of it, cause when I try to set the value to set the Brightness, always 0 and can not be changed. I'm sorry if i had many of question to you. |
@bayudwirp Any progress on this issue ? I am facing a very similar problem |
Hi @rdbhanz . |
@bayudwirp yeah same problem, I am trying to figure out how it is working in usbCameraTest8 app. Getting a null pointer exception on the camera object that I am trying to mimic from usbCameraTest8, some issue on the thread handling probably. Will post here if there is any progress |
@rdbhanz I updated the files in my project from the new version of the library (libuvccamera, usbCameraCommon) and modified the code from the example 8. I gave a sample code. Here is an example of the code that I got.
And edit AbstractUVCCameraHandler.java
|
@iSIlya thanks for the reply, Brightness was not an issue for me, I was having trouble with white balance, which I figured out and is working. Still not able to get results for Exposure and Gain |
@rdbhanz I also do not know how to work with the exposition. If you find a solution, please inform. |
Hello, @saki4510t
Firstly, thankyou for your shared library, it means a lot for me, to help me build an usb camera apps.
I have a question. How can i adjust contrast, brightness and white balance setting? Could you share your example project, to adjust contrast, brightness and white balance?
Thanks before, for your answers.
Regards, Bayu.
The text was updated successfully, but these errors were encountered: