matlab车道线检测分析和总结.docxVIP

  • 7
  • 0
  • 约4.63千字
  • 约 8页
  • 2022-09-20 发布于上海
  • 举报
实用标准文档 clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%读图最后得到灰度图像rg A=imread(999.png); [r c d]=size(A); r2g=zeros(r,c); red=zeros(r,c); green=zeros(r,c); blue=zeros(r,c); rg=zeros(r,c); for i=1:r; for j=1:c; red(i,j)=A(i,j,1);%提取图像的红色分量green(i,j)=A(i,j,2);%提取图像的绿色分量blue(i,j)=A(i,j,3);%提取图像的蓝色分量 end end for i=1:r; for j=1:c; rg(i,j)=0.5*red(i,j)+0.5*green(i,j); end end rg=uint8(rg); for i=1:r; for j=1:c; if rg(i,j)178; rg(i,j)=255; end  end end figure; subplot(2,2,1);imshow(A);title(原图)% 显示原图像 subplot(222);imshow(rg);title(彩色通道提取法-灰度图); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 文案大全

文档评论(0)

1亿VIP精品文档

相关文档