cvGetCaptureProperty

double cvGetCaptureProperty( CvCapture* capture, int property_id );
capture 視頻獲取結構。
property_id 屬性標識。可以是下面之一:
enum
{
// modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
// every feature can have only one mode turned on at a time
CV_CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically)
CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
CV_CAP_PROP_DC1394_MODE_AUTO = -2,
CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
CV_CAP_PROP_POS_MSEC =0,
CV_CAP_PROP_POS_FRAMES =1,
CV_CAP_PROP_POS_AVI_RATIO =2,
CV_CAP_PROP_FRAME_WIDTH =3,
CV_CAP_PROP_FRAME_HEIGHT =4,
CV_CAP_PROP_FPS =5,
CV_CAP_PROP_FOURCC =6,
CV_CAP_PROP_FRAME_COUNT =7,
CV_CAP_PROP_FORMAT =8,
CV_CAP_PROP_MODE =9,
CV_CAP_PROP_BRIGHTNESS =10,
CV_CAP_PROP_CONTRAST =11,
CV_CAP_PROP_SATURATION =12,
CV_CAP_PROP_HUE =13,
CV_CAP_PROP_GAIN =14,
CV_CAP_PROP_EXPOSURE =15,
CV_CAP_PROP_CONVERT_RGB =16,
CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
CV_CAP_PROP_RECTIFICATION =18,
CV_CAP_PROP_MONOCROME =19,
CV_CAP_PROP_SHARPNESS =20,
CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,
// user can adjust refernce level
// using this feature
CV_CAP_PROP_GAMMA =22,
CV_CAP_PROP_TEMPERATURE =23,
CV_CAP_PROP_TRIGGER =24,
CV_CAP_PROP_TRIGGER_DELAY =25,
CV_CAP_PROP_WHITE_BALANCE_RED_V =26,
CV_CAP_PROP_MAX_DC1394 =27,
CV_CAP_PROP_AUTOGRAB =1024, // property for highgui class CvCapture_Android only
CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // tricky property, returns cpnst char* indeed
// OpenNI map generators
CV_CAP_OPENNI_DEPTH_GENERATOR = 0,
CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 31,
CV_CAP_OPENNI_GENERATORS_MASK = 1 << 31,
// Properties of cameras available through OpenNI interfaces
CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100,
CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
CV_CAP_PROP_OPENNI_BASELINE = 102, // in mm
CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels
CV_CAP_PROP_OPENNI_REGISTRATION_ON = 104, // flag
CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION_ON,
// Properties of cameras available through GStreamer interface
CV_CAP_GSTREAMER_QUEUE_LENGTH= 200, // default is 1
CV_CAP_PROP_PVAPI_MULTICASTIP = 300 // ip for anable multicast master mode. 0 for disable multicast
};
參見opencv2.3.1highgui_c.h
CV_CAP_PROP_POS_MSEC - 影片目前位置,為毫秒數或者視頻獲取時間戳
CV_CAP_PROP_POS_FRAMES - 將被下一步解壓/獲取的幀索引,以0為起點
CV_CAP_PROP_POS_AVI_RATIO - 視頻檔案的相對位置(0 - 影片的開始,1 - 影片的結尾)
CV_CAP_PROP_FRAME_WIDTH - 視頻流中的幀寬度
CV_CAP_PROP_FRAME_HEIGHT - 視頻流中的幀高度
CV_CAP_PROP_FPS - 幀率
CV_CAP_PROP_FOURCC - 表示codec的四個字元
CV_CAP_PROP_FRAME_COUNT - 視頻檔案中幀的總數
函式cvGetCaptureProperty獲得攝像頭或者視頻檔案的指定屬性。
譯者註:有時候這個函式在cvQueryFrame被調用一次後,再調用cvGetCaptureProperty才會返回正確的數值。這是一個bug,建議在調用此函式前先調用cvQueryFrame。

相關詞條

熱門詞條

聯絡我們