OpenCV & ZBar scanning
Hi,
I've found this Tutorial on the web for using OpenCV and ZBar for "xx"-code scanning. I've got this stuff working and it really is a nice clean tut. But now I'm trying to do the same, but now with live camera feed (webcam). I've tried several things to get this working, but I can't seem to get the feed scanned over my webcam feed. Does anyone have any experience with this? Can you share a sample project with me, or refer me to a other sample where I can do this?
Source Tut:
http://blog.ayoungprogrammer.com/2013/07/tutorial-scanning-barcodes-qr-codes.html
!..To be clear:
- I want to be able to scan QR-codes using OpenCV.
- Datamatrix example in OpenCV isn't working for me (3 characters limit?). Found in the sample code. Pls correct me if I'm wrong and can scan more characters with this.
- I've tried ZBar in this example here, but I also have read about ZXing. Which library to use isn't that important to me. I just want to be able to scan QR with OpenCV. I
Hope someone can help me to the right direction. Thanks in advance,
Bilow
It is kind of bizarre. If you succeed in executing the code for a single image, then just put that in a seperate function, add a loop to go through video frames one by one and then apply the function to that specific frame. That would do the trick right?
The code from the sample is using images stored on the computer. I'm trying to loop trough the code frame by frame as you said yes (got the code from the openCV samples), but I'm getting this error:
Unhandled exception at 0x770E4B32 in ConsoleApplicationCV.exe: Microsoft C++ exception: cv::Exception at memory location 0x002FB3F4.
If you'd take the sample given above (see link), what would be the correct way to loop it then??
Just do something like
And to add to this, your problem is probably a wrong pointer handling. The link you refer to is using the old depricated C api which will dissappear in the near future, so I would suggest switching the code to the C++ interface. Cannot be that hard.
How about the DataMatrix example given with openCV then? ( Samples -> Cpp -> video_dmtx.cpp ) Why is this only supporting up to 3 characters?
Because it is only a sample ... you should change it to your needs...
Yeah, I'm reading the code, and checking the source of it over and over (also in objdeteect.hpp). But I can't seem to find where the 3 character limit is set? Or, what would I've to add to make it read 10 characters then (for example).
I do not have time to dig into the code myself ... got my own projects to finish!