2019-07-21 03:48发布
DreamWaterPro 发表于 2017-12-4 19:48 咦,我倒是觉得可能是这样的情况,摄像头输出的图像是按照行输出的,比方说是320个像素;但是在MATLAB上 ...
最多设置5个标签!
非常感谢您的回复,根据您的建议,我又检查了一遍我的MATLAB程序,发现确实像素颠倒了,但我调过来之后却依然没有清晰的图像
str3 = textread('565.txt','%s','delimiter',',');%从txt文件中读取图像的16进制数据
str4 = dec2bin(hex2dec(str3),16); % 转换成二进制数据
%将RGB565格式转换成RGB24
R = reshape(bin2dec(str4(:,1:5)),320,240); % R,从rgb565数据中取出R数据
R = uint8(bitshift(R',3));
G = reshape(bin2dec(str4(:,6:11)),320,240); % G,从rgb565数据中取出G数据
G = uint8(bitshift(G',2));
B = reshape(bin2dec(str4(:,12:16)),320,240); % B,从rgb565数据中取出B数据
B = uint8(bitshift(B',3));
im = cat(3,R,G,B); % combine RGB
imshow(im,[]); % show, custom[/mw_shl_code]
这是我从网上找到的matlab程序,已经更正为320×240的显示程序,原本为240×320的。
一周热门 更多>