?? threshold_mid.cpp
字號:
//--------------------------------
// hustxdp 2007/10/30 16:10
//--------------------------------
//#include "stdAfx.h"
/*--threshold_mid----雙閾值二值化處理-----------------
image_in : 輸入圖象數據指針
image_out : 輸出圖象數據指針
xsize : 圖象寬度
ysize : 圖象高度
thresh_low : 低閾值(0~255)
thresh_high: 高閾值(0~255)
----------------------------------------------------*/
const int HIGH=255;
const int LOW=0;
void threshold_mid(BYTE *image_in, BYTE *image_out, int xsize, int ysize, int threshold_low, int threshold_high)
{
int i,j;
for (j = 0; j < ysize; j++)
{
for (i = 0; i < xsize; i++)
{
if(*(image_in +j*xsize +i)>=threshold_low && *(image_in +j*xsize + i)<=threshold_high)
*(image_out + j*xsize + i) = HIGH;
else
*(image_out + j*xsize + i) = LOW;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -