I’m displaying the camera on the screen but the screen appears white.
Code
Code:
import ketai.camera.*;
import ketai.cv.facedetector.*;
import ketai.data.*;
import ketai.net.*;
import ketai.net.bluetooth.*;
import ketai.net.nfc.*;
import ketai.net.nfc.record.*;
import ketai.net.wifidirect.*;
import ketai.sensors.*;
import ketai.ui.*;
private KetaiCamera cam;
private KetaiSensor snsr;
float rx, ry;
PGraphics FP;
void setup() {
fullScreen();
orientation(PORTRAIT);
FP = createGraphics(1080,1920);
FP.beginDraw();
FP.background(0);
FP.endDraw();
cam = new KetaiCamera(this, 1080, 1920, 60);
snsr = new KetaiSensor(this);
cam.start();
cam.setCameraID(0);
snsr.start();
}
void draw() {
//FP.beginDraw();
//image(FP, 0, 0, 1080, 1920);
//if (cam.isStarted()) {
// FP.image(cam, rx, ry, 108, 192);
//}
//FP.endDraw();
image(cam,0,0);
}
void onOrientationEvent(float x, float y, float z) {
rx = x;
ry = y;
}
void onCameraPreviewEvent() {
cam.read();
}
MCVE
import ketai.camera.*;
private KetaiCamera cam;
void setup() {
cam = new KetaiCamera(this, 1080, 1920, 60);
cam.start();
}
void draw() {
image(cam,0,0);
}
void onCameraPreviewEvent() {
cam.read();
}
Error:
Failed to open camera for camera ID: 0:Fail to connect to camera service