Openag UI Camera Fix?


#21

Glad you found it. In more recent builds you’ll see a *usb_cam.yaml file that has those settings.


#22

I have been trying to fix this error, and seems that 2.1 has missing install files, but I have yet to get the system to work at all from the schools v1 set up, even after following instructions found here as well as https://wiki.openag.media.mit.edu/contributors/rob.baynes/rpisetup
The issue is i dont have an /opt/ros file, or *usb_cam.yaml, or head_camera file and when i created the head_usb.yaml file with the needed parameters for the v1 camera it is giving me a parse error , then it cant read then attempts to load default which wont work… Im getting very frustrated with this as I still have yet been able to get this thing running … and its going on 4 weekends and Im about to give up and recommend a scrap of the project due to the troubles… Where can i find (absolute path if you have it) of the camera configuration containing file. Please.


#23

If you don’t mind the 2.1 can run without camera image no show from UI, but all other sensor can work well, then no need to scrap the project.

Up to now, I used two usb webcam, one for fake out the system, one for take picture and put to ui.
usb_cam.yaml is localed at
~/catkin_ws/src/openag_brain/launch
copy the head_camera.yaml which had been mentioned above. create the path to place that

/home/pi/.ros/camera_info/head_camera.yaml

modify the image size, supported type (mjpg,yuyu) for your cam.
after faked the system, the other sensor can work well.

I am not good enought to debut the image problem ,So I add one webcam to it, then capture the image and put it to
/var/www/html/img.jpg with pi-image server. and second cam . Then I get more time to do other part for the project.

If someone can fix that then I can follow him.
If not (yet).I can still make progression

Hope you dont give up .


#24

Nope I just tried it again, i got the cam capabilities from the v4l2-ctl --all command and it spit out all the details I needed to update the usb_cam to head_cam.yaml, I created the directory : ~/home/pi/.ros/camera_info/head_camera.yaml with the following content:
video_device: "/dev/video0"
image_width: 1280
image_height: 960
pixel_format: "mjpeg"
io_method: "mmap"
camera_frame_id: "head_camera"
framerate: 15
contrast: 32
brightness: 32
saturation: 32
sharpness: 5
camera_info_url: ""
camera_name: “head_camera”

i get the following error message when starting:
[ INFO] [1509569354.804554410]: camera calibration URL: file:///home/pi/.ros/camera_info/head_camera.yaml
[ERROR] [1509569354.820009593]: Exception parsing YAML camera calibration:
yaml-cpp: error at line 0, column 0: bad conversion
[ERROR] [1509569354.827619111]: Failed to parse camera calibration from file [/home/pi/.ros/camera_info/head_camera.yaml]
[ WARN] [1509569354.833261744]: Camera calibration file /home/pi/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1509569354.842999710]: Starting ‘head_camera’ (/dev/video0) at 1280x1024 via mmap (mjpeg) at 1 FPS
[ WARN] [1509569356.472294795]: unknown control ‘focus_auto’

[ WARN] [1509569356.539693261]: unknown control 'focus_absolute'

and then the dreaded buffer error:
[mjpeg @ 0x1aaf1c0] overread 8
[ERROR] [1509569359.594300679]: outbuf size mismatch. pic_size: 2457600 bufsize: 2621440

this was the output of the v4l2-ctrl --all:
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : HD USB Camera
Bus info : usb-3f980000.usb-1.5
Driver version: 4.9.35
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/960
Pixel Format : 'MJPG’
Field : None
Bytes per Line: 0
Size Image : 2458189
Colorspace : SRGB
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 960
Default : Left 0, Top 0, Width 1280, Height 960
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 960
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 960
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 15.000 (15/1)
Read buffers : 0
brightness (int) : min=-64 max=64 step=1 default=-8193 value=32
contrast (int) : min=0 max=95 step=1 default=57343 value=32
saturation (int) : min=0 max=128 step=1 default=57343 value=32
hue (int) : min=-2000 max=2000 step=1 default=-8193 value=0
white_balance_temperature_auto (bool) : default=1 value=1
gamma (int) : min=100 max=300 step=1 default=57343 value=100
gain (int) : min=0 max=100 step=1 default=57343 value=0
power_line_frequency (menu) : min=0 max=2 default=1 value=1
white_balance_temperature (int) : min=2800 max=6500 step=1 default=57343 value=4600 flags=inactive
sharpness (int) : min=1 max=7 step=1 default=57343 value=7
backlight_compensation (int) : min=0 max=3 step=1 default=57343 value=1
exposure_auto (menu) : min=0 max=3 default=0 value=3
exposure_absolute (int) : min=1 max=5000 step=1 default=625 value=625 flags=inactive
exposure_auto_priority (bool) : default=0 value=1
brightness (int) : min=-64 max=64 step=1 default=-8193 value=32
contrast (int) : min=0 max=95 step=1 default=57343 value=32
saturation (int) : min=0 max=128 step=1 default=57343 value=32
hue (int) : min=-2000 max=2000 step=1 default=-8193 value=0
white_balance_temperature_auto (bool) : default=1 value=1
gamma (int) : min=100 max=300 step=1 default=57343 value=100
gain (int) : min=0 max=100 step=1 default=57343 value=0
power_line_frequency (menu) : min=0 max=2 default=1 value=1
white_balance_temperature (int) : min=2800 max=6500 step=1 default=57343 value=4600 flags=inactive
sharpness (int) : min=1 max=7 step=1 default=57343 value=7
backlight_compensation (int) : min=0 max=3 step=1 default=57343 value=1

EDIT** I was able to resolve the error messages by modifying the ~/catkin_ws/src/openag_brain/launch/personal_food_computer_v2.launch to point to the ~/.ros/camera_info/head_camera.yaml, i had to change the mjepeg to yuyv… and the errors went away, but the images aren’t being saved, is there somewhere where i can specify that to be the /var/www/html (Im using the image server solution from above)… My Camera failed some time into it and I have yet to really read that - i’ll see about figuring that out… but was wondering if there was some where i could designate the save point for the images?

**Edit 2:

I got the img files saving to the http folder (chmod 777) but I am minning the img.ini and img.yaml files, and it keeps spitting out errors and I am at a loss to writing the ini (right params and values)… if any of you guys have one that works would you mind posting it so I can get the camera functioning fully :slight_smile:

Any ideas?

Jesse Fender


#25

Hey I got to here with my pfc v1 camera, i am now getting the error to use yaml due to unexpected instances, the issue is that i cannot get the camera_calabration utility that is suggested in the linked posts to install and or run, so I cannot create the img.ini file… since you have yours working would it be possible to post it or tell me where i can find one to modify ? I canot seem to find one that i can use…

Many thanks.

Jesse Fender


#26

Hey,

I have a PFC v2 and have been able to get both cameras to work Ok with calibration enabled. Take a look at my “cv” branch of openag_brain which you can find here. You can find the yaml and other key files in the usual locations. Happy to answer any questions to help out here.

BTW, I still see long-term reliability issues with the cameras that I’ve been able to mitigate somewhat, at some point I’ll post my findings.

Lindo


#27

I took a look at your CV. I’m very interested to apply this to our V2.

I’m interested in what you’ve been able to obtain from images in the way of phenotype data. How consistent is the processing? What I’m wondering is how do things like plants overlapping, or different types of plants confuse the CV? So far as I can tell only leaf count and dimensions are available, do they at least provide consistent measurements from image to image? I’ve seen tons of pics of images, but no one has been able to show a series of images with CV applied that tells an accurate story of that plants growth.


#28

Hi,

I’ve only gotten to the point of getting openag CV integrated with openag brain. So its functional but that’s about it. Still very early. I do see a problem with overlapping plants, that’s for certain. Also, the open cv code consumes a lot of CPU cycles on the Raspberry Pi so I expect that considerable amount of optimization will need to be done at some point. I’ll continue to work on the CV aspects and welcome any further comments.

Thanks.

Lindo


#29

Okay thats nifty, nut ultimately not too helpful for my situation… I am needed the img.ini file from the /var/www/html directory that is seemingly required to run the camera properly… your git hub didnt include the img.ini file that you use… Also needs to nbe noted that we dont have the v2 equipment, but are trying to upgrade the oftware to v2 from v1, so It would be very helpful if that was the file available as teh v1 camera isnt really supprted on v2 software… please let me know if youare able to assist further.

Thank you,

Jesse Fender