traffic_count/image_filtering_debugging_C/edgeDetector.c
void rgb2grey (unsigned char *inputImage, unsigned char *outputImage, unsigned int height, unsigned int width)
{
    int i = 0;
    for (i = 0; i < width * height; i++) {
        outputImage[i] = (unsigned char) ((30 * inputImage[i * 3] + 59 * inputImage[i * 3 + 1] + 11 * inputImage[i * 3 + 2]) / 100); //(0.3*inputImage[i*3] + 0.59*inputImage[i*3+1] + 0.11*inputImage[i*3+2]);
        outputImage[i] = 255 - outputImage[i];
    }
}
/*Translate an image from RGB to gray scale*/
Translate an image from RGB to gray scale
Translate an image from RGB to gray scale
void rgb2grey (unsigned char *inputImage, unsigned char *outputImage, unsigned int height, unsigned int width)
{
    int i = 0;
    for (i = 0; i < width * height; i++) {
        outputImage[i] = (unsigned char) ((30 * inputImage[i * 3] + 59 * inputImage[i * 3 + 1] + 11 * inputImage[i * 3 + 2]) / 100); 
        outputImage[i] = 255 - outputImage[i];
    }
}
void rgb2grey ( unsigned char * inputImage , unsigned char * outputImage , unsigned int height , unsigned int width ) { int i = 0 ; for ( i = 0 ; i < width * height ; i ++ ) { outputImage [ i ] = ( unsigned char ) ( ( 30 * inputImage [ i * 3 ] + 59 * inputImage [ i * 3 + 1 ] + 11 * inputImage [ i * 3 + 2 ] ) / 100 ) ; outputImage [ i ] = 255 - outputImage [ i ] ; } }
Translate an image from RGB to gray scale
Translate an image from RGB to gray scale
//(0.3*inputImage[i*3] + 0.59*inputImage[i*3+1] + 0.11*inputImage[i*3+2]);
