Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17
Image Processing Using C
By:-Anuj Kumar Singh
Welcome to the presentation… Contents:- Format of image used. Get the details of an image. Return pixel value. Set pixel value. Color image to gray image. Average gray level. Gray image to binary image. Crop an image. Reflect an image. Filters to enhance the image quality. Image morphing. Change detection. Negative of an image. Rotate an image by 90,180 and 270 degree. Format of image used
A PGM file is a gray scale image file saved in the portable
gray map (PGM) format and encoded with one or two bytes (8 or 16 bits) per pixel. It contains header information and a grid of numbers that represent different shades of gray from black (0) to white (up to 65,536). PGM files are typically stored in ASCII text format, but also have a binary representation. PGM files include a header that defines the PGM format type ("P2" for text or "P5" for binary), image width and height, and the maximum number of shades. While binary PGM files may contain multiple images, ASCII PGM files may only include one image. Get the details of an image From this function we can simply know the details of an image such as its height and width and maximum pixel value of an image. Return pixel value This function simply return the pixel value of a particular row and column in an image. Set pixel value From this function we can change the pixel value of a particular row and column in an image and save the image to a new one. Color image to gray image When converting an RGB image to gray scale , we have to take the RGB values for each pixel and make as output a single value reflecting the brightness of that pixel. One such approach is to take the average of the contribution from each channel: (R+B+C)/3. Given below is an example: Average gray level This function simply return the average gray level of an image by adding all the pixel value and dividing it by no of pixel. Gray image to binary image This function converts the gray scale image to binary image, by replacing all pixels in the input image with luminance greater than level with the value 1 (white) and replacing all other pixels with the value 0 (black). Given below is an example: Crop an image Cropping an image extracts a rectangular region of interest from the original image. This focuses the viewer's attention on a specific portion of the image and discards areas of the image that contain less useful information. Using image cropping in conjunction with image magnification allows you to zoom in on a specific portion of the image. This section describes how to exactly define the portion of the image you wish to extract to create a cropped image. Given below is an example of image cropping. Reflect an image This function is used to reflect an image in horizontal or vertical directions. Given below is an example of image reflection in vertical and horizontal direction. Filters to enhance the image quality Image enhancement is the desired improvement of image quality. Image enhancement is the process of adjusting digital images so that the results are more suitable for display or further image analysis. For example, you can remove noise, sharpen, or brighten an image, making it easier to identify key feature. Given below is the example of sharpen of image. Image morphing/Change detection These are the term most people use today to describe the melting of one object to another. Morphing is a sequence of images not a single image. A car becomes a tiger by showing a sequence of intermediate images. For example, when morphing between faces, the middle "face" often looks strikingly "life-like" but is neither the first nor the second person in the image. Change detection is simply the difference between two images. Given below is the example of image morphing and change detection. Negative of an image A positive image is a normal image. A negative image is a total inversion, in which light areas appear dark and vice versa. A negative color image is additionally color- reversed with red areas appearing cyan, greens appearing magenta, and blues appearing yellow, and vice versa. Example-the two images are of a boy with one being the negative of the other. Rotate an image by 90,180 and 270 degree When referring to an image or image editor rotate is a feature that allows you to turn an image in a clockwise or counterclockwise direction. For example, many editors allow you to rotate images 90, 180, or 270. Below is an example of the Computer Hope logo and what it would look like rotated at 90, 180, and 270-degrees clockwise.\ Example : Image rotated by 90 degree. Thank you… See you soon…