Raspberry Pi camera module

Post your Gambas programming questions here.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Raspberry Pi camera module

Post by stevedee »

I don't have any time this weekend to look at this, but I wonder whether you should be using v4l to get images from RaspiCam (via /dev/video0) rather than using Raspistill or Raspivid in a Shell.

I think there are Gambas components for both v4l and gstreamer that might be worth exploring.
sony
Posts: 32
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony »

Hi Steve,
Sorry I'm not use v4l for picamera but v4l for usb webcam.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier »

I am trying to understand what you are trying to do, can you explain what you hope to achieve.

Are you using the Pi and a USB camera or a Pi Camera?

Are you trying to capture the video on the Pi or stream it to another computer?
sony
Posts: 32
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony »

Sorry I'm slow in english ;) ....
I only using RPi.
By using my latest program, I use picamera and RPI but I can not copy the video into drawingarea as picture when a button pressed.
If I have a picture (gray scale/black white) inside drawing area I will count the pixel and compare the pixel value with my reference.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier »

OK let's see if I have got this right. Attached is my PiCam software with a additional Form and Class.

Run the program. Take a picture with the size at 800 x 800 then click on the 'Sony' button and you will see the picture you took in a DrawingArea.

Is this what you are looking for?

This will only work on a Raspberry Pi using the picamera
PiCam_Sony.tar
(180 KiB) Downloaded 501 times
sony
Posts: 32
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony »

Hello,
I run your program, but that is not I mean. I mean just click the "Sony" button the current running video is show in drawingarea as picture. I do not need read jpg file to visualize into drawingarea, because in the next time I will do million times to take the current running video is show in drawingarea as picture.

regards
Sony
sony
Posts: 32
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony »

Hello,
Today I read your program carefully and now I understand about using ram drive :) I assume read / write into ram million times is not to make ram damage. So with raspstill command to save image *.jpg file into ram drive and read again then place into drawingarea.
Thank you very much for helping me.

Best regards

Sony
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier »

Hi Sony,

You cannot see the 'raspistill' output over SSH so the program takes a photo 75 times a minute that is stored in RAM which is quicker and does no damage to the SD card. The picture can then be seen over a SSH link.

Glad it helped,

Charlie
sony
Posts: 32
Joined: Wednesday 14th June 2017 12:28am

Re: Raspberry Pi camera module

Post by sony »

Here my code,
PiCamera.zip
(43.27 KiB) Downloaded 500 times
sorry for the messy code
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Raspberry Pi camera module

Post by cogier »

Hi Sony,

I got the LibWiringPi sorted :D

Then at line 78 I got error 'File of directory does not exist' :o
nf = "~/param.par"
hfile = Open nf for Input
I REMed that out then I got another error at Line 180, 'Unable to load picture' :?
hMyPic = Picture.Load("/var/tmp1/sample.jpg")
What am I missing?
Post Reply