Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using External image data in a MAT

I am working on integrating some OpenCV functionality into an existing application that passes data around with pointers. What I want to do is wrap a Mat around the existing data, use some OpenCV functions, then let the data go when I'm done. However, the program is time-sensitive, and I would like to avoid making any copies of the data.

I see a few options. First, is there anything equivalent to Eigen's Map<arrayxxd> that does exactly what I want? Secondly, can I simply re-assign Mat's ptr, width, and height variables, then put them back when I'm done? Or is there a different option?

Thank you for your help.

click to hide/show revision 2
No.2 Revision

updated 2013-02-28 02:25:37 -0600

SR gravatar image

Using External external image data in a MAT

I am working on integrating some OpenCV functionality into an existing application that passes data around with pointers. What I want to do is wrap a Mat around the existing data, use some OpenCV functions, then let the data go when I'm done. However, the program is time-sensitive, and I would like to avoid making any copies of the data.

I see a few options. First, is there anything equivalent to Eigen's Map<arrayxxd> that does exactly what I want? Secondly, can I simply re-assign Mat's ptr, width, and height variables, then put them back when I'm done? Or is there a different option?

Thank you for your help.

click to hide/show revision 3
clarified

updated 2013-02-28 02:26:03 -0600

SR gravatar image

Using external image data in a MATcv::Mat

I am working on integrating some OpenCV functionality into an existing application that passes data around with pointers. What I want to do is wrap a Mat around the existing data, use some OpenCV functions, then let the data go when I'm done. However, the program is time-sensitive, and I would like to avoid making any copies of the data.

I see a few options. First, is there anything equivalent to Eigen's Map<arrayxxd> that does exactly what I want? Secondly, can I simply re-assign Mat's ptr, width, and height variables, then put them back when I'm done? Or is there a different option?

Thank you for your help.