<div dir="ltr"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="margin:0in 0in 0.0001pt">Greetings! Hope everyone is having a good day...</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">So... we are passing around a grayscale image... and we're using unsigned in (as opposed to unsigned char):</div><div style="margin:0in 0in 0.0001pt"><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">typedef itk::Image<unsigned int, ImageDimension> itkUIntImageType;</font></div><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">typedef itkUIntImageType itkLabelImageType;
</font></div></div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">I need to convert it to cv::Mat in order to pass it to another program:</div><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">cv::Mat resultImage = itk::OpenCVImageBridge::ITKImageToCVMat< itkLabelImageType >( m_objectLabelImage );<br></font></div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">The problem is, the compiler is telling me "OpenCV does not support the input pixel type".</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">So my question is -- is this true? Can I only convert from unsigned char?</div><div style="margin:0in 0in 0.0001pt">Would a good solution be to:</div><div style="margin:0in 0in 0.0001pt">A) Convert from one pixel type to another, or</div><div style="margin:0in 0in 0.0001pt">B) Or can I just read in the <span style="font-family:monospace,monospace">m_objectLabelImage</span> to an Image::Pointer thing that is of type unsigned char?</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">Thanks!</div><div style="margin:0in 0in 0.0001pt"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>