【问题标题】:MATLAB - Can someone please just explain what these lines of code doMATLAB - 有人可以解释一下这些代码行的作用吗
【发布时间】:2014-04-21 01:14:23
【问题描述】:

您好,有人可以帮我解决此代码,我知道它会读取图像并在 RGB 图像 (Fruits1) 的直方图上显示红色通道。

colourImage = imread('Fruits1.jpg');        //read image  
redHistogram = double(colourImage(:,:,1));  //what does this line do?  
figure, hist(redHistogram(:),124);          //what does this line do?

【问题讨论】:

    标签: matlab


    【解决方案1】:
    redHistogram = double(colourImage(:,:,1));  //what does this line do?
    

    这采用图像的红色平面并将每个像素强度从整数 (0-255) 转换为浮点值 (double)。结果是这些值的二维数组。

    figure, hist(redHistogram(:),124);          //what does this line do?
    

    从上方显示像素强度的直方图,分为 124 个大小相等的 bin。

    【讨论】:

      猜你喜欢
      • 2021-12-06
      • 2011-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-14
      • 2018-08-10
      • 2020-06-14
      • 2016-08-17
      相关资源
      最近更新 更多