Raspberry Pi camera module
Posted
Guru

It requires the installation of 'zbar-tools' and the use of a standard webcam NOT a Raspberry Pi camera.
Tested on Raspberry Pi 3 and Linux Mint 18.3.
It will scan a barcode and show the output.
Posted
Regular

It looks like an advanced level
The first time I also tried to use the webcam but could not capture the image object well. With PiCam I can take pictures of moving objects even with blurred results.
You can imagine if many moving box to detected and then the RPi must able to detect wich box with or without barcode sticker.
Any idea?
Posted
Guru

It must be worth a try.
There is not very much code there if you strip out the code I used to make it look pretty. Have you run the program?It looks like an advanced level![]()
Posted
Regular

Beside reading the barcode image, how to detect there is text printed at the box or not
Posted
Regular

sony said
…how to detect there is text printed at the box or not…
I think any solution will be relatively complicated, and if this was a real industrial conveyor system, you would need a proper rugged transducer/reader, rather than a RaspiCam.
But as an academic exercise, you would need to use some form of image recognition. Perhaps you could simply grab an image at the right time, and find a rectangular area within the image where all sides where 'white' (the pixel average value of this white border would form your reference level). Then you could check the average intensity based upon all pixels within this rectangle. If the average was considerably lower than your reference level (the 'white' sides), then it is likely that the white box contains printed text (…or smudged ink, or a dirty mark, or a house fly…).
Or you could use image or text recognition by using someone's library (probably written in C or maybe Python) or fully research the subject and write your own for Gambas (very time consuming).
Posted
Regular

That way I made reference value in 'ek' variable in my program. Every time I calculate in the rectangle mask that 'ek >18' I add cnt by 1. So it's compare with ValueBox5.Value.
IF all pixel inside mask equal with 'ek' mean no image.
1 guest and 0 members have just viewed this.




