Camera Rotation

Hi All,

I have seen a bunch of posts that are similar but may not be exactly the same as what i have in mind. I tried to rotate the camera in all possible directions but i see some black edges. Wondering if there is an easy way to mark what will make the camera square to the bed. I tried connecting this to my iPad but i really cant use the camera. Trying to do this via the app and uploading images is frustrating. Is there a way to do this via another raspberry pi?

Attached is the image i get using the card that was shipped with the Genesis XL.


The black edges are a result of the software adjusting for a rotated camera based on the CAMERA ROTATION value (as determined by camera calibration, but it can also be manually changed). You can physically rotate the camera in the holder to reduce the need for software rotation (and therefore reduce the black space). If you do so, the CAMERA ROTATION value should be reset since it no longer applies to the current camera hardware configuration. You can manually change the value to 0 (to remove the software rotation which results in black edges) or run camera calibration again to let it determine a new (hopefully smaller) value.

Plugging the camera into a tablet or phone during physical adjustment is a great idea if you have an app that supports USB cameras. If not, any laptop or Raspberry Pi could be used with standard webcam software. A mark could be added with tape or pen to the camera housing to aid physical alignment. If the card is aligned square with the bed, the camera could then be rotated until the card is square with the visible image frame. Otherwise, moving the bot to a coordinate near the edge of the bed so that a square bed edge, a toolbay, or part of the gantry is visible in photos may help.

1 Like

Thanks, Gabriel. I dont think the iPad is a good option. I will try and rig-up a raspberry pi to see if that works. Thanks for the comments.

@Gabriel following up on an earlier conversation we had. I tried to square the camera using a raspberry pi 4 using VLC to stream the video. Below is an image. This was shot at max height. I used the card that came with the bot to try and calibrate as the weeder is failing to recognize the coordinate. I am still not sure how to get this thing calibrated. Is the card a bad idea? It simply complains that it cannot find the objects at the bottom on the cards.

1 Like

If the calibration card is fully visible in photos (as your screenshots show) and you get the Calibration failed. No objects detected. error, it may mean you need to adjust the color parameters. Can you try moving the left HUE and SATURATION slider handles to 0?

Regarding the z-axis height, you will want to run camera calibration at the same height you will normally be taking photos and running weed detection, and a good choice is “as high as it will go” for the best field of view, as the documentation states. The z-axis coordinate at this height (and the homing direction) will depend on your device hardware settings, but when using the default settings the height value is 0 (and the homing direction is up). Using a different z-axis height for weed detection than the calibrated camera height will result in the Coordinate conversion calibration values invalid for provided image. error.

The dial on the USB connector adjusts the camera LED brightness. Turning them off can increase image quality in some cases.

Thanks, @Gabriel. That is great info. Interesting to know that camera calib height and weeder height are connected. I will try and do the same at the same height. Homing happens at 0. I am going to try and find a way to change that cause it ends up hitting the metal holder for the different parts such as the seeder, weeder and watering attachment as i placed them close to 0,0 on the bed.

I know its been a month but I had a much much much much easier time getting the objects to be recognized when I did my calibration in the evening, close to dusk.

During the day, the dots were washed out and looked like all the little pieces of white stuff in my soil.

Alternatively, you can put up something to create shade . . .