Raspberry Piのカメラで静止画を撮る時のオプションメモ:fswebcam/USBカメラ時とraspistill/公式カメラ
カテゴリー:#電子工作 Raspberry Pi、Arduinoなど(記事数:238)

2024.12.04

Raspberry Piのカメラで静止画を撮る時のオプションメモ:fswebcam/USBカメラ時とraspistill/公式カメラ


★fswebcamの基本
fswebcam -D 3 -S 10 -r 1280x720 capture.jpg

 -?, --help                   Display this help page and exit.
-c, --config Load configuration from file.
-q, --quiet Hides all messages except for errors.
-v, --verbose Displays extra messages while capturing
--version Displays the version and exits.
-l, --loop Run in loop mode.
-b, --background Run in the background.
-o, --output Output the log to a file.
-d, --device Sets the source to use.
-i, --input Selects the input to use.
-t, --tuner Selects the tuner to use.
-f, --frequency Selects the frequency use.
-p, --palette Selects the palette format to use.
-D, --delay ★Sets the pre-capture delay time. (seconds)
-r, --resolution ★Sets the capture resolution.
--fps Sets the capture frame rate.
-F, --frames Sets the number of frames to capture.
-S, --skip ★Sets the number of frames to skip.
--dumpframe Dump a raw frame to file.
-s, --set = Sets a control value.
--revert Restores original captured image.
--flip ★Flips the image. (h, v)
--crop [,] Crop a part of the image.
--scale Scales the image.
--rotate ★Rotates the image in right angles.
--deinterlace Reduces interlace artifacts.
--invert Inverts the images colours.
--greyscale ★Removes colour from the image.
--swapchannels Swap channels c1 and c2.
--no-banner ★Hides the banner.
--top-banner Puts the banner at the top.
--bottom-banner Puts the banner at the bottom. (Default)
--banner-colour Sets the banner colour. (#AARRGGBB)
--line-colour Sets the banner line colour.
--text-colour Sets the text colour.
--font <[name][:size]> Sets the font and/or size.
--no-shadow Disables the text shadow.
--shadow Enables the text shadow.
--title ★Sets the main title. (top left)
--no-title ★Clears the main title.
--subtitle ★Sets the sub-title. (bottom left)
--no-subtitle ★Clears the sub-title.
--timestamp ★Sets the timestamp format. (top right)
--no-timestamp ★Clears the timestamp.
--gmt Use GMT instead of local timezone.
--info Sets the info text. (bottom right)
--no-info Clears the info text.
--underlay Sets the underlay image.
--no-underlay Clears the underlay.
--overlay Sets the overlay image.
--no-overlay Clears the overlay.
--jpeg ★Outputs a JPEG image. (-1, 0 - 95)
--png ★Outputs a PNG image. (-1, 0 - 10)
--save Save image to file.
--exec Execute a command and wait for it to complete.


★raspistill基本
raspistill -o capture.jpg

-q, --quality   : ★Set jpeg quality <0 to 100>
-r, --raw : Add raw bayer data to jpeg metadata
-l, --latest : Link latest complete image to filename
-t, --timeout : Time (in ms) before takes picture and shuts down (if not specified, set to 5s)
-th, --thumb : Set thumbnail parameters (x:y:quality) or none
-d, --demo : Run a demo mode (cycle through range of camera options, no capture)
-e, --encoding : ★Encoding to use for output file (jpg, bmp, gif, png)
-x, --exif : EXIF tag to apply to captures (format as 'key=value') or none
-tl, --timelapse : Timelapse mode. Takes a picture every ms. %d == frame number (Try: -o img_%04d.jpg)
-fp, --fullpreview : Run the preview using the still capture resolution (may reduce preview fps)
-k, --keypress : Wait between captures for a ENTER, X then ENTER to exit
-s, --signal : Wait between captures for a SIGUSR1 or SIGUSR2 from another process
-g, --gl : Draw preview to texture instead of using video render component
-gc, --glcapture : Capture the GL frame-buffer instead of the camera image
-bm, --burst : Enable 'burst capture mode'
-dt, --datetime : Replace output pattern (%d) with DateTime (MonthDayHourMinSec)
-ts, --timestamp : Replace output pattern (%d) with unix timestamp (seconds since 1970)
-fs, --framestart : Starting frame number in output pattern(%d)
-rs, --restart : JPEG Restart interval (default of 0 for none)

GL parameter commands

-gs, --glscene : GL scene square,teapot,mirror,yuv,sobel,vcsm_square
-gw, --glwin : GL window settings <'x,y,w,h'>

Common Settings commands

-?, --help : This help information
-w, --width : ★Set image width
-h, --height : ★Set image height
-o, --output : ★Output filename (to write to stdout, use '-o -'). If not specified, no file is saved
-v, --verbose : Output verbose information during run
-cs, --camselect : Select camera . Default 0
-md, --mode : Force sensor mode. 0=auto. See docs for other modes available
-gps, --gpsdexif : Apply real-time GPS information to output (e.g. EXIF in JPG, annotation in video (requires libgps.so.23)

Preview parameter commands

-p, --preview : Preview window settings <'x,y,w,h'>
-f, --fullscreen : Fullscreen preview mode
-op, --opacity : Preview window opacity (0-255)
-n, --nopreview : Do not display a preview window
-dn, --dispnum : Display on which to display the preview window (dispmanx/tvservice numbering)

Image parameter commands

-sh, --sharpness : Set image sharpness (-100 to 100)
-co, --contrast : Set image contrast (-100 to 100)
-br, --brightness : Set image brightness (0 to 100)
-sa, --saturation : Set image saturation (-100 to 100)
-ISO, --ISO : Set capture ISO
-vs, --vstab : Turn on video stabilisation
-ev, --ev : Set EV compensation - steps of 1/6 stop
-ex, --exposure : Set exposure mode (see Notes)
-fli, --flicker : Set flicker avoid mode (see Notes)
-awb, --awb : Set AWB mode (see Notes)
-ifx, --imxfx : Set image effect (see Notes)
-cfx, --colfx : Set colour effect (U:V)
-mm, --metering : Set metering mode (see Notes)
-rot, --rotation : ★Set image rotation (0, 90, 180, or 270)
-hf, --hflip : ★Set horizontal flip
-vf, --vflip : ★Set vertical flip
-roi, --roi : Set region of interest (x,y,w,d as normalised coordinates [0.0-1.0])
-ss, --shutter : ★Set shutter speed in microseconds
-awbg, --awbgains : Set AWB gains - AWB mode must be off
-drc, --drc : Set DRC Level (see Notes)
-st, --stats : Force recomputation of statistics on stills capture pass
-a, --annotate : Enable/Set annotate flags or text
-3d, --stereo : Select stereoscopic mode
-dec, --decimate : Half width/height of stereo image
-3dswap, --3dswap : Swap camera order for stereoscopic
-ae, --annotateex : Set extra annotation parameters (text size, text colour(hex YUV), bg colour(hex YUV), justify, x, y)
-ag, --analoggain : Set the analog gain (floating point)
-dg, --digitalgain : Set the digital gain (floating point)
-set, --settings : Retrieve camera settings and write to stdout
-fw, --focus : Draw a window with the focus FoM value on the image.


USBカメラの検出チェックは「lsusb」、公式カメラの検出は「vcgencmd get_camera」

Category:#電子工作 Raspberry Pi、Arduinoなど



■ ■ ■ コメント ■ ■ ■

いいっすね!

名前 ↑B

コメント(※改行は省略されます)

※3回以上の連続書き込み不可
この記事のアクセス数:

本カテゴリーで直近コメントが書かれた記事


→カテゴリー:#電子工作 Raspberry Pi、Arduinoなど(記事数:238)
本カテゴリーの最近の記事(コメント数)