How to set manually mat properties?
Hi
I would like to ask is it possible in opencv to set manually all mat properties. I am using a specialised camera were it is not possible to recognise it with opencv funcions. I would like to vizualise the data image of the camera using opencv but combining it with the opening funcitons offered by the manufacturer. I saw that when the image is ready there is a variable structure that has the following parameters:
typedef struct tag_mexImg
{
unsigned long Version; //!< [in] Version, currently it must be 'V003' (MEXIMGVERSION)<br>
unsigned long Bytes; //!< [in] Amount of bytes of this struct (sizeof(mexImg)).<br>
int dimX; //!< [in/out] Horizontal pixel dimension of image<br>
int dimY; //!< [in/out] Vertical pixel dimension of image<br>
void* pBw; //!< [in/out] Pointer to memory for monochrome image or for the \link page27 DIB-format \endlink<br>
void* pRed; //!< [in/out] Pointer to memory for red image channel<br>
void* pGreen; //!< [in/out] Pointer to memory for green image channel<br>
void* pBlue; //!< [in/out] Pointer to memory for blue image channel<br>
int channels; //!< [in] to take from enum mex_channels<br>
unsigned int bitmask; //!< [out] Bitmask of significant bits in image pixel data<br>
unsigned long stdTicks; //!< [out] Realized exposure standard ticks<br>
unsigned long addTicks; //!< [out] Realized exposure additional ticks<br>
unsigned long channelBytes; //!< [in/out] Realized amount of bytes per color channel<br>
int posX; //!< [out] X-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan)<br>
int posY; //!< [out] Y-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan)<br>
unsigned long bytesperPixel; //!< [in/out] Bytes per pixel and color (should be 1 or 2)<br>
unsigned long orientation; //!< [out] Flip conditions with respect to ::mex_orientation<br>
unsigned long exposuretime; //!< [out] exposure time - [microseconds}<br>
int colorMask; //!< [out] A value from enum ::mexColorMask <br>
unsigned __int64 timestamp; //!< [out] timestamp<br>
unsigned long user_index; //!< [in/out] instead of reserved[user_index]<br>
unsigned long HdNr; //!< Identifier, coming from frame header<br>
unsigned long Time[4]; //!< time stamps for logging purposes<br>
unsigned long reserved[4]; //!< Reserved for future use<br>
} mexImg;
I saw that my variable Mat frame has different parameters as:
Mat frame;
frame.addref();
frame.allocator;
frame.channels();
frame.cols;
frame.rows;
frame.data;
frame.datastart;
frame.dataend;
frame.datalimit;
frame.depth();
frame.dims;
frame.flags;
frame.refcount;
frame.reserve();
frame.size;
frame.step;
I think that if I want to visualize the image by imshow("image", frame); I have to set all the parameters of the Mat structure.
Could you help to resolve the problem?