550 likes | 734 Views
Entropy and some applications in image processing. Neucimar J. Leite Institute of Computing neucimar@ic.unicamp.br. Outline. Introduction Intuitive understanding Entropy as global information Entropy as local information edge detection, texture analysis
E N D
Entropy and some applications in image processing Neucimar J. Leite Institute of Computing neucimar@ic.unicamp.br
Outline • Introduction • Intuitive understanding • Entropy as global information • Entropy as local information • edge detection, texture analysis • Entropy as minimization/maximization constraints • global thresholding • deconvolution problem
Information Entropy (Shannon´s entropy) An information theory concept closely related to the following question: • What is the minimum amount of data needed to represent an • information content? • For images (compression problems): • How few data are sufficient to completely describe an images • without (much) loss of information?
Intuitive understanding: • relates the amount of uncertainty about an event with a given • probability distribution Event: randomly draw out a ball low uncertainty high uncertainty no uncertainty entropy = max min (uncertainty)
Self-information: - Units of information used to represent an event E Example 1: Event: a coin flipping = { heads, tails } Probability: P(heads) = P(tails) = 1/2 0 heads 1 tails self-information: inversely related to the probability of E
Example 2: amount of conveyed information of event E Entropy: average information
coding the balls (3 bits/ball) 0 0 0 0 0 1 0 1 0 Degree of information compression: 0 1 1 equal length binary code 1 0 0 1 0 1 1 1 0 1 1 1 for independent data: Entropy: = 3 bits/ball
code 0 0 0 1 medium uncertainty: 1 0 1 1 H= -( 5/8 log2(5/8) + 1/8 log2(1/8) + 1/8 log2(1/8)+ 1/8 log2(1/8) ) = 1.54 no uncertainty: H = -8log21 = 0
2 bits/ball > 1.54 bit/ball code redundancy !!! and code 0 0 0 1 medium uncertainty: 1 0 1 1 H= -( 5/8 log2(5/8) + 1/8 log2(1/8) + 1/8 log2(1/8)+ 1/8 log2(1/8) ) = 1.54 22% We need an encoding method for eliminating this code redundancy
The Huffman encoding: Ball Probability Reduction 1 Reduction 2 red 5/8 black 1/8 1/8 blue 1/8 green
Ball Probability Reduction 1 Reduction 2 5/8 red 5/8 2/8 black 1/8 1/8 1/8 blue 1/8 green
Ball Probability Reduction 1 Reduction 2 5/8 5/8 red 5/8 3/8 2/8 black 1/8 1/8 1/8 blue 1/8 green
Ball Probability Reduction 1 Reduction 2 (1) 5/8 5/8 red 5/8 (0) 3/8 2/8 black 1/8 1/8 1/8 blue 1/8 green
Ball Probability Reduction 1 Reduction 2 (1) (1) 5/8 5/8 red 5/8 (01) (0) 3/8 2/8 black 1/8 1/8 1/8 blue (00) 1/8 green
Ball Probability Reduction 1 Reduction 2 (1) (1) 5/8 5/8 (1) red 5/8 (01) (0) 3/8 2/8 (00) black 1/8 (011) 1/8 1/8 blue (00) 1/8 green (010) variable length code ball red 1 black 00 and blue 011 (18,6%) green 010
512 x 512 8-bit image: Entropy: 4.11 bits/pixel After Huffman encoding: Variable length coding does not take advantage of the high images pixel-to-pixel correlation: a pixel can be predicted from the values of its neighbors more redundancy lower entropy (bits/pixel)
Entropy: 7.45 After Huffman encoding: Entropy: 7.35 After Huffman encoding:
Coding the interpixel difference highlighting redundancies: Entropy: 4.73 instead of 7.45 After Huffman encoding: instead of 1.07 Entropy: 5.97 instead of 7.35 After Huffman encoding: instead of 1.08
Entropy-based edge detection • Low entropy values low frequencies uniform image regions • High entropy values high frequencies image edges
Binary entropy function: 1.0 Entropy H p 0 0.5 1.0
1.0 Entropy H p 0 0.5 1.0
1.0 Entropy H p 0 0.5 1.0
1.0 Entropy H p 0 0.5 1.0
1.0 Entropy H p 0 0.5 1.0
1.0 Entropy H p 0 0.5 1.0
Binary entropy function: Isotropic edge detection
Texture Analysis • Similarity grouping based on brightness, colors, slopes, sizes etc • The perceived patterns of lightness, directionality, coarseness, • regularity, etc can be used to describe and segment an image
Texture description: statistical approach • Characterizes textures as smooth, coarse, periodic, etc - Based on the intensity histogram prob. density function Descriptors examples: • Mean: a measure of average intensity p(zi) = the intensity histogram in a region zi = random variable denoting gray levels
Other moments of different orders: - e.g., standard deviation: a measure of average contrast Entropy: a measure of randomness
smooth coarse periodic
0 1 2 3 4 0 0 0 0 0 0 1 0 4 2 1 0 2 0 3 3 2 0 3 0 1 2 3 0 4 0 0 0 0 0 Gray-level co-occurrence matrix: Haralick´s descriptors • Conveys information about the positions of pixels having • similar gray level values. Md(a,b) • 2 1 3 3 2 1 • 3 2 2 2 1 1 • 3 2 2 1 1 3 • 1 3 1 2 1 1 3 d=1
Md = the probability that a pixel with gray level i will have a pixel with level j a distance of d pixels away in a given direction For the descriptor H: large empty spaces in M little information content cluttered areas large information content d = 2, horizontal direction
Obviously, more complex texture analysis based on statistical descriptors should consider combination of information related to image scale, moments, contrast, homogeneity, directionality, etc
Global thresholding examples: histogram peaks mean
For images with levels 0-255: The probability that a given pixel will have value less than or equal t is: Now considering: Class A: Class B:
The optimal threshold is the value of t that maximizes where
Entropy as a fuzziness measure In fuzzy set theory an element x belongs to a set S with a certain probability pxdefined by a membership function px(x) Example of a membership function for a given threshold t: px(x) gives the degree to which x belongs to the object or background with gray-level average and , respectively.
How can the degree of fuzziness be measured? Example: t = 0 for a a binary image fuzziness = 0
Using the Shannon´s function (for two classes): the entropy of an entire fuzzy set of dimension MxN is and for segmentation purpose, the threshold t is such that E(t) is minimum t minimizes fuzziness