Hi Charlie,
It's like a beginner tech to teacher
I think you must log in to root
1st problem, you should have 'param.par' file in the home folder.
2nd problem, you must create the 'tmp1' ram drive
Raspberry Pi camera module
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Raspberry Pi camera module
OK. I suggest you add the following code at line 79 to create 'param.par' if it does not exist
I changed all references to the RamDrive to /tmp (not /tmp1) and added the following 'Sub' which I took from 'PiCam'.
If Not Exist(User.home &/ "param.par") Then File.Save(User.home &/ "param.par", "")
I changed all references to the RamDrive to /tmp (not /tmp1) and added the following 'Sub' which I took from 'PiCam'.
Public Sub CreateRAMDrive() 'To create a RAM drive to hold the SSH Preview picture
Dim sFstab As String 'To store the details in the fstab file
If Not Exist("/var/tmp") Then Mkdir "/var/tmp" 'Does this folder exist, if not create it
sFstab = File.Load("/etc/fstab") 'Load the contents of fstab into sFstab
If Not InStr(sFstab, "tmpfs /var/tmp tmpfs nodev,nosuid,size=3M 0 0") Then 'If the string we need to create the 3Meg RAM drive is not there then..
sFstab &= "\ntmpfs /var/tmp tmpfs nodev,nosuid,size=3M 0 0\n" 'Add the string to the end of the file
File.Save(User.Home &/ "fstab", sFstab) 'Save the file to the Home folder
Shell "sudo mv ~/fstab /etc/fstab" 'Move the file to the 'etc' folder
Shell "sudo mount -a" 'Mount all drives including our new one
Endif
End
Then call that the 'Sub' : -Public Sub Form_Open()
CreateRAMDrive
If (wiringPiSetup() = -1).............
I get a picture taken in the RamDrive but I am not sure what is supposed to happen next, I have changed all the values and clicked everything but nothing seems to happen. Are you still trying to display video output?Re: Raspberry Pi camera module
It's about how to setting the parameter. For test just add a button with code like picture below:
for example if you want capture the position of image with the writing SIMATIC you must set the paramater Pos with value like image below,
press copy button you will copy the necessary position to right area. After that if you press 'calculate' will count differential pixel color in the image copied area.
If you give different value in Pos parameter and try step like above will give different pixel count. Just if trigger active and picture shot by camera automatically and if Actual pixel count less then limit the output will be energize.
IF you run the program then click the button will shot the camera like below:
Now you can fill the parameter. Size mean size area copied of image from left to right area, Pos mean position area copied of image from left to right area.for example if you want capture the position of image with the writing SIMATIC you must set the paramater Pos with value like image below,
press copy button you will copy the necessary position to right area. After that if you press 'calculate' will count differential pixel color in the image copied area.
If you give different value in Pos parameter and try step like above will give different pixel count. Just if trigger active and picture shot by camera automatically and if Actual pixel count less then limit the output will be energize.
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Raspberry Pi camera module
Matt and I have done some work for you. Have a look at the attached program.
When you want to 'Copy' just use the mouse to select the area to copy and when you release the mouse button it will copy across automatically.
Hope you like it.
When you want to 'Copy' just use the mouse to select the area to copy and when you release the mouse button it will copy across automatically.
Hope you like it.
Re: Raspberry Pi camera module
my goal to make this project is to stop the conveyor if PiCam detected products that are not printed with barcode images automatically. See my block diagram below.
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Raspberry Pi camera module
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.
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.
Re: Raspberry Pi camera module
Hi Charlie,
It looks like an advanced level . 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?
It looks like an advanced level . 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?
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Raspberry Pi camera module
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 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
Re: Raspberry Pi camera module
Hello,
Beside reading the barcode image, how to detect there is text printed at the box or not
Beside reading the barcode image, how to detect there is text printed at the box or not
Re: Raspberry Pi camera module
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).