1 / 17

Image Processing basics and Java

Image Processing basics and Java. Image Representation. Digital Images are 2D arrays (matrices) of numbers. 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) Pixels

aloysius
Download Presentation

Image Processing basics and Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Image Processing basics and Java

  2. Image Representation • Digital Images are 2D arrays (matrices) of numbers

  3. Image Representation • Each pixel is a measure of the brightness (intensity of light)

  4. Digital Image Properities • Each pixel is a measure of the brightness (intensity of light) • Pixels • 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

  5. 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 pixel. • Such images are sometimes called 1-bit, or monochrome images.

  6. 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

  7. 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.

  8. Digitalization of images • Digitalization of an analog signal involves two operations: • Sampling, and • Quantization.

  9. Digitalization of images • Sampling corresponds to a discretization of the space. • Quantization corresponds to a discretization of the intensity values.

  10. 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.

  11. 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.

  12. 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 = ImageIO.read(File 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

  13. 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

  14. 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)

  15. WritableRaster Class • Int getSample(int x,int y,int c); • to return the value of color (c) at pixel (x,y)

More Related