traffic_count/image_filtering_debugging_C/edgeDetector.c
void edgeOverlapping (unsigned char *inputImage, unsigned char *edgeImage, unsigned char *outputImage, unsigned int width, unsigned int height)
{
    int i = 0, k = 0;
    for (i = 0; i < width * height; i++) {
        if (edgeImage[i] < THRESHOLD) {
            outputImage[i * 3] = edgeImage[i];
            outputImage[i * 3 + 1] = edgeImage[i];
            outputImage[i * 3 + 2] = edgeImage[i];
        }
        else
            for (k = 0; k < 3; k++)
                outputImage[i * 3 + k] = inputImage[i * 3 + k];
    }
}
/*Overlap edge images on the original one. The output is an RGB image. THRESHOLD macro is used for selecting pixels from the original image or the edge one*/
Overlap edge images on the original one. The output is an RGB image. THRESHOLD macro is used for selecting pixels from the original image or the edge one
Overlap edge images on the original one . The output is an RGB image . THRESHOLD macro is used for selecting pixels from the original image or the edge one
void edgeOverlapping (unsigned char *inputImage, unsigned char *edgeImage, unsigned char *outputImage, unsigned int width, unsigned int height)
{
    int i = 0, k = 0;
    for (i = 0; i < width * height; i++) {
        if (edgeImage[i] < THRESHOLD) {
            outputImage[i * 3] = edgeImage[i];
            outputImage[i * 3 + 1] = edgeImage[i];
            outputImage[i * 3 + 2] = edgeImage[i];
        }
        else
            for (k = 0; k < 3; k++)
                outputImage[i * 3 + k] = inputImage[i * 3 + k];
    }
}
void edgeOverlapping ( unsigned char * inputImage , unsigned char * edgeImage , unsigned char * outputImage , unsigned int width , unsigned int height ) { int i = 0 , k = 0 ; for ( i = 0 ; i < width * height ; i ++ ) { if ( edgeImage [ i ] < THRESHOLD ) { outputImage [ i * 3 ] = edgeImage [ i ] ; outputImage [ i * 3 + 1 ] = edgeImage [ i ] ; outputImage [ i * 3 + 2 ] = edgeImage [ i ] ; } else for ( k = 0 ; k < 3 ; k ++ ) outputImage [ i * 3 + k ] = inputImage [ i * 3 + k ] ; } }
Overlap edge images on the original one.
Overlap edge images on the original one .