public static Mat HObjectToMat(HObject hobj)
{
try
{
Mat pImage;
HTuple htChannels;
HTuple cType = null;
HTuple width, height;
width = height = 0;
htChannels = null;
HOperatorSet.CountChannels(hobj, out htChannels);
if (htChannels.Length == 0)
{
return null;
}
if (htChannels[0].I == 1)
{
HTuple ptr;
&n