Ketai camera not working
in
Android Processing
•
1 month ago
Hi everyone!
I'm having a really hard time with the ketai camera library. I can't see any image.
I get to run the CameraGettingStarted example without any problem. The log doesn't show any errors and I can switch the flash of my phone on and off by touching the "menu" button (as intended).
The Processing console doesn't show any errors and it even shows this:
- default imageformat:17
- supported flashmode: on
- supported flashmode: torch
- supported flashmode: off
- supported flashmode: auto
- Requested camera parameters as (w,h,fps):640,480,24
- Checking supported preview size:176,144
- Checking supported preview size:240,160
- Checking supported preview size:352,288
- Checking supported preview size:320,240
- Checking supported preview size:480,320
- Checking supported preview size:640,480
- Found matching camera size
- Checking supported preview size:800,480
- Checking supported preview size:720,544
- Checking supported preview size:960,544
- Checking supported preview size:960,720
- Checking supported preview size:1280,720
- Checking supported preview size:1920,1088
- Supported preview FPS: 2
- Supported preview FPS: 3
- Supported preview FPS: 4
- Supported preview FPS: 5
- Supported preview FPS: 6
- Supported preview FPS: 7
- Supported preview FPS: 8
- Supported preview FPS: 9
- Supported preview FPS: 10
- Supported preview FPS: 11
- Supported preview FPS: 12
- Supported preview FPS: 13
- Supported preview FPS: 14
- Supported preview FPS: 15
- Supported preview FPS: 16
- Supported preview FPS: 17
- Supported preview FPS: 18
- Supported preview FPS: 19
- Supported preview FPS: 20
- Supported preview FPS: 21
- Supported preview FPS: 22
- Supported preview FPS: 23
- Supported preview FPS: 24
- Supported preview FPS: 25
- Supported preview FPS: 26
- Supported preview FPS: 27
- Supported preview FPS: 28
- Supported preview FPS: 29
- Supported preview FPS: 30
- calculated preview FPS: 2
- Calculated camera parameters as (w,h,fps):640,480,24
- Using preview format: 17
- Preview size: 640x480,24
Here's the code:
- /**
- * <p>Ketai Sensor Library for Android: http://KetaiProject.org</p>
- *
- * <p>Ketai Camera Features:
- * <ul>
- * <li>Interface for built-in camera</li>
- * <li></li>
- * </ul>
- * <p>Updated: 2012-03-10 Daniel Sauter/j.duran</p>
- */
- import ketai.camera.*;
- KetaiCamera cam;
- void setup() {
- orientation(LANDSCAPE);
- imageMode(CENTER);
- cam = new KetaiCamera(this, 320, 240, 24);
- }
- void draw() {
- image(cam, width/2, height/2);
- }
- void onPause()
- {
- super.onPause();
- //Make sure to releae the camera when we go
- // to sleep otherwise it stays locked
- if (cam != null && cam.isStarted())
- cam.stop();
- }
- void onCameraPreviewEvent()
- {
- cam.read();
- }
- void exit() {
- cam.stop();
- }
- // start/stop camera preview by tapping the screen
- void mousePressed()
- {
- if (cam.isStarted())
- {
- cam.stop();
- }
- else
- cam.start();
- }
- void keyPressed() {
- if (key == CODED) {
- if (keyCode == MENU) {
- if (cam.isFlashEnabled())
- cam.disableFlash();
- else
- cam.enableFlash();
- }
- }
- }
I'm on OSX and using a Huawei Ascend P6 running android 4.2.2 as testing device.
Please guys! Help!
1