- 最後登錄
- 2023-2-26
- 在線時間
- 85 小時
- 註冊時間
- 2010-12-16
- 閱讀權限
- 20
- 精華
- 0
- UID
- 9106600
- 帖子
- 132
- 積分
- 177 點
- 潛水值
- 15932 米
| 或是把這篇MATLAB改成C語言 這是我的程式碼
c=imread('rice.png');
c2=double(c).*(x/2+50)+(1-double(c)).*x/2;
x=ones(256,1)*[1:256];
c3=uint8(255*mat2gray(c2));
t=graythresh(c3)
ct=im2bw(c3,t);
p1=c3(:,1:64);
p2=c3(:,65:128);
p3=c3(:,129:192);
p4=c3(:,193:256);
g1=im2bw(p1,graythresh(p1));
g2=im2bw(p2,graythresh(p2));
g3=im2bw(p3,graythresh(p3));
g4=im2bw(p4,graythresh(p4));
imshow([g1 g2 g3 g4]) ... |
|