Image processing 使用Matplot显示uint16矩阵的超矩阵
我正试图在Scilab中编写一个函数来显示图像。 我将图像处理为矩阵列表,然后将列表转换为函数中的超矩阵。但是,代码似乎不适用于uint16或uint32类型的图像。 这是我一直在研究的代码: imshow() show() 我得到的错误是:Image processing 使用Matplot显示uint16矩阵的超矩阵,image-processing,matrix,scilab,Image Processing,Matrix,Scilab,我正试图在Scilab中编写一个函数来显示图像。 我将图像处理为矩阵列表,然后将列表转换为函数中的超矩阵。但是,代码似乎不适用于uint16或uint32类型的图像。 这是我一直在研究的代码: imshow() show() 我得到的错误是: !--error 202 Matplot: Wrong type for input argument #1: A real or integer expected. at line 22 of function show ca
!--error 202
Matplot: Wrong type for input argument #1: A real or integer expected.
at line 22 of function show called by :
at line 67 of function imshow called by :
imshow(a);
任何帮助都会很好。似乎OpenCV和matplotlib都不支持uint16或uint32的imshow,因此图像在显示时将转换为uint8。似乎OpenCV和matplotlib都不支持uint16或uint32的imshow,因此,图像在显示时将转换为uint8。请在此处添加代码,而不是链接到外部源。您的意思是:“代码似乎不适用于uint16或uint32类型的图像。”您是否有特定的错误消息?是的,我有。我将编辑原始帖子。请在此处添加代码,而不是链接到外部源。您所说的“代码似乎不适用于uint16或uint32类型的图像”是什么意思。您是否有特定的错误消息?是的,我有。我将编辑原始帖子。
function[] =show(Img,ColorMap)
FigureHandle = gcf();
drawlater();
FigureHandle.color_map = ColorMap
FigureHandle.background = -2; // sets the background to white
FigureHandle.figure_name = "Title";
[NumberOfRows NumberOfColumns] = size(Img);
FigureHandle.axes_size = [NumberOfColumns NumberOfRows];
delete(gca()); // previous image is deleted
Diagram = gca();
[NumberOfRows NumberOfColumns] = size(Img);
Diagram.data_bounds = [1, 1; NumberOfColumns, NumberOfRows];
Diagram.axes_visible = ['off' 'off' 'off'];
Diagram.isoview = 'on';
Options = '082'; // Box is drawn around image.
//printf("\nGiven to Matplot: "); //DEBUG:
//printf(typeof(Img)); //DEBUG:
Matplot(Img, Options);
drawnow();
endfunction
!--error 202
Matplot: Wrong type for input argument #1: A real or integer expected.
at line 22 of function show called by :
at line 67 of function imshow called by :
imshow(a);