Image Processing basics and Java by msz78385


									Image Processing
 basics and Java
     Image Representation
Digital Images are 2D arrays (matrices) of
     Image Representation
Each pixel is a measure of the brightness
(intensity of light)
     Digital Image Properities
Each pixel is a measure of the brightness
(intensity of light)
   An image consists of a rectangular array of dots
    called pixels.
   The size of the image is usually specified as width X
    height (in numbers of pixels)
   The physical size of the image, in inches or
    centimeters or whatever, depends on the resolution of
    the device on which the image is displayed.
    Resolution is usually measured in terms of DPI, which
    stands for dots per inch
     Digital Image Properities
   An image will appear smaller (and generally sharper)
    on a device with a higher resolution than on one with
    a lower resolution.
Image Depth / Bitplanes
   The number of bits per pixel is sometimes called the
    depth of the image, or the number of bitplanes.
   For a black and white image there are only two
    choices --- each pixel is either black or white --- so
    one bit of information is all that is needed for each
       Such images are sometimes called 1-bit, or monochrome
     Digital Image Properities
   For color images, one needs enough bits per
    pixel to represent all the colors in the image.
   A number consisting of n bits can have 2^n
    different values, so an image of depth n can
    store up to 2^n colors
          Color Images
A color image is made up of pixels each of
which holds three numbers corresponding
to the red, green, and blue levels of the
image at a particular location.
Assuming 256 levels for each primary,
each color pixel can be stored in three
bytes (24 bits) of memory. This
corresponds to roughly 16.7 million
different possible colors.
      Digitalization of images
Digitalization of an analog signal involves
two operations:
   Sampling, and
   Quantization.
    Digitalization of images
Sampling corresponds to a discretization
of the space.

Quantization corresponds to a
discretization of the intensity values.
          Image Processing
Image Processing
   Transformation of an input image into an
    output image with desired properties.

Images can be transformed from on shape
into another by directly modifying the
pixels that represent the image.
          Image Processing
Image Processing Examples:
   Highlight a particular area in an image.
   Blur all or part of an image.
   Sharpen all or part of an image.
   Perform edge detection on an image.
   Apply color inversion to an image.
   Morphing one image into another image.
   Rotating an image.
    Reading Images with Java
We can read an image and reach its pixels
by applying the following:
   Create a BufferedImage object that can store
    the information of the image of interest.
       BufferedImage bufImage = f);
    // the static method read(File f) of class ImageIO
    // is used to return a buffered image of the image
    //represented by (f)
    // ImageIO is found in javax.imageio package
    //BufferedImage is found in java.awt.image
    Reading Images with Java
   Returning the WritableRaster object that
    associated with the created BufferedImage.
      WritableRaster class contains methods that enable
      us to access (read and update) the image pixels.

     WritableRaster wRaster = bufImage.getRaster();
           method getRaster() of class BufferedImage returns the
            associated WritableRaster object
           Class WritableRaster is found in java.awt.image
      WritableRaster Class
Some important methods in
WritableRaster class:
void setSample(int x,int y,int color,int value);
   setSample() : to give a new value of the color
   (color) of the pixel (x,y)
   color = 0 (red)
   color = 1 (green)
   color = 2 (blue)
        WritableRaster Class
Int getSample(int x,int y,int c);
   to return the value of color (c) at pixel (x,y)

To top