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中z阶玫瑰图_Matlab_Image Processing_Plot - Fatal编程技术网

matlab中z阶玫瑰图

matlab中z阶玫瑰图,matlab,image-processing,plot,Matlab,Image Processing,Plot,我需要绘制图片的2d直方图。 图片在HSL系统中。 在HSl系统中,使用饱和度和亮度代替红、绿、蓝 元素的范围包括: 色调[0360] 饱和[01100] 亮度[01100] 我将图像从RGB转换为HSL。现在我想在HSL颜色系统中绘制图像的圆形直方图 我想要这样的东西: 基于像素的色调量、从中心到周长的饱和度[0 100]以及z顺序上具有特定色调和饱和度的像素数,从0到360的圆形周围的色调 例如,如果我们有250个像素,它们的色调=90,饱和度=50 点与原点成90度角,与圆心的距离为

我需要绘制图片的2d直方图。 图片在HSL系统中。 在HSl系统中,使用饱和度和亮度代替红、绿、蓝

元素的范围包括:

  • 色调[0360]
  • 饱和[01100]
  • 亮度[01100]
我将图像从RGB转换为HSL。现在我想在HSL颜色系统中绘制图像的圆形直方图

我想要这样的东西:

基于像素的色调量、从中心到周长的饱和度[0 100]以及z顺序上具有特定色调和饱和度的像素数,从0到360的圆形周围的色调

例如,如果我们有250个像素,它们的色调=90,饱和度=50
点与原点成90度角,与圆心的距离为50度,z轴上的值为250。

因为我不太喜欢Matlab的极坐标绘图仪,所以我通常将其写成笛卡尔坐标。假设您将这些(计数、色调、饱和度)存储为列向量:

hue = 90;
saturation = 50;
count = 250;
x = saturation * cos(pi * hue / 180);
y = saturation * cos(pi * hue / 180);
plot3(x, y, count, '.')
有关更实际的示例:

hue = floor(rand(1000,1) * 361);
saturation = floor(rand(1000,1) * 100);
vals = [hue, saturation];
sorted = sortrows(vals);
[C, ia, ic] = unique(sorted, 'rows');
counts = diff(ia);
counts(end + 1) = ia(end) - length(vals) + 1;
% Not a big fan of this method so changed to find counts
% by pre-sorting and then using the index
%[C, ia , ic] = unique(vals, 'rows');
%counts = zeros(length(C), 1);
%for x = 1:length(C)
%    counts(x) = numel(find(vals(:,1) == C(x,1) & vals(:,2) == C(x,2)));
%end
x = C(:,2) .* cos(pi*C(:,1)/180);
y = C(:,2) .* sin(pi * C(:,1)/180);
plot3(x, y, counts, '.')

有一种方法可以根据z值更改颜色,如果您需要的话,但这会变得更复杂一些。您可以使用网格和等高线,或者此文件将对其进行打印。

您是否尝试使用
rose
?在您最初的问题中,图像没有链接,Erik不知怎的注意到了不可见的链接,并修复了它。有了这些信息,我认为
rose
不是正确的选择。我投票重新打开这个问题,现在你想要什么已经很清楚了。我应该怎么做才能打开这个问题???当其他4个用户投票重新打开时,这个问题就重新打开了。