Friday 4 May 2012

Region Segmentation

REGION MERGING


- a process of eliminating false boundaries and spurious regions by merging adjacent regions that belong to the same object.
- suitable for edge data segmentation.
- involve identifying each pixel in a raw image as a small region and then merging regions together systematically  to grow larger regions.

  ++ Algorithm for Region Merging ++
        1. Merging schemes begin with a partition satisfying condition (4) - using threshold
                                               
                                                       (4) P(Ri) = True

        2. Then proceed to fulfill condition (5) by gradually merging adjacent image regions.
                   
                                                       (5) P(Ri U Rj) = False

           a. Form initial regions in the image.
           b. Build a region adjacency graph (RAG).
           c. For each region do :-  consider its adjacent region and test to see if they are similar.
                                             -  for regions that are similar (P(Ri U Rj) = True), merge them and modify the      
                                                RAG
           d. Repeat step (c) until no regions are merged.



---------------------------------------------------------------------------------

REGION SPLITTING


 - a process of adding missing boundaries by splitting regions that contain parts of different objects.

 ++ Algorithm for Region Splitting ++

       1. Splitting schemes begin with a partition satisfying condition (5)

                                                     (5) P(Ri U Rj) = False

       2. Then, proceed to satisfy condition (4) by gradually splitting image regions.

                                                      (4) P(Ri) = True

             a.  If P(R) = False, split R into four quadrants.
             b. If P is false on any quadrant, subsplit.



---------------------------------------------------------------------------------

REGION SPLITTING AND MERGING


- A better result of region segmentation can be produced by integrating both region splitting and merging together.
- Takes partition that possibly not satisfies neither condition (4) nor (5) with the aim of producing a segmentation that satisfies both condition.



++ Algorithm for Region Splitting and Merging++

   1.  Split into four disjointed quadrants any region Ri where P(Ri) = False.
   2.  Merge any adjacent regions Rj and Rk for which P(Rj U Rk) = True.
   3.  Stop when no further merging or splitting is possible.






---------------------------------------------------------------------------------


REGION USING QUAD TREES
- Extension of pyramids for binary images.
- Three types of nodes (white,black,grey).
-White or black node no splitting.
- Gray node split into 4 sub-regions














---------------------------------------------------------------------------------




           

Friday 20 April 2012

JPEG vs JPEG 2000

Assalamualaikum. Hello readers, balqis here. This time, I would like to discuss the comparison between JPEG and JPEG 2000. Have you ever heard about JPEG? What is JPEG? JPEG stands for 'Joint Photographic Experts Group'. It is a standard method of compressing photographic images. The file extensions for this format are .JPEG, .JFIF, .JPG, OR .JPE although .JPG is the most common on all platforms. JPEG format enable lossless compression. Example of lossless compression technique are Huffman coding, run-length coding, and many more.



Here, I put some of the jpeg compression implementation code. To implement basic JPEG compression using only basic Matlab functions. .  This included going from a basic grayscale bitmap image all the way to a fully encoded file readable by standard image readers.

Step1:  Converting the base image to 8x8 matrices, DCT transform, quantizing
Step 2:  Zig-Zag Encoding of Quantized Matrices.
Step 3:  Conversion of quantized vectors into the JPEG defined bitstream
Step 4:  Construction of the JPEG File header, Writing the File

Lets try this :)







You must wonder, what is Huffman coding right? Emm, Huffman code, developed by D. Huffman in 1952, is a popular technique for removing coding redundancy. The result after Huffman coding is variable length code, where the code words are unequal length. Lets see, the Huffman example :)






Then, JPEG 2000 was introduced. But why they introduce JPEG 2000 and what is the difference between JPEG  and JPEG 2000?   Ok, let me explain it one by one. To be able to manipulate more and more data, image compression must not only reduce the necessary storage and bandwidth requirements, but also allow extraction for editing, processing, and targeting particular devices and applications.

The JPEG-2000 image compression system has a rate-distortion advantage over the original JPEG. More importantly, it also allows extraction of different resolutions, pixel fidelities, regions of interest, components, and more, all from a single compressed bitstream.



To be shortened, let me list the advantages of JPEG 2000 over JPEG :)

  • JPEG 2000 advantage is it offers both lossy and lossless compression at the same time while JPEG usually utilize lossless compression.
  • JPEG 2000 format includes much richer content than existing JPEG files.
  • JPEG 2000 can display an image at different resolution and size from the same image file.

Below is the differences of JPEG and JPEG 2000. Can you spot the differences? 



That's a little bit explanation about JPEG and JPEG 2000. Don't forget to read our previous post by Raihan entitled Image Enhancement. Have a nice day.



References:
  1. http://www.verypdf.com/pdfinfoeditor/jpeg-jpeg-2000-comparison.htm
  2. http://www.photozone.de/jpeg2000-vs-jpeg-vs-tiff
  3. http://ce.sharif.ac.ir/courses/84-85/2/ce342/resources/root/Lecture%20Notes/dcc2000_jpeg2000_note.pdf



Monday 9 April 2012

Image Enhancement

Hello readers... this week we are back with new topic in Image Processing which is: Image Processing in Spatial Domain and Frequency Domain.

Why we need to enhance image???
It is because  it improves the interpret-ability or perception of information in images for human viewers. It is also providing better input for other automated image processing techniques

Now, let's take a look about what it is all about with these two different domains..


Spatial Domain
Frequency Domain
2D function f(x,y) represents pixel values
2D function f(x,y) represents frequency values
Techniques that operate directly on pixels
Techniques are based on modifying the Fourier Transform (FT) of an image.
The computational cost of filtering depends on filter size
Cost-filtering is fixed (not-dependant on size of the equivalent spatial domain convolution filter)
Changes in pixel positions correspond to changes in scene.
Changes in image position correspond to changes into spatial frequency
General model:
g(x,y) = h(x,y) * f(x,y) + n(x,y)
g(x,y) = Degraded image
h(x,y) = Degradation function
f(x,y) = Original image
n(x,y) = Additive noise function
General model:
G(u,v) = H(u,v) *F(u,v) + N(u,v)
G(u,v) = FT of degraded image
H(u,v) = FT of degradation function
F(u,v) = FT of original image
N(u,v) = FT of noise function





Do you ever know how to determine the frequency of one particular image???
What do frequencies mean in an image ??








Related Posts Plugin for WordPress, Blogger...