Cannot set properties (frame_width, _height, ...) for Ximea camera (OpenCV 2.4.10 compiled with WITH_XIMEA flag)
Without any problems I can access my internal camera webcam and also change the resolution. So displaying the frame with default resolution and with a predefined resolution (e.g., from 640x480 to 320x240, with cap.set(CV_CAP_PROP_FRAME_WIDTH,320), and FRAME_HEIGHT, 240)) – both work fine.
Using the same code with slight adaption so that it works with a Ximea camera (VideoCapture cap(CV_CAP_XIAPI)), does work for the default resolution. It is a MU9PC_MH with a default resolution of 2592x1944. It does not work for another than the default resolution, e.g., 648 x486 (referring to Ximea specifications it is supported by the camera).
As I had already asked that question in Stackoverflow, I tried the proposed solution of resizing the frame after receiving, but comparing with the result I get with the ximea api, the opencv result seems worse. I know that I have to set properties to my requirements, as it is a industrial camera, but I would rather prefer doing it via OpenCV.
Does anyone have any suggestions? Thanks for reading :)
Hmm looking at the sourcecode of the ximea interface you should be able to set that parameter. Can you run a debug session and see if it reaches that function? Especially check the value of
mvret
. Did you build OpenCV with Ximea support, which is not in by default?Thank you for your quick reply. It's not that I do not get any frame. The frames are shown, e.g., four times as smallthumbnails in a big window with the default size of the ximea camera. Maybe I'm doing something wrong, but I cannot find the mvret in my debug. Yes, I build opencv with ximea - if I haven't I would not be able to access the ximea camera with CV_CAP_XIAPI