Difference between revisions of "Template:Ir-cut camera raspicam"

From Waveshare Wiki
Jump to: navigation, search
 
Line 124: Line 124:
 
*shade: shadow mode
 
*shade: shadow mode
 
*tungsten: Tungsten mode (2500K ~ 3500K)
 
*tungsten: Tungsten mode (2500K ~ 3500K)
*incandescent: Incandescent mode (2500K ~ 4500K)
+
*incadescent: Incadescent mode (2500K ~ 4500K)
 
*flash: flash mode
 
*flash: flash mode
 
*horizon: horizon mode
 
*horizon: horizon mode

Latest revision as of 09:01, 27 February 2023

Introduction

If you are using the Buster version of the image, the Raspicam driver is installed by default in the system, you can directly turn on the camera and use it.
If you are using the latest Bullseye system, you need to install and configure it separately.

Install Raspicam (optional)

Open the Raspberry Pi terminal, and enter the following command to install the driver. Note: This driver cannot support a 64-bit Raspberry Pi system temporarily.

sudo apt-get update
cd
sudo apt install cmake
git clone https://github.com/raspberrypi/userland
cd userland
./buildme
cp build/bin/* ~/bin/

After following the need to restart the system.

sudo reboot

Call camera

raspistill

The raspistill command is used to take still pictures. Example: raspistill -o cam.jpg

raspivid

The raspivid command is used to record video. Example: raspivid -o vid.h264

raspiyuv

The raspiyuv command has the same function as raspisitll, the difference is that raspiyuv is not Su Chu. jpgs and other standard image files, but generate YUV420 or RGB888 image files from the camera's ISP output.
In most cases, it is better to use raspistill to capture images, but if you want to use uncompressed black and white images, you can choose to use the raspiyuv command. Example: raspiyuv -o cam.jpg

Instruction Setting Options

When the raspicam command is used, the final imaging effect can be adjusted by setting options. The available setting options are listed below for reference.

--preview, -p #Set the preview window <x, y, w, h>

The user can set the position of the preview window by setting the values ​​of x and y, and adjust the resolution of the preview image by setting the values ​​of w and h.

--fullscreen, -f #Fullscreen preview window

Display the preview window in full screen.

--nopreview, -n #Do not display the preview window

Close the preview window and the command will output the image or video directly to a file.

--opacity, -op #Set the transparency of the preview window

Set the transparency of the preview window, 0 is invisible, and 255 is fully transparent.

--sharpness, -sh #Set image sharpness (-100 - 100)

The default sharpening value is 0.

--contrast. -co #Set image contrast (-100 - 100)

The default contrast is 0.

--brightness, -br #Set image contrast (0 - 100)

The default brightness is 50, 0 is fully black, and 100 is full white.

--saturation, -sa #Set image saturation (-100 - 100)

The default saturation is 0.

--ISO #Set shutter sensitivity (100 - 800)

Set sensitivity when taking pictures.

--vstab, -vs #Enable video stabilization

Only the video recording mode is valid, and video stabilization is enabled.

--ev #Set EV compensation

Set the EV compensation value of the image to default 0.

--exposure, -ex #Set exposure mode

Settable exposure options:

  • auto: automatic exposure mode
  • night: night shooting mode
  • nightpreview
  • backlight: backlight mode
  • spotlight
  • sports: sports mode (the shutter time will be shortened in sports mode)
  • snow: snow mode
  • beach: beach mode
  • verylong: long exposure mode
  • fixedfps: fixed fps
  • antishake: anti-shake mode
  • fireworks: fireworks mode

Note: Depending on the camera model, some modes are not available.

--flicker, -fli #Flicker avoidance

Modes that can be set:

  • off: turn off anti-flicker mode
  • auto: auto-detect betting frequency
  • 50Hz: set the anti-flicker frequency to 50Hz
  • 60Hz: set the anti-flicker frequency to 60Hz
--awb, #Set auto white balance mode
  • off: disable auto white balance
  • auto: Auto white balance mode (default)
  • sun: sunny mode (5000K ~ 6500K)
  • cloud: cloudy mode (6500K ~ 12000K)
  • shade: shadow mode
  • tungsten: Tungsten mode (2500K ~ 3500K)
  • incadescent: Incadescent mode (2500K ~ 4500K)
  • flash: flash mode
  • horizon: horizon mode
  • greyworld: If you are using a camera without an IR filter (eg NoIR), you can fix the white balance misalignment caused by the lack of an IR filter

Note: Depending on the camera model, some modes are not available.

--imfx, -ifx #Set image filter effect

Configurable image filter effects:

  • none: no effect (default)
  • negative: color flip
  • solarise: sunlight effect
  • posterise: poster effect
  • whiteboard: whiteboard effect
  • backboard: blackboard effect
  • sketch: sketch
  • denoise: denoise
  • emboss: emboss
  • oilpaint: oil painting
  • hatch: texture
  • gpen: pencil sketch
  • pastel: colored pencils
  • watercolour: watercolor
  • film: film
  • blur: blur
  • saturation: saturation

Note: Depending on the camera model, some modes are not available.

--colfx, -cfx #Set color effect <U:V>

The setting range of the U and V parameters is 0 ~ 255, which are used to adjust the values ​​of the U and Y channels. For example --colfx 128:128 will set the image to monochrome.

--metering, -mm #Set metering mode

Settable options:

  • Average: average or full frame metering
  • spot: spot metering
  • backlit: preset a backlit image
  • matrix: matrix metering
--rotation, -rot #Set image rotation (0 - 359)

The image rotation angle can be set by the angle parameter.

--hflip, -hf #Set the image to flip horizontally

Set the image to be flipped horizontally.

--vflip, -vf #Set the image to flip vertically

Flip the image vertically.

--roi, #Crop image <x, y, w, h>

Crop the image according to the parameters, note that the parameters are all planned in (0,0 ~ 1.0), for example, if you want to crop 1/4 of the image, you can use the command - roi 0.5,0.5,0.25,0.25.

--shutter, --ss set shutter speed/time

Set the shutter time (unit: ms). Shutter time The maximum shutter time that can be set is different depending on the photosensitive chip.

Model Max Digit (ms)
V1 (OV5647) 6000000 (6s)
V2 (IMX219) 10000000 (10s)
HQ (IMX477 200000000 (200s)
--drc, -drc #Enable/disable dynamic range compression
  • off (default)
  • low
  • med
  • high
--stats, -st #Statistics images by static image frames
--awbgains, -awbg

Set blue and green gain, which takes effect if --awb off is set.

--analoggain, -ag

Set the analog gain value

--digitalgain, -dg

Set digital gain value

--mode, -md

Set sensor mode:

  • OV5647
Mode Resolution Aspect Ratio Frame Rate FoV
0 Automatic selection
1 1920 x 1080 16:9 1-30fps Partial
2 2592 x 1944 4:3 1-15fps Full Frame
3 2592 x 1944 4:3 0.1666 - 1fps Full Frame
4 1296 x 972 4:3 1 - 42fps Full Frame
5 1296 x 730 16:9 1- 49fps Full Frame
6 640 x 480 4:3 42.1 - 60fps Full Frame
7 640 x 480 4:3 60.1 - 90fps Full Frame
  • IMX219
Mode Resolution Aspect Ratio Frame Rate FoV
0 Automatic selection
1 1920 x 1080 16:9 0.1-30fps Partial
2 3280 x 2464 4:3 0.1-15fps Full Frame
3 3280 x 2464 4:3 0.1 - 15fps Full Frame
4 1640 x 972 4:3 1 - 42fps Full Frame
5 1296 x 730 16:9 1- 49fps Full Frame
6 640 x 480 4:3 42.1 - 60fps Full Frame
7 640 x 480 4:3 60.1 - 90fps Full Frame
  • HQ Camera
Mode Resolution Aspect Ratio Frame Rate FoV
0 Automatic selection
1 2028 x 1080 169:90 0.1-50fps Partial
2 2028 x 1080 4:3 0.1-50fps Full Frame
3 4056 x 3040 4:3 0.005 - 10fps Full Frame
4 1332 x 990 74:55 50.1-120 fps Partial
--camselect, -cs

When multiple cameras are connected to the system, select camera, 0 or 1.

--annotate, -a #enable/set annotations

The parameters are represented by bit masks in the metadata, which can be directly represented by addition. For example, 12 can represent the display time (4) and the display date (8), which is represented by the addition of 4+8 =12.
Configurable options

Value Parameter description
-a 4 Time
-a 8 Date
-a 12 Time and date, actually 4 + 8
-a 16 Shutter setting
-a 32 CAF settings
-a 64 Gain setting
-a 128 Lens settings
-a 256 Animation settings
-a 512 Number of frames
-a 1024 Black background
-a "ABC %Y-%m-%d %X" Display text
-a 4 -a "ABC %Y-%m-%d %X" Display time/date in custom format
-a 8 -a "ABC %Y-%m-%d %X" Display time/date in custom format
--annotateex, -ae #Set additional annotation parameters
--stereo, -3d

Set the binocular mode.

  • sbs - side-by-side mode
  • tb: - Portrait mode
  • off - turn off binocular mode (default)
--decimate, -dec

Halve the width and height of the binocular image.

--setting, -set

Output current camera settings.

raspistill setting parameters

--width, -w         #Set image width
--height, -h        #Set image height
--quality, 0q       #Set JPEG quality <0 ~ 100>
--raw, -r           #Add raw Bayer data to JPEG metadata
--output, -o        #Output file <filename>
--latest, -l        #Associate the last frame image to the file <filename>
--verbose, -v       #Print details
--timeout, -t       #Set the program preview time
--timelapse, -tl    #Set up demo photography
--framestart, -fs   #Save the number of the first frame
--datetime, -dt     #Name the file with DateTime
--timestamp, -ts    #Name files with timestamps
--thumb, -th        #Set thumbnail parameters <x:y:quility>, the default is (64:48:35)
--demo, -d          #Run demo mode <ms"
--encoding, -e      #Encode according to the specified format, jpg, BMP, or png
--restart, -rs      #Set JPEG restart flag
--exif, -x          #Set EXIF ​​flag
--gpsdexif, -gps    #Set real-time Exif time (requires GPS Dongle access)
--fullpreview, -fg  #Fullscreen preview
--keypress, -k      #Keypress camera mode
--signal, -s        #Signal mode
--burst, -bm        #Snapshot mode

raspivid setting parameters

--width, -w         #Set the video width
--height, -h        #Set the video height
--bitrate, -b       #Set bitrate
--output, -o        #Set the output filename <filename>
--listen, -l        #When using a network connection, wait for a network connection
--versbose, -v      #Print details
--timeout, -t       #Set preview time
--demo, -d          #Run demo <ms>
--framerate, -fs    #Set frame rate
--penc, -e          #Display the encoded preview image
--intra, -g         #Set the internal refresh cycle
--qp, -qp           #Set quantization parameters
--profile, -pf      #Specify H264 profile, baseline/main/high
--level, -lev       #Set H264 encoding level
--irefresh, -if     #Set H264 internal refresh type cyclic/adaptive/both/cyclicrows
--inline, -ih       #Insert PPS, SPS header
--spstimings, -stm  #Insert timing information into SPS blocks
--timed, -td        #Timed switch recording and pause function
--keypress, -k      #Keypress to pause recording
--signal, -s        #Switch pause and record state according to SIGUSR1
--split, -sp        #In signal and keypress mode, the file will be recreated every time you re-record
--vectors, -x       #Vector output
--flush, -fl        #Force the output data buffer to be flushed immediately after writing video data, bypassing any OS cache for written data and reducing latency.
--save-pts, -pts    #Save timestamp information to the specified file.
--codec, -cd        #Specify encoder H264 / MJPEG
--initial, -i       #Set the initial state of startup
--segment, -sg      #Split video stream into multiple files
--wrap, -wr         #Set the maximum value of the split
--start, -sn        #Set the initial split encoding
--raw, -r           #Set metadata file name
--raw-format, -rf   #Specify metadata format yuv/rgb/grey