• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

matlab将RGB三个通道的数据导入矩阵后 imshow的图像是错误的 出了什么问题?


Recommended Posts

问题的现象和背景

我用matlab提取了图像R、G、B三个通道的值,存储在txt文件中。然后,我用C语言处理txt的值,输出是三个txt文件,里面有720*1280的数据。然后我用matlab把三维数组M的R、G、B通道的数据存储成txt文件,最后我对M进行了imshow,但是显示的结果和预期的图像没有任何关系。

相关问题代码

全部关闭;

分隔符=“”;%分隔符是一个空格。

%R频道

filename=' sunset _ r _ pro.txt

R=importdata(文件名,分隔符);%将R通道数据导入矩阵R。

%G频道

filename=' sunset _ g _ pro.txt

G=importdata(文件名,分隔符);%将G通道数据导入矩阵G。

%B频道

filename=' sunset _ b _ pro.txt

B=importdata(文件名,分隔符);%将通道B数据导入矩阵B。

m(:1)=R;

m(:2)=G;

m(:3)=B;

im show(m);

运行结果

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now