MATLAB RGB to Gray
来源:互联网 发布:青果教育网络管理系统 编辑:程序博客网 时间:2024/05/02 00:17
function fenceng;img = imread('C:\Users\anyka001\Desktop\IMG_2696.JPG');[rows cols colors] = size(img);img_gray = zeros(rows,cols);img_gray = uint8(img_gray); %把申请的空数组的double转换成uint8for x=1:rows for y=1:cols sum = 0; for k=1:3 sum=sum+img(x,y,k)/3; end img_gray(x,y)=sum; endendimshow(img_gray);[row col] = size(img_gray);img_bit =zeros(row,col);img_bit = uint8(img_bit);for bit=1:8 threshold = 2^bit; for x=1:row for y=1:col if img_gray(x,y)< threshold && img_gray(x,y)>=(threshold/2) %采用阈值判定的办法 卓个PIxel进行判断 img_bit(x,y) = img_gray(x,y); else img_bit(x,y) = 0; end end end figure,imshow(img_bit);end
阅读全文
0 0
- MATLAB RGB to Gray
- RGB to gray
- RGB to Gray
- RGB to Gray
- RGB to Gray 高效算法
- RGB to Gray 流行算法
- RGB to Gray 流行算法
- (转) RGB to Gray 流行算法
- matlab图像处理之RGB转Ycbcr or gray
- RGB与Gray
- MATLAB rgb
- RGB565 to gray
- arm neon RGB转Gray的例子
- OpenCV简单操作-RGB转gray
- Colorization, Gray, Color-to-Gray, Color Models
- Colorization, Gray, Color-to-Gray, Color Models
- 【MATLAB】RGB,HSV,LAB
- matlab读取RGB数据
- X-frame-options头为设置
- java urldecode笔记
- C#——面向对象——静态成员和静态类——静态成员
- 程序员:如何写出杀手级简历
- Android数据库sqlite基本使用增、删、改、查
- MATLAB RGB to Gray
- 【Bootstrap】表格的CSS布局
- java.math.RoundingMode 几个参数详解
- poll
- linux crontab & 每隔10秒执行一次
- Java压缩技术(三) ZIP解压缩——Java原生实现
- web.xml 配置中classpath: 与classpath*:的区别 web.xmlclasspath:classpath*: 首先 classpath是指 WEB-INF文件夹下的clas
- solr Java测试
- 网页音乐播放器