【发布时间】:2020-02-24 13:19:37
【问题描述】:
我目前正在努力解决图像处理\数据绘图问题,并希望在这件事上从比我更有经验的人那里获得一些反馈。
我会尝试分解问题以使其更容易理解:
我有一个大小为 NxM 的原始图像(figureB - 这是原始图像的蓝色通道),我从该图像中选择一个特定区域进行研究(NewfigureB ),尺寸 120x170;
然后我将这个区域划分为我所谓的宏像素,它们是 10x10 的数据点(像素)阵列;
然后我将蒙版应用到选定区域以仅选择满足某些发光条件的点;
到目前为止一切顺利。当我在应用发光蒙版时尝试绘制每个宏像素的直方图时,我的问题就出现了。最终目标是找到这些直方图中的峰值。
到目前为止,这就是我想出的。任何帮助将不胜感激。
非常感谢
%Make the number of pixels in the matrix divisible
Macropixel = 10; %determine the size of the macropixel
[rows,columns] = size(figureB); %determine dimentions of the matrix used in the calculations
MacropixRows = floor(rows/Macropixel); %determine how many macropixels are in a row of the original matrix
MacropixColumn = floor(columns/Macropixel); %determine how many macropixels are in a column of the original matrix
%define new dim for the matrix
rows = MacropixRows * Macropixel;
columns = MacropixColumn * Macropixel;
NewfigureB = figureB(1:rows,1:columns); %divisible by the size of the macropixels created
%select area
NewfigureB = NewfigureB(1230:1349,2100:2269);
%create luminescence mask
Lmin=50;
hmax=80;
mask=false(size(NewfigureB));
mask(NewfigureB <Lmin)=true;
mask=mask & (NewfigureB<hmax);
%Apply mask
NewfigureB=NewfigureB(mask);
for jj = 1:Macropixel:120
for ii =1:Macropixel:170
histogram( NewfigureB(jj:jj+Macropixel-1, ii:ii+Macropixel-1))
end
end'''
【问题讨论】:
-
请添加原始图片的链接。
-
@Hoki 我用这个作为案例研究:google.com/…:
标签: matlab image-processing histogram