变量T
和总是大于 0,max_gray
是一个存储 0-255 值的向量。如果可能,请解释原因,因为它在 CodeBlocks 中似乎可以正常工作,但这对我来说没有意义,因为它们来自不同的类型:一种是,另一种是.qtd_px
numeros_px
unsigned char
unsigned char
int
void filtro(unsigned char *numeros_px, int qtd_px, int T, int max_gray){
int i;
for(i=0; i<qtd_px; i++){
if(numeros_px[i]>= T) numeros_px[i]=max_gray;
else numeros_px[i]=0;
}
}