You are on page 1of 14

Image processing and compression techniques:

An image defined in the "real world" is considered to be a function of two


real variables say x,y.

Before going to processing an image, it is converted into a digital form.


Digitization includes sampling of image and quantization of sampled values.
After converting the image into bit information, processing is performed.
This processing technique may be,
Image enhancement
Image reconstruction
Image compression
Image enhancement refers to accentuation, or sharpening, of image
features such as boundaries.
Image restoration is concerned with filtering the observed image to
minimize the effect of degradations.
Image compression is concerned with minimizing the no of bits required
to represent an image.
Text compression – CCITT GROUP3 & GROUP4
Still image compression – JPEG
Video image compression -MPEG

Modern digital technology has made it possible to manipulate multi-dimensional signals


with systems that range from simple digital circuits to advanced parallel computers. The
goal of this manipulation can be divided into three categories:

* Image Processing image in -> image out


* Image Analysis image in -> measurements out
* Image Understanding image in -> high-level description out
Image processing is referred to processing of a 2D picture by a computer.
Basic definitions:
An image defined in the "real world" is considered to be a function of two real
variables, for example, a(x,y) with a as the amplitude (e.g. brightness) of the image at the
real coordinate position (x,y).
An image may be considered to contain sub-images sometimes referred to as
regions-of-interest, ROIs, or simply regions. This concept reflects the fact that images
frequently contain collections of objects each of which can be the basis for a region. In a
sophisticated image processing system it should be possible to apply specific image
processing operations to selected regions. Thus one part of an image (region) might be
processed to suppress motion blur while another part might be processed to improve
color rendition.
Sequence of image processing:
The most requirements for image processing of images is that the images be
available in digitized form, that is, arrays of finite length binary words. For digitization,
Sample
and
Digitize
Digital
Storage
(Disk)
Computer Outline
Buffer
output
Image
Record

the given Image is sampled on a discrete grid and each sample or pixel is quantized using
a finite number of bits. The digitized image is processed by a computer. To display a
digital image, it is first converted into analog signal, which is scanned onto a display.
Sampling theorem:
A bandlimited image is sampled uniformly on a rectangular grid with spacing dx,
dy can be recovered without error from the sample values f (mdx,ndy) provided the
sampling rate is greater than nyquist rate, that is
1>2
dx xs x0 ,
1>2
dy ys y0
Image quantization:
The step subsequent to sampling in image digitization is quantization. A quantizer
maps a continuous variable u into a discrete variable u1, which takes values from a finite
set {r1, r2… rn} of numbers. This mapping is generally a staircase function &
quantization rule is as follows:
Define {tk, k=1,…,L+1} as a set of increasing transition or decision levels with t1
and tL+1 as minimum and maximum values,respectively,of u. if u lies in intervals
[tk,tL+1], then it is mapped to rk, the kth reconstruction level.
The following quantizers are useful in image coding techniques such as pulse code
modulation (PCM), differential PCM, transform coding, etc., they are operate on one
input sample at a time, output value depends only on that input.
they are,
i.LLOYD-MAX QUANTIZER
ii.OPTIMUM MEAN SQUARE UNIFORM QUANTIZER

Image enhancement
Image restoration
Image compression etc.
Image enhancement:
It refers to accentuation, or sharpening, of image features such as boundaries, or
contrast to make a graphic display more useful for display & analysis. This process does
not increase the inherent information content in data.
It includes gray level & contrast manipulation, noise reduction, edge crispening
and sharpening, filtering, interpolation and magnification, pseudocoloring, and so on.
Image restoration:
It is concerned with filtering the observed image to minimize the effect of
degradations. Effectiveness of image restoration depends on the extent and accuracy of
the knowledge of degradation process as well as on filter design. Image restoration differs
from image enhancement in that the latter is concerned with more extraction or
accentuation of image features.
Image restoration
Image compression:
It is concerned with minimizing the no of bits required to represent an
image.
Imaging
system
A to D
conversion
Digital
filter
D to A
conversion
Display or record
U(x,y)
V(m,n) U(m,n)

Application of compression are in broadcast TV, remote sensing via


satellite, military communication via aircraft, radar, teleconferencing, facsimile
transmission, for educational & business documents , medical images that arise in
computer tomography, magnetic resonance imaging and digital radiology, motion ,
pictures ,satellite images, weather maps, geological surveys and so on.
 Lossless compression
 Lossy compression
Lossless compression:
In this, data is not altered in process of compression or decompression.
Decompression generates an exact replica of an original image. “Text compression” is a
good example .spreadsheets, processor files usually contain repeated sequence of
characters. By reducing repeated characters to count, we can reduce requirement of bits.
Grayscale&images contain repetitive information .this repetitive graphic
images and sound allows replacement of bits by codes. In color images , adjacent pixels
can have different color values. These images do not have sufficient repetitiveness to be
compressed. In these cases, this technique is not applicable.
Lossless compression techniques have been able to achieve reduction in
size in the range from 1/10 to1/50 of original uncompressed size.
Standards for lossless compression:
 Packbit encoding (run-length encoding)
 CCITT group 3 1D
 CCITT group 3 2D
 CCITT group 4 2D
 Lempel-Ziv and Welch algorithm.
Lossy compression:
It is used for compressing audio, grayscale or color images, and video
objects. In this, compressing results in loss of information. When a video image is
decompressed, loss of data in one frame will not perceived by the eye. If several bits are
missing, information is still perceived in an acceptable manner as eye fills in gaps in
shading gradient.
Standards for lossy compression:
 Joint photographic experts Group (JPEG)
 Moving picture experts Group (MPEG)
 Intel DVI
 P*64 video coding algorithm.
A binary image containing black & white pixels. A scanner scans a
document as sequential scanlines. During scanning, the CCD array sensors of scanner
capture black & white pixels along a scanline. This process is repeated for next scanline
and so on.
Packbit encoding:
In this, a consecutive repeated string of characters is replaced by two
bytes.
First byte=no of times the character is repeated.
Second byte=character itself.
For e.g., 0000001111110000 is represented as
Byte1, byte2, byte3… byteN.0x06, 1x06, 0x04.
In some cases, one byte is used to represent both value of character & also no of times.
In this, one bit out of 8 used for representing pixel value, 7 bits are for runlength. Typical
compression efficiency is from ½ t0 1/5.
CCITT Group 3 1D:
Huffman coding is used.

Algorithm for Huffman coding:


1. Arrange the symbols probabilities pi in decreasing order& consider them as leaf
nodes of a tree.
2. while there is more than one node;
2.1. Merge the two nodes with smallest probability to form a new node whose
probability is the sum of two merged nodes.
2.2. Arbitrarily assign 1 & 0 each pair of branches merging into a node.
3. Read sequentially from root to leaf node where symbol is located.
Probability of occurrence of a bit stream of length Rn is P (n). As a result, shorter
codes were developed for less frequent runlength.
For e.g., from below table , runlength code for 16 white pixels is 101010, while
runlength code for 16 black pixels is 0000010111,since occurrence of 16 white pixels
is more than that of 16 black pixels.
Codes greater than 1792 runlength is same for both pixels.
CCITT Group 3 1D utilizes Huffman coding to generate a set of terminating codes &
make-up codes for given bit stream. E.g., runlength of 132 where pixels are encoded
by using,
Make-up code for 128 white pixels-10010.
White runlength Codeword Black runlength Code word
1 000111 1 010
2 0111 2 11
...
16
............
.....
101010
............
.....
16
..........
......
0000010111
.....
1792 000000000001 1792 0000001100101

Terminating code for 4white pixels-1011


Generating coding tree:
Coding tree for 16 white pixels.
CCITT Group 3 2D compression:
It uses a “k-factor” where image is divided into a several groups of klines.
First line of every group of k-lines is encoded using CCITT Group 3 1D
compression. A 2D scheme is used with1D scheme to encode rest of the lines.
Data format for 2D scheme:
2D-scheme uses a combination of pass code, vertical code, and
horizontal code. Pass code is 0001.horizotal code is 001.
Diff b/w pixel position in reference line
And coding line
Vertical
code
3 0000010
2 000010
1 010
01
-1 011
-2 000011
0
0
0
1
1
1

-3 0000011
Steps to code the coding line:
o Parse the coding line and for change in pixel value. The pixel value change if
found at the location.
o Parse the reference line and look for change in pixel value. The change is found at
the b1-location.
o Find the difference in locations b1 & a1: Delta=b1-a1.
If delta is in b/w -3 to +3, apply vertical codes.
CCITT Group 4 2D compression:
In this, first reference line is an imaginary all white line above the top of
image. The new line becomes reference for next scan line.
Joint photographic experts Group (JPEG):(LOSSY COMPRESSION)
Methodology:
8*8 block
DCT :( DISCRETE COSINE TRANSFORM)
In time domain, signal requires lots of data points to represent the time in x-axis &
amplitude in y-axis. Once the signal is converted into a frequency domain, only a few
data points are required to represent the same signal.
A color image is composed of pixels; these pixels have RGB values, each with its x & y
coordinates using 8*8 matrixes. To compress the gray scale in JPEG, each pixel is
translated to luminance. To compress color image, work is 3 times as much.
DCT-CALCULATIONS:
DC
Huffman
ZIGZAG AC
Huffman
DCT Q
DPCM

DCT(i,)=1*c(i)c(j) * pixel(x,y)cos((2x+1)*i*3.14)/2N)cos((2y+1)*i*3.14)/2N)
pixel(x,y)=1* c(i)c(j)DCT(i,j)cos((2x+1)*i*3.14/2N)cos((2y+1)*i*3.14)/2N)
DCT co efficient is generated by applying the dct on 8*8 block. Consider following
block,
132 136 138 140 144 145 147 155
136 140 140 147 140 148 155 156
140 143 144 148 150 152 154 155
144 144 146 145 149 150 153 160
150 152 155 156 150 145 144 140
144 145 146 148 143 158 150 140
150 156 157 156 140 146 156 145
148 145 146 148 156 160 140 145
Table1
Nos in the above table represent amplitude of pixel in 8*8 blocks. The tale2 shows
8*8 matrixes, after applying DCT. In table2, row0, column0 has DCT (i,j) as 172, it is
called as DC component, others are called as AC component & it has larger value than
others.
Table2
172 -18 15 -8 23 -9 -14 19
21 -34 24 -8 -10 11 14 7
-9 -8 -4 6 -5 4 3 -1
-10 6 -5 4 -4 4 2 1
-8 -2 -3 5 -3 3 4 6
4 -2 -4 6 -4 4 2 -1
2
2

4 -3 -4 5 6 3 1 1
0 -8 -4 3 2 1 4 0
Quantization:
Baseline JPEG algorithm supports 4 quantization tables & 2 Huffman tables for
DCand AC DCT coefficients.
Quantizedcoeff (i, j) =DCT (i, j)/quantum (i, j);
DCTcoefficients after quantization:
43 3 2 0 0 0 0 0
33200000
10000000
10000000
00000000
00000000
00000000
00000000
After quantization, JPEG elected to compress 0 values by utilizing runlength scheme.
To find no of 0s, JPEG uses zigzag manner.
Moving picture experts Group (MPEG):
Architecture:
Motion
compens
ation
Past
frame
Future
frame

+
IDCT
Huffman
coder
MUX
Huffman
DCT Q coder
-1

Q +
Macro
block input
It provides two basic schemes:
Discrete –transform-based compression for reduction of spatial
redundancy.
Block based motion compensation for reduction of temporal redundancy.
During initial stages of DCT compression, both MPEG & JPEG algorithms are
essentially same. For full motion video (MPEG1 &2), motion compensation is used.
Motion compensation:
It assumes current picture as the translation of some previous pictures. Motion
compensation attempts to compensate for movement of objects in compression phase.
To make it easier to compare frames, a frame is split into blocks, and blocks are
encoded.
For each block in the frame to be encoded, best matching block in the reference
frame is searched among the number of candidate blocks. For each block, motion
vector is generated. This vector is viewed as an analytical indication of new location
In the frame being encoded from an existing block in the reference frame. This is an
attempt to match up new location of a moved object. The process of matching up
based on prediction or interpolation.
Prediction:
Prediction requires current frame and reference frame. Based on motion vector values
generated, prediction attempts to find a new position of object & conform it by
Comparing some blocks.
Interpolation:
Motion vectors are generated in relation to two reference frames, one from past & the
predicted frame. The best matching blocks in both frames are searched, and average
is taken as position of block in current frame.
Advanced technologies:
 Intel’s indeo technology
 Apples quicktime
 Microsoft AVI
 Intel’s AVI
Using image processing techniques, we can sharpening the images, contrast to
make a graphic display more useful for display, reduce amount of memory requirement
for storing image information,etc., due to such techniques, image processing is applied in
“recognition of images” as in factory floor quality assurance systems; “image
enhancement”, as in satellite reconnaissance systems; “image synthesis” as in law
enforcement suspect identification systems, and “image construction” as in plastic
surgery design systems. Application of compression is in broadcast TV, remote sensing
via satellite, military communication via aircraft, radar, teleconferencing, facsimile
transmission etc.
1. www.google.com
2. Multimedia Systems design Andleigh P K and Thakrar K.
3. Digital image processing –Jain.
Image processing application

Avi medical image control

ABSTRACT
The various Medical images acquired directly from various
instruments are in the AVI format, which reduces the easy control of
image display without conversion to medical image standard, that is the
DICOM format. The purpose of this project is to develop software to
handle online data acquisition from medical equipments like Ultra Sound
machine, control the display rate, convert the AVI image acquired from the
Medical equipment directly to DICOM image with patient’s detail’s got from
the user, freeze the AVI image frame of interest, convert the freezed AVI
frame to Bitmap image, convert this Bitmap image to DICOM image with
patient’s details. This software is highly reliable, efficiently handles
memory and very user friendly.
Medical equipments like Ultra Sound, CT etc… have images at
their output in the AVI file format, which are acquired with the respective
probes. These AVI images acquired are stored. The software captures this
AVI image, displays them frame-by-frame in succession and converts
them to DICOM image with required patient’s details obtained from the
Specialist during conversion. The frame of interest can be freezed and
converted to Bitmap image, which can also be viewed on a separate
window with options to brighten, darken, change the color combination,
invert the image and restore the image. The converted DICOM image can
be viewed on any Standard DICOM viewer. Mostly all the DICOM viewer
will have provision to view the patient’s details entered during conversion.
OBJECTIVE
To help the doctor view a particular frame of interest captured
from a medical equipment which is usually an AVI image and to enable
the doctor to manipulate the frame for correct diagnosis and provide
efficient treatment.
MEDICAL IMAGING
From Ophthalmology and radiology to orthodontics, image
processing touches the medical field in many ways. The ability to visualize
and interactively manipulate three-dimensional objects derived from sets
of two-dimensional MRI and CAT scan (now shortened to CT scan) slices
has changed the way we deal with medicine. MRI stands for nuclear
magnetic resonance imaging.
DISADVANTAGE OF EXISTING SYSTEM
There is no AVI viewer that facilitates the doctors to
manipulate the medical image captured from the equipment. All AVI
viewers available just displays the frames in predetermined time
intervals and time of display of each frame cannot be controls as per
the physicians requirement. Frame at a particular given time can be
displayed but, it wont help the doctor capture the exact frame that is
required to find out the exact defect.
PROPOSED SYSTEM
This system will prove to be user friendly as this captures the
medical AVI image, grabs the required header information, converts them to
DICOM file format and stores it along with the patient’s details, physicians
details, etc… so that any physician can diagnose the patient without any other
further details. Moreover there are many DICOM viewer available with many
image processing provision.
Steps To Control Image
 Capture the image from an medical equipment which will normally
be in AVI (Audio/Video Interleaved) format.
 Analyze the header details of the AVI image.
 Copy the required header details into the DICOM header format.
 If the length of the header is greater than zero it is considered to be
valid.
 Find the start of frame in the AVI file, check for its length, if data is
valid copy the frame into DICOM file else skip the frame.
 View the DICOM file in appropriate DICOM viewer.
IMAGE FILTERING
It is used to extract great amounts of information from our
images – information to which we don’t have access normally.
 Edge enhancement and sharpening
filters will bring out details in objects that we would not
otherwise have noticed.
 Averaging filters will smoothen the rough
and jagged edges in our images, making them more
appealing to the eye.
 Basic Statistical filter will remove much of
the noise found in our CCD scanned images.
 Gradient analysis will help us visualize
your image in a whole new light, greatly enhancing edges –
allowing us to create interesting embossed image effects.
 Special filters can help us identify certain
objects within an image.
 Low Pass filter passes on lower frequency
components of an image, while attenuating or rejecting the
higher frequency components.
 High Pass Filter is used to amplify the
high-frequency details found in an image, while the integrity
of low-frequency detail of the image remains.
IMAGE PROCESSING:
Images are a vital and integral part of every day life. On
an individual, or person-to-person basis, images are used to reason,
interpret, illustrate, represent, memorize, educate, communicate, evaluate,
navigate, survey, entertain, etc. We do this continuously and almost
entirely without conscious effort. As man builds machines to facilitate his
ever more complex lifestyle, the only reason for NOT providing them with
the ability to exploit or transparently convey such images is a weakness of
available technology.
Applied Image Processing, in its broadest and most literal
interpretation, aims to address the goal of providing practical, reliable and
affordable means to allow machines to cope with images while assisting
man in his general endeavors.
By contrast, the term ‘image processing’ itself has become
firmly associated with the much more limited objective of modifying
images such that they are either:
a. Corrected for errors introduced during acquisition or
transmission (‘restoration’); or
b. Enhanced to overcome the weakness of human visual
system (‘enhancement’)
As such, the discipline of ‘pure’ image processing may be
succinctly summarized as being concerned with
‘ a process which takes an image input and generates a
modified image output ’
Clearly then, other disciplines must be allied to pure image
processing in order to allow the stated goal to be achieved. ‘Pattern
classification’, which may be defined simply as
‘ a process which takes a feature vector input and
generates a class number output’
Confers the ability to identify or recognize objects and perform
sorting and some inspection tasks. ‘Artificial intelligence’, which may be
defined as
‘ a process which takes primitive data input and generates
a description, or understanding or a behavior as an output’
Confers a wide range of capability from description, in the
form of simple measurement of parameters for inspection purpose, to a
form of autonomy borne out of an ability to interpret the world through a
visual sense.
Theses disciplines have been evolving steadily and
independently ever since computer first became available, but only when
they are all effectively harnessed together do machines acquire anything
like the ability to exploit images in the way that humans do.
In particular, the marriage of one, or both, of the first two
disciplines with artificial intelligence has given birth to the new, image
specific disciplines, namely ‘image analysis’, ‘scene analysis’ and ‘image
understanding’.
Image analysis is normally satisfied with quantifying data about
objects which are known to exist within a scene, or determining their
orientation, or recognizing them as one of a limited set of possible
prototypes. As such it is largely concerned with the development of the 2-
D applications, there is an undoubted need to extend this activity to the
description of 3-D relationships between objects within a 2-D view of the
real-world scene.
Scene analysis was the original term coined to describe this
extension of image analysis into the third dimension. Such work flourished
in the 1960s and was concerned with the rigorous visual analysis of
threedimensional
polyhedra (the so-called ‘blocks-world’), on the mistaken
premise that it would be a trivial matter to extend these concepts to the
analysis of natural scenes. The work was finally abandoned in the late
1970s when it was realized that the exploitation of application-dependent
constraints was no way to research general-purpose vision systems.
Consequently, the term scene analysis fell into disuse only to be
replaced by that of image understanding, which is more fundamentally
based upon the physics of image formation and the operation of human
visual system. It aims to allow machines to operate with ease in complex
natural environments, which feature partially occluded objects or,
ultimately, previously unseen objects.
A broad overview of the literature in the field of machine
perception of images suggests the existence of two distinct ‘camps’ whose
followers, while sharing common roots, set out to achieve fundamentally
different objectives. We have chosen to label these camps as ‘computer
vision’ and ‘machine vision’, and feel that they are essentially
distinguished by their different approaches to the use of artificial
intelligence and the degree to which it is employed. (‘Robot vision’ was
also a popular alternative at one time, although it appears to be slowly
falling into disuse, perhaps because of rather unfortunate science-fiction
connotations.)
‘Computer vision’ is ultimately concerned with the goal of
enabling machines to understand the world that they see, in real-time and
without any form of human assistance. Thus, application-specific
constraints are rejected wherever possible as the world is ‘interpreted online’.
The complexity of this task is easily under-estimated by those who
take human vision for granted, but it is fraught with many immensely
difficult problems, and seriously hampered by inadequate processing
power.
‘Machine vision’ on the other hand, is concerned with utilizing
existing technology in the most effective way to endow a degree of
autonomy in specific applications. The universal nature of the computer
vision approach is sacrificed by deliberately exploiting application-specific
constraints. Thus knowledge about the world is ‘pre-complied’, or
engineered, into machine vision applications in order to provide costeffective
solutions to real-world problems.
DIGITAL IMAGE ACQUISITION:
The general goal for image acquisition and processing is
to bring pictures into the computer domain of the computer, where they
can be displayed and then manipulated and altered for enhancement.
Four processes are involved in image acquisition:
 Input
 Display
 Manipulation
 Output
‘The transformation of optical image ata into an array of
numerical data which may be manipulation by a computer, so overall
aim of machine vision may be achieved’
In order to achieve this aim three major issues must be tackled
they are:
 Representation
 Transduction (or sensing)
 Digitizing
ARITHMETIC OPERATIONS ON IMAGES:
The arithmetic operations are absolutely essential for
calibration and flattening of the image in certain applications, particularly in
those applications that have a low signal. They are helpful tools for
enhancing an image. The basic arithmetic operations on images are:
 Addition
 Subtraction
 Multiplication
 Division
GEOMETRIC TRANSFORMATIONS:
Many times, to combine images taken at different times or by
different sources, we have to translate, rescale, and rotate the images. It
is usually important that the images match spatially. Without proper
registration of images before combination passes, most techniques for
image enhancement will actually degrade the images, losing important or
interesting information. The basic geometric transformations are:
 Translation
 Scaling/Zooming
 Resampling
 Rotation
 Flipping
ADVANCED GEOMETRIC TRANSFORMATIONS:
Have you ever wondered how those interesting special
effects that you see in movies and commercials were made? How in an
image can one person transform into another person or even an animal or
another entity? The two advanced geometric transformations are:
 Warping
 Morphing
Warping is a digital technique of distorting an image hence also
called geometric distortion. It has been used to create sophisticated
special effects I movies and television shows and in recent times in a
plethora of television commercials. They all use exotic computers and
custom software.
Morphing is an extension of warping and it is the
complete and smooth transformation from one image to another. This
technology, which traditionally has been prohibitively expensive, with a
little effort, can now be done on the desktop computer very cheaply.
Essentially, morphing involves two steps of warping, with a spline
interpolation between the initial images and the resultant image. Morphing
has you match key features such as the eyes, nose, mouth and other
details on both the exact same graphic space. Finally, a weighted average
is made of each step of transformation of the two wraps. For instance, to
morph a truck into a train, the train is first warped into the same shape as
the truck so that certain specific points, the windshields, headlights and
grills match as closely as possible.
IMAGE PREPOCESSING:
Image preprocessing seeks to modify and prepare the
pixel values of a digitized image to produce a form that is more suitable for
subsequent operations within the generic model. There are two major
branches of image preprocessing, namely
 Image Enhancements
 Image Restoration
Image enhancement attempts to improve the quality of image or
to emphasize particular aspects within the image. Such an objective
usually implies a degree of a degree of subjective judgment about the
resulting quality and will depend on the operation and the application in
question. The results may produce an image, which is quite different from
the original, and some aspects may have to be deliberately sacrificed in
order to improve others.
The aim of image restoration is to recover the original image
after ‘known’ effects such as geometric distortion within a camera system
have degraded it or blur caused by poor optics or movement. In all cases
a mathematical or statistical model of the degradation is required so that
restorative action can be taken.
Both types of operation take the acquired image array as input
and produce a modified image array as output, and they are thus
representative of pure ‘image processing’. Many of the common images
processing operations are essentially concerned with the application of
linear filtering to the original image ‘signal’.

You might also like