Example C Programs
- [colourmanipulation.c] This program reads in a colour image (.pgm file) and shows how the individual RGB components can be accessed and manipulated.
- [threshold.c] This program converts a gray level image into a bilevel image by thresholding.
- [ulta.c] This program turns the image upside down.
- [sobel.c] This program implements the Sobel edge operator.
- [connectivity.c] This program finds the four connected objects in a bilevel image. In the original image all objects should have pixel value 255. In the output image each object has been identified with a distinct pixel value. Connected component analysis is a very important tool in image processing. When looking for an object how do you decide which all pixels lie in the object? Connectivity as you know can be of the 4 or 8 type. In different applications it may be necessary to prefer one over the other. You can easily add four more directions of search in the code given above to do 8-connected labelling.
BACK