AMB82 MINI Read QR Code and Datamatrix while record a video

Hi everyone,
I have to make an application for recording a video at 720p 30fps and at the same time scan a possible QR Code or Datamatrix that is positioned in front of the camera, is it possible to do this with AMB82? If a QR Code or Datamatrix code is detected I must also send it via serial to another microcontroller. I saw that there is already an example for recording the video, do you also have an example for the QR Code and the Datamatrix?

There are 2 methods that can be able to achieve your request currently.
1, training your QR model models and use AI method to do it. It is kind of like an object detection.
2, try to record the snap short and apply some image processing.

Do you have an example or a guide for the two solution?

Thanks

I need to buy over 5000 pcs every year if i can find the qr code while recording video

Hi @Ivan,

For now, we do not have any examples that are related to QR code scanning.

However, could you provide the following information for us to discuss internally to see if it is feasible to add it to our SDK?

  1. Please briefly explain the application or project that you are implementing with a QR code scanner.
  2. Please provide a clear and concise description of the outcome you are expecting.

Thank you!

We make a smart personal locker that is in outdoor envoirment.

We need a camera to record a video of the courier that delivery the parcel and at the same time we need to detect the tracking number in front of the parcel through it Datamatrix or QR Code label.

Here you can see a video

https://www.youtube.com/watch?v=Wk1owpJ1dBc

https://www.youtube.com/watch?v=KC5zKBIDnZw

The video quality need to be 720p and 30fps or more, we tried your example of AMB81-MINI and it was very good.

Now we need to integrate the part of QR Code and Datamatrix detection and we need support to do this, then we can use your processors in our application to mass production.

Thanks

Thank you for your reply. I will inform you the outcome after our discussion.

Hi, do you have any news for reading qr code?

Thanks

Hi, yes after discussion, we have plans to add QR code scanner function into our Open source SDK. However, it may take some times to add it in. Thank you.

Thank you, do you have the estimated time? One month or more?

Hi @Ivan ,

May I know how rush is your deadline for this feature?

Thank you.

We need to make the first prototype with this feature for the 15 of april. Can you implement it before this date?
Thanks

Hi @Ivan,

We will try our best, will update in 1-2 weeks time on our progress.

Thanks!

Hi @Ivan,

This feature will be ready by this week.

Thank you.

Thank you very much

Hi @Ivan,

You may git clone GitHub - Kyderio/ambpro2_arduino: AmebaPro2 Arduino third-party package SDK. Copy the folder QRCodeScanner in this link ambpro2_arduino/Arduino_package/hardware/libraries at dev · Kyderio/ambpro2_arduino · GitHub to your Arduino15/hardware/libraries.

In case there is no early release version yet by this week.

Thank you.

Hi, can you make an example of scanning QR Code and Recording a mp4 video at the same time please? I can’t reach this result. Thanks

Hi @Ivan,

What issues are you facing with? What progress do you have with this integration work?

Thank you.

I tried this code

#undef DEFAULT

#include "StreamIO.h"
#include "VideoStream.h"
#include "QRCodeScanner.h"
#include "MP4Recording.h"

#define CHANNEL 0

// Default preset configurations for each video channel:
// Channel 0 : 1920 x 1080 30FPS H264
// Channel 1 : 1280 x 720  30FPS H264

VideoSetting config(CHANNEL);
QRCodeScanner Scanner;
MP4Recording mp4;
StreamIO videoStreamer(1, 1);  // 1 Input Video -> 1 Output RTSP

void setup()
{
	// Initialize serial communication
	Serial.begin(115200);
	// Configure camera video channel with video format information
	Camera.configVideoChannel(CHANNEL, config);
	Camera.videoInit();

	mp4.configVideo(config);
	mp4.setRecordingDuration(30);
	mp4.setRecordingFileCount(1);
	mp4.setRecordingFileName("TestRecordingVideoOnly");
	mp4.setRecordingDataType(STORAGE_VIDEO);    // Set MP4 to record video only

	// Configure StreamIO object to stream data from video channel to MP4 recording
	videoStreamer.registerInput(Camera.getStream(CHANNEL));
	videoStreamer.registerOutput(mp4);
	if (videoStreamer.begin() != 0)
	{
		Serial.println("StreamIO link start failed");
	}

	// Start data stream from video channel
	Camera.channelBegin(CHANNEL);
	// Start recording MP4 data to SD card
	Serial.println("Mp4 begin");
	mp4.begin();

	Serial.println("Start scanning");
	Scanner.StartScanning();
}

void loop()
{
	Serial.println("Loop");
	// User can use the result string and length from here.
	// You can modify the delay to the rate of retrieving the result string and result length.
	// Currently, third successful scan will allow you to get the result string and length reliably.
	// Note that this loop may not be optimised, you are to do your own conditional checks to get your application working.
	// This is to illustrate how to retrieve the qr code scanning results.

	delay(1000);
	Scanner.GetResultString();
	Scanner.GetResultLength();
	if (Scanner.ResultString != nullptr)
	{
		Serial.print("Result String is:");
		Serial.println(Scanner.ResultString);
	}
	if (Scanner.ResultLength != 0)
	{
		Serial.print("Result Length is:");
		Serial.println(Scanner.ResultLength);
	}
}

void printInfo(void)
{
	Serial.println("------------------------------");
	Serial.println("- Summary of Streaming -");
	Serial.println("------------------------------");
	Camera.printInfo();
	Serial.println("- MP4 Recording Information -");
	mp4.printInfo();
}

but i get this result and the QR Code can’t be read and also the video can’t be play because result 0 KB.

hal_voe_send2voe too long 168361 cmd 0x00000206 p1 0x00000000 p2 0x00000000

Mp4 begin
Start MP4 recording (1 files)

Start scanning
Loop
STORAGE_INIT

open file (0:/TestRecordingVideoOnly.mp4) len = 30 seconds

STORAGE_INIT -> STORAGE_START

hal_voe_ready 0x0 0x1718 

inputRateNumer[5] < outputRateNumer[30], Set inputRateNumer --> outputRateNumer 

[VOE]ext_iring  syn
Loo0
[VOE]isp_device_probe had done
[VOE]isp_soc_start already done
[VOE]VOE MEM Size = 21479 Used= 20700 KB Free=  778 KB (797312)

[VOE]stream 0  buffer 0: 0x715e7800 size 460800 

[VOE] isp_locate_buffer malloc buffer failed 

[VOE]isp_locate_buffer ch0 failed -1 

[VOE]Ortsoam_video206 failuffer]x798]Er_rtscam_video_aud fabu
fer _vieese bun fail't match iop puff pool 0x715e7800 


[VOE][rts_rtsv_put_buffer][627]Errv4l2 ioctl QBUF 70b36b64 fail, -47


[VOE][release_frame_buffer][1178]Errrelease_frame_buffer failed ret -47 


Result String is:
Loop
Result String is:
Loop
Result String is:
Loop
[VOE][isp_frdn_irq_bh][606]Errisp_frdn_irq_bh xSemaphoreTake fail



Result String is:
Loop
Result String is:
Loop
Result String is:
Loop
[VOE][isp_frdn_irq_bh][538]Errisp_frdn_irq_bh wait stream->lock timeout



Result String is:
Loop
Result String is:
Loop
Result String is:
Loop
[VOE][isp_frdn_irq_bh][538]Errisp_frdn_irq_bh wait stream->lock timeout



Result String is:

Hi @Ivan,

I thought in your block diagram, you are wanting to scan for QR code, retrieve the string and then send it to another AMB82-Mini, which will then do the recording?

Just to double confirm if you are to scan for QR code and do the recording at the same time when a particular QR code result string is retrieved?

Thank you.