Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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) unsigned long Bytes; //!< [in] Amount of bytes of this struct (sizeof(mexImg)). int dimX; //!< [in/out] Horizontal pixel dimension of image int dimY; //!< [in/out] Vertical pixel dimension of image void* pBw; //!< [in/out] Pointer to memory for monochrome image or for the \link page27 DIB-format \endlink void* pRed; //!< [in/out] Pointer to memory for red image channel void* pGreen; //!< [in/out] Pointer to memory for green image channel void* pBlue; //!< [in/out] Pointer to memory for blue image channel int channels; //!< [in] to take from enum mex_channels unsigned int bitmask; //!< [out] Bitmask of significant bits in image pixel data unsigned long stdTicks; //!< [out] Realized exposure standard ticks unsigned long addTicks; //!< [out] Realized exposure additional ticks unsigned long channelBytes; //!< [in/out] Realized amount of bytes per color channel int posX; //!< [out] X-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) int posY; //!< [out] Y-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) unsigned long bytesperPixel; //!< [in/out] Bytes per pixel and color (should be 1 or 2) unsigned long orientation; //!< [out] Flip conditions with respect to ::mex_orientation unsigned long exposuretime; //!< [out] exposure time - [microseconds} int colorMask; //!< [out] A value from enum ::mexColorMask unsigned __int64 timestamp; //!< [out] timestamp unsigned long user_index; //!< [in/out] instead of reserved[user_index] unsigned long HdNr; //!< Identifier, coming from frame header unsigned long Time[4]; //!< time stamps for logging purposes unsigned long reserved[4]; //!< Reserved for future use } 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?

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) (MEXIMGVERSION)

unsigned long Bytes; //!< [in] Amount of bytes of this struct (sizeof(mexImg)). int dimX; //!< [in/out] Horizontal pixel dimension of image int dimY; //!< [in/out] Vertical pixel dimension of image void* pBw; //!< [in/out] Pointer to memory for monochrome image or for the \link page27 DIB-format \endlink void* pRed; //!< [in/out] Pointer to memory for red image channel void* pGreen; //!< [in/out] Pointer to memory for green image channel void* pBlue; //!< [in/out] Pointer to memory for blue image channel int channels; //!< [in] to take from enum mex_channels unsigned int bitmask; //!< [out] Bitmask of significant bits in image pixel data unsigned long stdTicks; //!< [out] Realized exposure standard ticks unsigned long addTicks; //!< [out] Realized exposure additional ticks unsigned long channelBytes; //!< [in/out] Realized amount of bytes per color channel int posX; //!< [out] X-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) int posY; //!< [out] Y-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) unsigned long bytesperPixel; //!< [in/out] Bytes per pixel and color (should be 1 or 2) unsigned long orientation; //!< [out] Flip conditions with respect to ::mex_orientation unsigned long exposuretime; //!< [out] exposure time - [microseconds} int colorMask; //!< [out] A value from enum ::mexColorMask unsigned __int64 timestamp; //!< [out] timestamp unsigned long user_index; //!< [in/out] instead of reserved[user_index] unsigned long HdNr; //!< Identifier, coming from frame header unsigned long Time[4]; //!< time stamps for logging purposes unsigned long reserved[4]; //!< Reserved for future use } 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?

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 { tag_mexImg
{
unsigned long Version; //!< [in] Version, currently it must be 'V003' (MEXIMGVERSION)


unsigned long Bytes; //!< [in] Amount of bytes of this struct (sizeof(mexImg)). (sizeof(mexImg)).
int dimX; //!< [in/out] Horizontal pixel dimension of image image
int dimY; //!< [in/out] Vertical pixel dimension of image image
void* pBw; //!< [in/out] Pointer to memory for monochrome image or for the \link page27 DIB-format \endlink \endlink
void* pRed; //!< [in/out] Pointer to memory for red image channel channel
void* pGreen; //!< [in/out] Pointer to memory for green image channel channel
void* pBlue; //!< [in/out] Pointer to memory for blue image channel channel
int channels; //!< [in] to take from enum mex_channels mex_channels
unsigned int bitmask; //!< [out] Bitmask of significant bits in image pixel data data
unsigned long stdTicks; //!< [out] Realized exposure standard ticks ticks
unsigned long addTicks; //!< [out] Realized exposure additional ticks ticks
unsigned long channelBytes; //!< [in/out] Realized amount of bytes per color channel channel
int posX; //!< [out] X-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) runas_scan)
int posY; //!< [out] Y-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan) runas_scan)
unsigned long bytesperPixel; //!< [in/out] Bytes per pixel and color (should be 1 or 2) 2)
unsigned long orientation; //!< [out] Flip conditions with respect to ::mex_orientation ::mex_orientation
unsigned long exposuretime; //!< [out] exposure time - [microseconds} [microseconds}
int colorMask; //!< [out] A value from enum ::mexColorMask
unsigned __int64 timestamp; //!< [out] timestamp timestamp
unsigned long user_index; //!< [in/out] instead of reserved[user_index] reserved[user_index]
unsigned long HdNr; //!< Identifier, coming from frame header header
unsigned long Time[4]; //!< time stamps for logging purposes purposes
unsigned long reserved[4]; //!< Reserved for future use use
} 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; 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?

click to hide/show revision 4
No.4 Revision

updated 2014-02-23 03:38:19 -0600

berak gravatar image

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
{
tag_mexImg { unsigned long Version; //!< [in] Version, currently it must be 'V003' (MEXIMGVERSION)
(MEXIMGVERSION)<br> unsigned long Bytes; //!< [in] Amount of bytes of this struct (sizeof(mexImg)).
(sizeof(mexImg)).<br> int dimX; //!< [in/out] Horizontal pixel dimension of image
image<br> int dimY; //!< [in/out] Vertical pixel dimension of image
image<br> void* pBw; //!< [in/out] Pointer to memory for monochrome image or for the \link page27 DIB-format \endlink
\endlink<br> void* pRed; //!< [in/out] Pointer to memory for red image channel
channel<br> void* pGreen; //!< [in/out] Pointer to memory for green image channel
channel<br> void* pBlue; //!< [in/out] Pointer to memory for blue image channel
channel<br> int channels; //!< [in] to take from enum mex_channels
mex_channels<br> unsigned int bitmask; //!< [out] Bitmask of significant bits in image pixel data
data<br> unsigned long stdTicks; //!< [out] Realized exposure standard ticks
ticks<br> unsigned long addTicks; //!< [out] Realized exposure additional ticks
ticks<br> unsigned long channelBytes; //!< [in/out] Realized amount of bytes per color channel
channel<br> int posX; //!< [out] X-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan)
runas_scan)<br> int posY; //!< [out] Y-position code of a single image from an unassembled scan (::mexAcquisParams::runas = runas_scan)
runas_scan)<br> unsigned long bytesperPixel; //!< [in/out] Bytes per pixel and color (should be 1 or 2)
2)<br> unsigned long orientation; //!< [out] Flip conditions with respect to ::mex_orientation
::mex_orientation<br> unsigned long exposuretime; //!< [out] exposure time - [microseconds}
[microseconds}<br> int colorMask; //!< [out] A value from enum ::mexColorMask
<br> unsigned __int64 timestamp; //!< [out] timestamp
timestamp<br> unsigned long user_index; //!< [in/out] instead of reserved[user_index]
reserved[user_index]<br> unsigned long HdNr; //!< Identifier, coming from frame header
header<br> unsigned long Time[4]; //!< time stamps for logging purposes
purposes<br> unsigned long reserved[4]; //!< Reserved for future use
use<br> } mexImg;

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?

click to hide/show revision 5
retagged

updated 2014-02-23 03:39:08 -0600

berak gravatar image

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?