Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
116 views
in Technique[技术] by (71.8m points)

java - OpenCV Constants.CaptureProperty

Hi I use OpenCV Java and have some problem.

I open video file and try get property like FPS. And others:

  • CV_CAP_PROP_POS_MSEC
  • CV_CAP_PROP_FRAME_COUNT

So first I opened video like this:

VideoCapture vC = new VideoCapture(url2);

and next i have a problem with function

vC.get(int i)

in OpenCV C++ its look like

vC.get(CV_CAP_PROP_FPS);

In Java where I find this constants?In HighGui I didnt find them. Only what I find is another libary to OpenCV where are this constants http://siggiorn.com/wp-content/uploads/libraries/opencv-java/docs/sj/opencv/Constants.CaptureProperty.html. But where I find them in OpenCV Java. Anyway how I have to use vC.get() function? Maybe some working example?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is a bug report about this issue.

Until it is fixed, I suggest that you find these constants in the C++ source code, and define them yourself.

Edit:

I was just curious myself. You find them in the file modules/highgui/include/opencv2/highgui.hpp They are:

   CAP_PROP_POS_MSEC       =0,
   CAP_PROP_POS_FRAMES     =1,
   CAP_PROP_POS_AVI_RATIO  =2,
   CAP_PROP_FRAME_WIDTH    =3,
   CAP_PROP_FRAME_HEIGHT   =4,
   CAP_PROP_FPS            =5,
   CAP_PROP_FOURCC         =6,
   CAP_PROP_FRAME_COUNT    =7,
   CAP_PROP_FORMAT         =8,
   CAP_PROP_MODE           =9,
   CAP_PROP_BRIGHTNESS    =10,
   CAP_PROP_CONTRAST      =11,
   CAP_PROP_SATURATION    =12,
   CAP_PROP_HUE           =13,
   CAP_PROP_GAIN          =14,
   CAP_PROP_EXPOSURE      =15,
   CAP_PROP_CONVERT_RGB   =16,
   CAP_PROP_WHITE_BALANCE_BLUE_U =17,
   CAP_PROP_RECTIFICATION =18,
   CAP_PROP_MONOCROME     =19,
   CAP_PROP_SHARPNESS     =20,
   CAP_PROP_AUTO_EXPOSURE =21, // DC1394: exposure control done by camera, user can adjust refernce level using this feature
   CAP_PROP_GAMMA         =22,
   CAP_PROP_TEMPERATURE   =23,
   CAP_PROP_TRIGGER       =24,
   CAP_PROP_TRIGGER_DELAY =25,
   CAP_PROP_WHITE_BALANCE_RED_V =26,
   CAP_PROP_ZOOM          =27,
   CAP_PROP_FOCUS         =28,
   CAP_PROP_GUID          =29,
   CAP_PROP_ISO_SPEED     =30,
   CAP_PROP_BACKLIGHT     =32,
   CAP_PROP_PAN           =33,
   CAP_PROP_TILT          =34,
   CAP_PROP_ROLL          =35,
   CAP_PROP_IRIS          =36,
   CAP_PROP_SETTINGS      =37

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...