用C语言进行BMP图像二值化,显示其长宽,最好有解释*/

[复制链接]
查看11 | 回复1 | 2010-1-11 15:50:25 | 显示全部楼层 |阅读模式
#includevoid whiteblack(int *selimage, int height, int width, int *twovalimage){int indexh,indexw; int val1=0,val2=255; //求取阀值 for(indexh=0; indexhval1)
val1 =*(twovalimage + width*indexh + indexw);//val1:maxvalue} val1 = val1 - (val1 - val2)/3;
//calculate limit value //二值化 for(indexh=0; indexh < height; indexh++)for(indexw=0; indexw < width; indexw++){ /*tr=*(selimage + width*indexh + indexw);
*(twovalimage + width*indexh + indexw)=tr;*/ if(*(selimage + width*indexh + indexw) <20)
{
*(twovalimage + width*indexh + indexw) = 0;
} else
*(twovalimage + width*indexh + indexw) = 255;}}
回复

使用道具 举报

千问 | 2010-1-11 15:50:25 | 显示全部楼层
CImage image;
//加载BMGimage.Load(L"");
//宽image.GetWidth();
//byte 字节 二进制image.GetBits();
//高image.GetHeight();
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行