Raspberry Pi camera module

Post

Posted
Rating:
#26
Avatar
Guru
cogier is in the usergroup ‘Guru’
Have a look at the attached program to see if it helps you.

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.

Attachment

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#27
Regular
sony is in the usergroup ‘Regular’
Hi Charlie,
It looks like an advanced level  :o . My project is running with a running conveyor as well, so I decided to only detect barcode images, not barcode data.
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?
Online now: No Back to the top

Post

Posted
Rating:
#28
Avatar
Guru
cogier is in the usergroup ‘Guru’
I think that if the bar code is in the same position on the boxes then the camera will be able to read the bar code and that will tell your program that there is a bar code on the box. It does not matter that the program reads the actual bar code only that it exists. Change sOutput to ="Yes" and you will get a "Yes" every time there is a bar code.

It must be worth a try.

It looks like an advanced level  :o
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?
Online now: No Back to the top

Post

Posted
Rating:
#29
Regular
sony is in the usergroup ‘Regular’
Hello,
Beside reading the barcode image, how to detect there is text printed at the box or not
Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#30
Avatar
Regular
stevedee is in the usergroup ‘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).
Online now: No Back to the top

Post

Posted
Rating:
#31
Regular
sony is in the usergroup ‘Regular’
 Hi Steve,
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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.