Dev*_*Dev 2 matlab image-processing
我有uint8类的RGB图像大小(2048X3072X3),我想规范化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
Run Code Online (Sandbox Code Playgroud)
但是在归一化之后,图像x的尺寸为6291456x1而不是2048X3072.
任何人都可以告诉我如何才能获得2048X3072尺寸的标准化图像?
试试这个:
x = double(Image_green);
m = mean(x(:));
s = std(x(:));
x = (x - m) / s; % normalization of green channel
Run Code Online (Sandbox Code Playgroud)