From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

QR code detection in FPGA

Solved!
Go to solution

Hello

 

We are doing a school project atm where we use a usb-webcam and a MyRio to detect some QR codes and make a drone fly.

 

We would like to know instantly (or as fast as possible) when a QR code is detected, and what it says, so we are looking into the posibility of putting the QR code detection on the FPGA.

 

I am still new to FPGA programming, so I am wondering if anybody have some examples/sample code I could look at.

We have allready made a QR code detection program, but the VI's we use are not to find on the FPGA vi.

 

Any help is much apreciated.

 

Best regrads

 

Marcus

0 Kudos
Message 1 of 11
(3,779 Views)

Is it too slow to detect the QR codes if you run the program on its real-time OS? The program would be more flexible then. You said you would like to process it "as soon as possible", but I am curious how much mSec is acceptable in your application? I am sorry I do not give you any answers, but I am interested in your project 🙂

0 Kudos
Message 2 of 11
(3,697 Views)

The image isn't going through the FPGA so it may not make sense to process it that way. Now it may be interesting from a learning standpoint.

 

I did a search for qr code fpga and it seemed light but image processing is done on FPGAs and qr is probably not difficult since it's a very structured data format. 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 3 of 11
(3,692 Views)

Hello MRicefield.

 

We have done some initial testin, but it seems that that it may take up to several seconds before it recognizes the code.

 

Se we hoped to speed it up with some FPGA programming. Also to free up some space on the MyRio, so it can focus on controlling the drone.

 

We dont have a set time for how long it may take before the drone should recognize the codes, but the faster the better. I dont think it can be to fast 🙂 

 

Thank you for your reply!

 

0 Kudos
Message 4 of 11
(3,686 Views)
Solution
Accepted by topic author MarcusNilsen

Image processing on an FPGA needs to be a linear process.  You can't manipulate 2D data very well on an FPGA.  Most 2D barcodes require the entire barcode to be decoded as a unit.

 

You might have luck locating the barcode, but I wouldn't expect it to be worth the effort.  Spending a few msec on each barcode after it is acquired will work better on the RT operating system.  I suspect it would be faster as well.  FPGAs don't process data as fast as a standard CPU, so you would probably spend a lot of time implementing an FPGA algorithm only to find out the RT CPU can provide the results faster.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 11
(3,685 Views)

Hello Terry_ALE

 

Yeah, I could read online that if we wanted to do it on the FPGA, we would need to send it from the RT to the FPGA. We still hoped that this would speed things up a bit, but we will have to test it first.

 

I couldnt find much info on it online, and the image manipulation VI's in the FPGA seemed to be a bit to basic for us to be able to get some benefit from it. 

 

I will try to google some more, and test over the weekend. Thank you for answer.

0 Kudos
Message 6 of 11
(3,684 Views)

Hello BruceAmmons.

 

Thanks for the reply.

 

What you are saying is kinda what i was thinking. I think we will drop the idea about using the FPGA then, and just using the RT. At least it will save us some late nights. 

0 Kudos
Message 7 of 11
(3,681 Views)

@BruceAmmons wrote:

FPGAs don't process data as fast as a standard CPU


What is your context for this statement?


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 8 of 11
(3,626 Views)

@MarcusNilsen wrote:

Hello Terry_ALE

 

Yeah, I could read online that if we wanted to do it on the FPGA, we would need to send it from the RT to the FPGA. We still hoped that this would speed things up a bit, but we will have to test it first.

 

I couldnt find much info on it online, and the image manipulation VI's in the FPGA seemed to be a bit to basic for us to be able to get some benefit from it. 

 

I will try to google some more, and test over the weekend. Thank you for answer.


The benefits of the FPGA diminish when the data size is smaller (I assume you have one QR code at time and it is not many at a high rate) and you have to move it around quite a bit.  If the QR reader (camera) went right into the FPGA there could be benefits.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 9 of 11
(3,624 Views)

Based on my experience, it takes longer to process an image using an FPGA, especially if you need to feed in the image pixel by pixel, then process the data, then feed out the results.  No benchmarks or proof.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 10 of 11
(3,612 Views)