【问题标题】:Normalization of image图像归一化
【发布时间】:2012-11-14 22:46:29
【问题描述】:

我有 uint8 类的大小 (2048X3072X3) 的 RGB 图像,我想标准化 RGB 图像的绿色和红色通道。我写了以下代码:

      Image_rgb=imread('RGB.jpg');   %Reading RGB image
      Image_red = Image_rgb(:,:,1);   %Reading R channel of  image
      Image_green = Image_rgb(:,:,2); %Reading G channel of  image
      x = double(Image_green(:));  
      m = mean(x);  
      s = std(x);
      x = (x - m) / s;   % normalization of green channel

但在标准化后,图像 x 的尺寸为 6291456x1,而不是 2048X3072。

谁能告诉我如何获得 2048X3072 尺寸的标准化图像?

【问题讨论】:

    标签: matlab image-processing


    【解决方案1】:

    试试这个:

      x = double(Image_green);  
      m = mean(x(:));  
      s = std(x(:));
      x = (x - m) / s;   % normalization of green channel
    

    【讨论】:

    • 太棒了!您可以将此标记为答案吗?
    猜你喜欢
    • 2015-09-05
    • 2015-01-12
    • 2015-01-15
    • 2015-08-04
    • 1970-01-01
    • 1970-01-01
    • 2017-05-12
    • 2016-12-18
    相关资源
    最近更新 更多