Raspberry Pi Camera: Difference between revisions

From wikiluntti
 
Line 16: Line 16:
* <code>-r</code>
* <code>-r</code>
* --encoding png
* --encoding png
* <code>-n 1</code>
* <code> --width 4056 --height 3040 </code>
* <code>-o path/to/file.jpg</code>
* <code>-o path/to/file.jpg</code>
* <code>--gain 1 --awbgains 1,1 --immediate</code>  Automatic Exposure/Gain Control (AEC/AGC) and Auto White Balance (AWB).  Skip the preview phase entirely with the immediate option
* <code>--gain 1 --awbgains 1,1 --immediate</code>  Automatic Exposure/Gain Control (AEC/AGC) and Auto White Balance (AWB).  Skip the preview phase entirely with the immediate option
=== White Balance ===
<code>libcamera-still --awb custom --awbgains 0.9,2.0 </code>
In <code>--awbgains 0.9,2.0</code>, we have <code>--awbgains red,blue</code> 
* 0.9 is the gain for the red channel and
* 2.0 is the gain for the blue channel.
In other words, if your image is:
* too red -> decrease the first number
* too blue -> decrease the second number
* too yellow -> increase the second number (blue)
* too green -> increase both numbers
* too pink ->


== RPi camera rev 1.3 ==
== RPi camera rev 1.3 ==

Latest revision as of 17:16, 19 March 2025

Introduction

Rpicam is based on libcamera rpicam-still

To a raw jpeg file rpicam-still -r -o path/to/file.jpg

Some settings:

  • --timeout 0
  • --shutter 100000 takes a 100 sec photo
  • -r
  • --encoding png
  • -n 1
  • --width 4056 --height 3040
  • -o path/to/file.jpg
  • --gain 1 --awbgains 1,1 --immediate Automatic Exposure/Gain Control (AEC/AGC) and Auto White Balance (AWB). Skip the preview phase entirely with the immediate option

White Balance

libcamera-still --awb custom --awbgains 0.9,2.0

In --awbgains 0.9,2.0, we have --awbgains red,blue

  • 0.9 is the gain for the red channel and
  • 2.0 is the gain for the blue channel.

In other words, if your image is:

  • too red -> decrease the first number
  • too blue -> decrease the second number
  • too yellow -> increase the second number (blue)
  • too green -> increase both numbers
  • too pink ->

RPi camera rev 1.3

Focal Length 3.60 mm.

The v1 camera is based on the Omnivision OV5647.

RPi Cam ver 2

Specs =

  • Size ~ 25 × 24 × 9 mm
  • 8 MP, 1080p47, 1640 × 1232p41 and 640 × 480p206 / 3280 × 2464 pixels
  • Sony IMX219
  • Sensor area: 3.68 × 2.76 mm (4.6 mm diagonal); Pixel size 1.12 µm × 1.12 µm
  • Depth of field: Approx 10 cm to ∞
  • f = 3.04 mm
  • H Fov 62.2 deg, v Fov 48.8

Fixed focus module. Adding a +2D lens allows you to focus at about 25cm from the “target”. https://raspi.tv/2013/adapt-your-raspberry-pi-camera-for-close-up-use

Drawings with measures: https://datasheets.raspberrypi.com/camera/camera-module-2-mechanical-drawing.pdf

M12 lenses recommendation: https://www.gaojiaoptotech.com

Macro photos with V2

A V2 camera and screw out the lens until it focuses at 10cm.

M12 lenses

With any M12 mount, you do have to remove the tiny factory-stock lens from the sensor block first.

Hold https://www.thingiverse.com/thing:3347061

Focusing options

Before using these tools, you should take a hobby knife and carefully remove the glue locations so that the lens will rotate freely. You don't need to remove the glue at all: a slight twist of the tool, and the glue gives way with a little snap sound.

Tools for changing the lens (to change the focus distance):

Spectroscope

https://github.com/leswright1977/PySpectrometer2?tab=readme-ov-file

  • A CCTV Lens with Zoom (M12 Thread) (Search eBay for F1.6 zoom lens)

HQ Cameras

a

b

Microscopes

Some microscopes

Macro photography

Reproduction ratio: The ratio of the subject size on the sensor plane to the actual subject size.

d

I