Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 请引导我分割图像_Matlab_Image Processing - Fatal编程技术网

Matlab 请引导我分割图像

Matlab 请引导我分割图像,matlab,image-processing,Matlab,Image Processing,我想将图像分为三部分,以下是我尝试的内容: [filename pathname]=uigetfile'*.png','Pick the image file'; file=strcatpathname,文件名; I=imreadfile; 图,imshowI; 标题“输入图像”; im1=I; su=medianim1; 中位数=ceilsu; [行,列]=四子; %mr=中速/2;%行中位数 mc=mediancol/3;%立柱中间带 右=I1:mr,mc+1:col; 图,imshowri

我想将图像分为三部分,以下是我尝试的内容:

[filename pathname]=uigetfile'*.png','Pick the image file'; file=strcatpathname,文件名; I=imreadfile; 图,imshowI; 标题“输入图像”; im1=I; su=medianim1; 中位数=ceilsu; [行,列]=四子; %mr=中速/2;%行中位数 mc=mediancol/3;%立柱中间带 右=I1:mr,mc+1:col; 图,imshowright 我本以为这会将图像分成三部分,但它被分成右上角和左上角,并创建镜像

这是我需要分为三部分的图像,但它应该是单个图像:

可以使用将图像分割为所需的任意多个分割:

img = imread('https://i.stack.imgur.com/s4wAt.png');
[h w c] = size(img);
numSplits = 3;  % how many splits you want
sw = floor(w/numSplits);  % width of split 
widths = repmat(sw, 1, numSplits-1);
widths(numSplits) = w - sum(widths);  % last one is bit wider if width does not divide
splits = mat2cell(img, h, widths, c);  % this splits the image

% show the splits
for ii=1:numSplits 
   subplot(1,numSplits,ii);
   imshow(splits{ii});
end
结果与

当你做中位数=ceilsu;覆盖中值函数,使其不再可访问。你不应该这样做。如果第二次运行脚本,它将执行与第一次不同的操作。找一个不同的名字!我已删除中位数=ceilsu;这个命令,然后仍然工作,我得到错误。。请帮忙。。如何将图像分成三部分我不知道。我想分割血样的图像我不想我的评论来回答你的问题,它只是一个旁白,希望能帮助你的良好做法。关于此图像:是否要拆分这三个样本中的每一个?它们在图像中的放置是否一致?序列中的所有图像是否都非常一致,或者是否必须根据图像内容计算分割?你是什么意思,但它应该是单一的图像?所有的图像系列。。。。我想把图片分成三部分…不是一张图片。。。!!!我想计算三滴血中的一滴血的面积和平均值,比如凝固的和未凝固的。我需要将分割的图像转换为gary彩色图像,那么如何转换该图像。这是我的代码…但我得到了错误。im2=图像分割{ii};imshowim2;%%%灰度转换a=rgb2grayim2;图,imshowa;标题“灰度转换图像”@StellaJoseph请将其作为一个新问题发布,你能指导我将此图像拆分为3个单独的图像吗