[問題]影像fprintf 問題已回收
由於最近要分析一張圖 每個點的RGB值
所以小弟自學matlab(它實在太強大了)
不過在輸出txt檔 有一些問題
其實我想要輸出 為
8h0_0 :R=ff
8h0_0 :G=ff
8h0_0 :B=ff
8h0_1 :R=ff
8h0_1 :G=ff
8h0_1 :B=ff
.
.
.
.
可是在 8h0_0 :R=ff 和 8h0_0 :G=ff 中間 都會出現一堆 8h3f_3f :R=3f
....之類的數值
可是感覺 那是多存進去的 但不知道為什麼 會存這些進去
希望大家可以幫我找出問題 感謝
以下附程式碼
clear all;
%load my.bmp;
in_image = imread('in.bmp');
%figure,imshow(x),pixvel on
size(in_image);
in_image_txt = fopen('a.txt', 'w');
for v = 0:15,
for h = 0:15,
for color = 1:3,
if(color==1),
n1=in_image(:,:,color) ;
fprintf(in_image_txt, '8h%hx_%hx :R=%hx \r\n',v,h,n1);
end
if(color==2),
n2=in_image(:,:,color) ;
fprintf(in_image_txt, '8h%hx_%hx :G=%hx \r\n',v,h,n2);
end
if(color==3),
n3=in_image(:,:,color);
fprintf(in_image_txt, '8h%hx_%hx :B=%hx \r\n',v,h,n3);
%fprintf(in_image_txt,'\r\n');
end
end
end
end
fclose(in_image_txt);
type a.txt
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.224.152
→
05/07 19:10, , 1F
05/07 19:10, 1F
→
05/07 19:10, , 2F
05/07 19:10, 2F
→
05/07 19:13, , 3F
05/07 19:13, 3F
→
05/07 19:17, , 4F
05/07 19:17, 4F
→
05/07 19:17, , 5F
05/07 19:17, 5F
→
05/07 19:18, , 6F
05/07 19:18, 6F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):