【Matlab】 RGB照片转化成灰度图叠加显示
2014-12-16 17:03
260 查看
两张图片lena.png和fiona.jpg转化为灰度图像叠加显示
遇到问题
Error using reshapeTo RESHAPE the number of elements must not change.
help reshape可知
reshape(X,M,N,P,...) returns an N-D array with the same elements as X but reshaped to have the size M-by-N-by-P-by-...M*N*P*... must be the same as PROD(SIZE(X)).
修改reshape那行代码:
I3 = reshape(y,size(A2));
两张图片lena.png和fiona.jpg转化为灰度图像叠加显示
%overlap two pictures %read pic lena I1 = imread('lena.png'); A1 = rgb2gray(I1); a1 = double(A1(:)); %read pic fiona I2 = imread('fiona.jpg'); A2 = rgb2gray(I2); a2 = double(A2(:)); A=[a1 a2]; x = rand(2,1);%transparency y = A*x; %adjust to the size like I2 I3 = reshape(y,size(I2)); %show pic figure, imshow(I3,[]);
遇到问题
Error using reshapeTo RESHAPE the number of elements must not change.
help reshape可知
reshape(X,M,N,P,...) returns an N-D array with the same elements as X but reshaped to have the size M-by-N-by-P-by-...M*N*P*... must be the same as PROD(SIZE(X)).
修改reshape那行代码:
I3 = reshape(y,size(A2));
相关文章推荐
- matlab RGB图转灰度图
- RGB图像转灰度图(Matlab、OpenCV、Java实现)(一)
- 读取yuv并转化为RGB数据在Opencv中打开显示
- 用matlab读取位图并以灰度图的方式显示
- 用MATLAB将RGB图像中的显示为相同颜色的像索点提取出来
- python使用opencv将灰度图人脸图片转化为RGB
- 读取yuv并转化为RGB数据在Opencv中打开显示
- RGB转化灰度图公式
- Matlab之索引图像转化为灰度图和真彩图
- 【转】使用matlab软件打开一幅图片并且分别提取其中的RGB分量并显示
- 利用OpenCV和C++实现由RGB图像转化为灰度图,再将灰度图转化为二值图的程序
- matlab rgb通道的图像显示
- Matlab 图像像素点在RGB空间的显示
- 读取yuv并转化为RGB数据在Opencv中打开显示
- 读取yuv并转化为RGB数据在Opencv中打开显示
- opencv将灰度图转化为RGB三通道图像
- matlab 彩色图和热力图叠加显示
- MATLAB 矩阵转化为灰度图
- 使用MATLAB对数据进行位操作以及RGB图片显示
- 利用matlab编写实现显示fmri切片slice图像 混合显示 不同侧面显示 可叠加t检验图显示 by DR. Rajeev Raizada