OpenCV manipulating camera-related functions

Source: Internet
Author: User

1. Basic operation
Capture == capture.read () cv2.imwrite ("photo.jpg", image) Capture.release ()
2, Camera properties set (read, write)

Set

Cv2. VideoCapture. Set (propid, value) →retval

or cv.Setcaptureproperty(capture, property_id, value) → retval

Get


propid–

    

  • cv_cap_prop_pos_msec Current position of the video file in milliseconds.
  • cv_cap_prop_pos_frames 0-based Index of the frame to be decoded/captured next.
  • Cv_cap_prop_pos_avi_ratio Relative position of the video file:0-start of the film, 1-end of the film.
  • Cv_cap_prop_frame_width Width of the frames in the video stream.
  • Cv_cap_prop_frame_height Height of the frames in the video stream.
  • Cv_cap_prop_fps Frame rate.
  • CV_CAP_PROP_FOURCC 4-character Code of codec.
  • Cv_cap_prop_frame_count Number of frames in the video file.
  • Cv_cap_prop_format Format of the Mat objects returned by retrieve () .
  • Cv_cap_prop_mode Backend-specific value indicating the current capture mode.
  • cv_cap_prop_brightness Brightness of the image (only for cameras).
  • Cv_cap_prop_contrast Contrast of the image (only for cameras).
  • cv_cap_prop_saturation Saturation of the image (only for cameras).
  • Cv_cap_prop_hue Hue of the image (only for cameras).
  • Cv_cap_prop_gain Gain of the image (only for cameras).
  • cv_cap_prop_exposure Exposure (only for cameras).
  • Cv_cap_prop_convert_rgb The Boolean flags indicating whether images should is converted to RGB.
  • Cv_cap_prop_white_balance_u The U value of the whitebalance setting (Note:only supported by DC1394 v 2.x backend currently)
  • Cv_cap_prop_white_balance_v The V value of the whitebalance setting (Note:only supported by DC1394 V 2.x backend currently)
  • cv_cap_prop_rectification Rectification Flag for stereo cameras (Note:only supported by DC1394 v 2.x backend currently)
  • Cv_cap_prop_iso_speed The ISO speed of the camera (Note:only supported by DC1394 v 2.x backend currently)
  • cv_cap_prop_buffersize Amount of frames stored in internal buffer memory (Note:only supported by DC1394 v 2.x backend currently)

OpenCV manipulating camera-related functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.