Вы находитесь на странице: 1из 40

Image Segmentation Using Edge Detection Method followed by Statistical Region Merging

GUIDED BY Ms. POULAMI DUTTA

GROUP MEMBERS
SAIKAT DAS PALLAB KUNDU ABHIK MISRA SWARUP GANGULY SAYAN BHOWAL

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

Image Segmentation
Segmentation is an important aspect of image processing. In computer vision, segmentation refers to the process of partitioning a digital image into multiple regions (comprising sets of pixels).

Detection of point line edges


w1 W4 W7 W2 W5 W8 W3 W6 W9

R = W1 * z1 +W2*Z2 ..+ W9* Z9

Point detection mask


-1 -1 -1 -1 8 -1 -1 -1 -1

|R| > T

Line detection masks


-1 2 -1 -1 2 -1 -1 2 -1

Horizontal line detection


-1 -1 -1 2 2 2 -1 -1 -1

Vertical line detection

Line detection continued


-1 -1 2 -1 2 -1 2 -1 -1

+45 degree line detection


2 -1 -1 -1 2 -1 -1 -1 2

-45 degree line detection

Region-Based Segmentation
The objective of segmentation is to partition an image into regions A region is a connected component with some uniformity (say gray-levels or texture) Region Growing Region growing is a procedure that groups pixels or sub regions into larger regions based on predefined criteria. The basic approach is to start with a set of seed points and from these grow regions by appending to each seed those neighboring pixels that have properties similar to the seed.

In region growing, we start with a point and expand to neighboring pixels, if they are similar and 8-connected neighbor It is best explained by an example X ray of weld (the horizontal dark region) containing several cracks and porosities (the bright, white streaks running horizontally in the image) We need initial seed points to grow into regions How to set the initial seed points?

Let us look at the image and histogram. Cracks are bright. Select all pixels having value of 255 as seeds There is a valley at around 190 in the histogram A pixel should have a value > 190 to be considered as a part of region to the seed point The pixel should be a 8-connected neighbor to at least one pixel in that region

Original image

Seed points

Result of region growing

Boundaries of defects

Previously Proposed Algorithm


We

have tried to extract the objects from the image for detecting edges from original picture. For this we have converted the image into gray scale as filtering operation cannot be applied to colored image. After that we have separated the edges. Then we have applied a special of mask to the Sobel operator to smooth the image and detached the noise as far as possible Now by calculating the connected components say it be mx. Here we can give a value between 1 and mx for L or in a loop we can extract all connected components.

Test Result of this Algorithm


This Algorithm works fine only on that particular image. The smoothness of the connected components highly depends on the mask used. So it is image specific edge detection process.

Output of Algorithm

Original Image

Gray Scale Image

Edge Detected Image

Segmented Image

Theoretical Analysis
Two essential components in defining a region merging algorithm:
Merging predicate: define how to merge to undetermined region. Order in merging: define an order to be followed to check the merging predicate.

Merging Predicate
Theorem 1 (The independent bounded difference inequality). Let X = ( X 1 , X 2 ,..., X n ) be a vector of n R.V.s. Suppose the real-valued function f satisfies f ( x) f ( x' ) ck whenever vectors x and x differ only in kth coordinate. Then, for any 0 , where is the expected value of the R.V. f(X)
2 2 Pr ( f ( X ) ) exp (ck ) 2 k

Merging Predicate Contd


From theorem 1, we obtain the result on the deviation of observed differences between regions of I. Corollary 1. Consider a fixed couple (R,R) of regions of I. the that 0 < , 1 probability is no more than

1 1 1 2 + ln = b( R, R' ) (R R ' ) E(R R ' ) g 2Q R R'


The notation E(R) for some arbitrary region R is the expectation over all corresponding statistical pixels of I*,the true image. is the observed average of this color band.

Merging Predicate Contd


Proof: There are Q(|R|+|R|) no. of random values possible for the couple(R,R). Let us shift the value of one of them. is subject to a variation of at most cR=g/Q(|R|) when this modification affects region R and at most cR=g/Q(|R|) for a change inside R.We get Using the fact that deviation with the absolute value is at most twice that without,and using Theorem 1(solving for brings our result.

Merging Predicate Contd


In the same statistical region, E ( R R ' ) = 0 and with a high probability 1 ( N ) that R R ' does not exceed b( R, R' ) . Merging predicate : merge R and R iff
R R ' b( R, R ' )

Merging Predicate Contd


We replace this merging predicate with a more optimistic one which gives very good visual results

Let RL be the set of regions each having L no. of pixels. Then


where the values of each color channel belong to the set {1,2,.,g}(in practice g=256)

So our merging predicate P(R,R) is defined as given below P(R,R)=true false if otherwise

Here |R|=no of pixels in region R

Implementation
We may fix (we have L+1 choices for the no. of pixels having each color channel). Then we can get which we implement in our code in the following manner
logreg1 = min(g,size_segments(C1))* log(1.0+size_segments(C1)); here L=size_segments(C1) where C1 is one seed point Next we calculate Which we implement in our code in the following manner dev1=((g*g)/(2.0*Q*size_segments(C1)))*(logreg1 + logdelta); We use + instead of as logdelta has negative value Similarly we compute b2(R) in the following manner dev2=((g*g)/(2.0*Q*size_segments(C2)))*(logreg2 + logdelta);

Implementation Contd
Then ,we also implement
2

as

dR=(image_seg(C1)-image_seg(C2))^2;

Similarly we calculate dG and dB for Green and Blue channels respectively. Then our merging predicate is calculated as
predicat=( (dR<dev) && (dG<dev) && (dB<dev) );

This line implements the inequality for all three color channels Red,Green and Blue.

Order in merging
Ideally, the order to test the merging of regions is: when any test between two true regions occurs, that means that all tests inside each of the two true regions have previously occurred. Three types of errors in segmentation Undermerging:One or more regions obtained are strict subparts of true regions. Overmerging:Some regions obtained strictly contain more than one true regions. Hybrid Case:Some regions obtained contain more than one strict subpart of true regions. Only overmerging occurs with high probability.

Proposed Algorithm: SRM


Let N=No. of pixel pairs |I|=No. of pixels in the image In 4-connecxity,there are N<2|I| couples of adjacent pixels. Let SI be the set of these couples,let f(p,p) be a real valued function with p and p pixels of image I. Let R(p) stand for the current region to which p belong.

Proposed Algorithm: SRM


Sort SI in increasing order of f(.,.) and then traverse this order only once. For any current couple of pixels p and p if R(p)R(p) check (R(p),R(p))
merge R(p) and R(p) iff it returns true.

Properties Of The Proposed Approach


The proposed approach is proved that only overmerging occurs, with high probability. The proposed approach has been shown to have an upperbound on the error incurred w.r.t. the optimal sementation, with high probability. The proposed approach is easily extended to numerical channels, such as RGB.

Experimental Results
The current algorithm has been tested on the following image with the parameter values Q=32 = 1/6|I|2

Original Image(.jpg)

Segmented Image

Experimental Results

Original Image(.png)

Segmented(Q=32)

Segmented(Q=1024)

Advantages and Disadvantages of our Algorithm of Region Growing

Advantages
The concept is simple. We only need a small numbers of seed point to represent the property we want, then grow the region. We can determine the seed points and the criteria we want to make. We can choose the multiple criteria at the same time. It performs well with respect to noise.

Disadvantages
The computation is consuming, no matter the time or power. Noise or variation of intensity may result in holes or oversegmentation. Current seed point dominate the growing process. Different seed point gives us different results.

Real-life applications of Image Segmentation

Application of Image Segmentation


Medical Imaging

Measure tissue volumes


Computer-guided surgery Assisted tumor extraction Diagnosis Treatment planning Study of anatomical structure

Application of Image Segmentation Contd


Locate objects in satellite images (roads, forests, etc.) Face recognition Fingerprint recognition Traffic control systems Brake light detection

Future Scope
The areas of future modification include :a)Adapting the algorithm to work with image formats which are currently incompatible, such as GIF and TIFF formats. b)Designing a Graphical User Interface for the application. Experimenting with other image smoothing filters; such as the Butterworth low pass filter

Industry Issues
Sony Entertainment Television uses special video effects. National Geographic Channel uses powerful segmentation tool. Google Earth uses this technique for viewing live satellite images Jindal Steel & Power Limited uses it.

Bibliography

Digital Image Processing Rafael C. Gonzalez , Richard E. Woods Digital Image Processing using Rafael C. Gonzalez , Richard E. Woods & Steven L. Eddins Web Resource :http://www.mathworks.com/ http://www.wolframalpha.com/ http://www.citeseer.com/ http://www.wikipedia.org/

Вам также может понравиться