View Single Post
  #1   Spotlight this post!  
Unread 05-16-2016, 08:24 PM
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 189
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Setting exposure values on android with OpenCV

Hello, I finished watching 254's presentation recently and have begun working on a similar android app where it would find the target and send the data back to the roborio. I have opencv running on my phone and can run opencv functions fine.

What i am having trouble with is setting the exposure / iso values from within the code. I am trying to use CaptureRequest.set() and the app instantly crashes saying:

Code:
AndroidRuntime: FATAL EXCEPTION: Thread-3171

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.camera2.CaptureRequest$Builder.set(android.hardware.camera2.CaptureRequest$Key, java.lang.Object)' on a null object reference
My code is here: http://pastebin.com/3XgvKGQN

Any help is appreciated,
Drew (Team 2053)
Reply With Quote