QR code recognition is required in'Android'. Is there no workaround?

QR code recognition is required in’Android’. Is there no workaround?

Reference link: QR CODE library for Processing 3.0.2 Windows/Linux/MacOSX/Android.. writeQR() and readQR(). - Processing 2.x and 3.x Forum

When implemented in the above way,

photo
If you link with the actual smartphone cam, that photo should be recognized.
However, that photo is not recognized by the QR code.

qr1
Only those fixed images and only accurate images can be interpreted.

Is there any solution? Is there any way to receive and recognize ketai cam photo data?

this should give you camera data.

int w = 1400,h = 580;

PShader edges;
KetaiCamera cam;
float counter;
boolean mdown;

void settings(){
  size(w,h,P2D);
};

void setup() {
  orientation(LANDSCAPE);
  imageMode(CENTER);
  
  int n = 2;
  cam = new KetaiCamera(this, 1200*n, (280)*n, 60);
  frameRate(60);
}

void draw() {
  background(0);
  logic();
  if (frameCount>100&&!cam.isStarted()){cam.start();}
  image(cam, width/2, height/2);
  fill(0);
  text(frameRate,10,10);
  text(counter,100,10);
}

void onCameraPreviewEvent(){
  cam.read();
}

// start/stop camera preview by tapping the screen
void mousePressed(){
  if (cam.isStarted()){
    cam.stop();
  }else cam.start();
};


@GWAK ===
I dont know to do that with Ketai but you can use the android native wy to display the camera data into a surfaceView; after that you have only to use the android mobile vision API and its barcode detector to get the code as a string, which can be passed as an url: tested, it works fine.

1 Like

Via Ketai camera

  1. In recognizing the QR code on the screen of the camera
  2. Fixed image is recognized by QR code,
  3. Real-time video is not recognized.

@akenaton

Hello. Thank you for answer. We would appreciate if you could give us the source code url.
Thank you.

@GWAK === as for video within a surface view you can find on the forum many examples with code i have already given ; as for the barcode detector you can refer to the android API mobile vision importing some packages:

import com.google.android.gms.vision.CameraSource;
import com.google.android.gms.vision.Detector;
import com.google.android.gms.vision.barcode.Barcode;
import com.google.android.gms.vision.barcode.BarcodeDetector;

dont forget permissions for camera
1 Like

Dear akenaton, @akenaton

Thank you for your kind answer.
However, I can’t find your previous posts in the forums.
Please tell me the’url address’ that contains the content of the test.

I can’t find it in the’Forum’. help me.

@GWAK ===
see here: https://discourse.processing.org/t/play-videos-in-my-apps/23707

– of course buttons and sliders are not useful for your app; what is important is the surfaceView (and perhaps the way to load your video)

1 Like

@akenaton

I know what you mean.
However, if you’ve solved it, you share the code, please.
I need a code that recognizes’QR’, not video.

If you have any sample code, please share it.
Thank you.

@GWAK === the barcode dtector from android works with a video and from the video recognizes the barcode

1 Like