createimage.m

来自「matlab 代码为图像的分割」· M 代码 · 共 21 行

M
21
字号
function newim = createimage( im, phi )
% CREATEIMAGE Return segmented image as 3 channel uint8 image
%    CREATEIMAGE( im, phi ) Draws the segmented region in green
%    overtop of the original image im. The region is determined by
%    finding the front points from phi

% copy overpixels to red and blue channels of new image
newim( :, :, 1 ) = im;
newim( :, :, 3 ) = im;

% copy over pixels to a temporary image and outline pixels of the
% segmented region
tempim = im;
tempim( find( isfront( phi ) ) ) = 255;

% copy over pixels into green channel
newim( :, :, 2 ) = tempim;

% convert to uint8
newim = uint8( newim );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?