Image processing and computer vision

Slides:



Advertisements
Similar presentations
Point Processing Histograms. Histogram Equalization Histogram equalization is a powerful point processing enhancement technique that seeks to optimize.
Advertisements

Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Chapter 3 Image Enhancement in the Spatial Domain.
Image processing and computer vision Chapter 6: Histogram equalization and color models Historgram, color v.4e 1.
HISTOGRAM TRANSFORMATION IN IMAGE PROCESSING AND ITS APPLICATIONS Attila Kuba University of Szeged.
Image Processing IB Paper 8 – Part A Ognjen Arandjelović Ognjen Arandjelović
BYST Eh-1 DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Image Enhancement.
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Images and colour Colour - colours - colour spaces - colour models Raster data - image representations - single and multi-band (multi-channel) images -
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
Color of (digital image) Raed S. Rasheed Agenda Color. Color Image. Color Models – RGB color model. – CMYK color model. – HSV and HSL color model.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 14/15 – TP3 Digital Images Miguel Tavares Coimbra.
1 Color Processing Introduction Color models Color image processing.
Image Processing Lecture 2 - Gaurav Gupta - Shobhit Niranjan.
Manipulating contrast/point operations. Examples of point operations: Threshold (demo) Threshold (demo) Invert (demo) Invert (demo) Out[x,y] = max – In[x,y]
Remote Sensing and Image Processing: 2 Dr. Hassan J. Eghbali.
1 Remote Sensing and Image Processing: 2 Dr. Mathias (Mat) Disney UCL Geography Office: 301, 3rd Floor, Chandler House Tel:
September 17, 2013Computer Vision Lecture 5: Image Filtering 1ColorRGB HSI.
Digital Image Processing Part 1 Introduction. The eye.
Intensity Transformations (Histogram Processing)
Graphics Lecture 4: Slide 1 Interactive Computer Graphics Lecture 4: Colour.
CS654: Digital Image Analysis Lecture 30: Color Model Conversion.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Image Processing Ch2: Digital image Fundamentals Prepared by: Tahani Khatib.
Introduction to JPEG m Akram Ben Ahmed
Lecture 02 Point Based Image Processing Lecture 02 Point Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Color Models Light property Color models.
CMSC5711 Image processing and computer vision
Initial Display Alternatives and Scientific Visualization
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Lecture Six Figures from Gonzalez and Woods, Digital Image Processing, Second Edition, Copyright 2002.
Miguel Tavares Coimbra
(c) University of Wisconsin, CS559 Spring 2002
Images In Matlab.
Image Processing Digital image Fundamentals. Introduction to the course Grading – Project: 30% – Midterm Exam: 30% – Final Exam : 40% – Total: 100% –
1-Introduction (Computing the image histogram).
Colour Theory Fundamentals
Color: Readings: Ch 6: color spaces color histograms
Image Enhancement.
CMSC5711 Revision (1) (v.7.b) revised
Computer Vision Lecture 4: Color
Digital Image Processing
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
CMSC5711 Revision 3 CMSC5711 revision 3 ver.x67.8c.
Image Processing – Contrast Enhancement
CMSC5711 Image processing and computer vision
Ch2: Data Representation
CIS 350 – 3 Image ENHANCEMENT SPATIAL DOMAIN
Image Enhancement in the Spatial Domain
Chapter 1: Image processing and computer vision Introduction
Lecture Five Figures from Gonzalez and Woods, Digital Image Processing, Second edition, Prentice-Hall,2002.
Digital Image Processing
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Image Enhancement Gray level transformation Linear transformation
CSC 381/481 Quarter: Fall 03/04 Daniela Stan Raicu
Digital Image Processing
Digital Image Processing
Histogram Equalization
Digital Image Procesing Introduction to Image Enhancement Histogram Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL PROCESSING IMPERIAL.
Digital Image Processing
Grey Level Enhancement
Romberg Rule of Integration
Digital Image Processing
Miguel Tavares Coimbra
The spatial domain processes discussed in this chapter are denoted by the expression
Histogram The histogram of an image is a plot of the gray _levels values versus the number of pixels at that value. A histogram appears as a graph with.
Revision 4 CSMSC5711 Revision 4: CSMC5711 v.9a.
Presentation transcript:

Image processing and computer vision Chapter 6: Histogram equalization and color models Histogram, color v.8b

Overview What is Histogram equalization? Recalculate the picture gray levels to make the distribution more equalized Used widely in image editing tools and computer vision algorithms Can also be applied to color images Ref: Intensity transformation :ch3 of Gonzalez ed.3 ch3.2 page 122. Ref: Digital image processing, R.C. González, R.E. Woods edition3. ch3 of Gonzalez ed.3 ch3.2 page 120-128. It can be found at http://books.google.com/ Histogram, color v.8b

Why ? :Histogram equalization makes the picture look better. Each pixel has a gray level rk . M rows Eample:Histogram h(rk)=nk nk = number of pixels in the image that have grade level rk. Since total number of pixels=M*N K=0,1,2,..L-1 gray level (up to you, e.g. 8-bit 256 levels; 16-bit 65536 levels) A normalized histogram N columns Bright image P(rk) Normalized Count (value =01) P(rk)=nk/MN Histogram, color v.8b Grad level(0-255) rk

Example: Normalized histogram 250 100 55 10 An image of 9 pixels (M=3, N=3) K=0,1,2,..,L-1=255. L=256 levels Normalized Count P(rk)=nk/MN Normalized histogram level count 1 10 55 2 100 3 250 3/9 2/9 1/9 0 10 55 100 250 Grade level(0-255) rk Histogram, color v.8b

CMSC 5711- ch6 Histogram Exercise 1: Normalized histogram 100 200 45 2 120 M rows An image of 5x4 pixels (M=?__, N=?___) K=0,1,2,..,L-1=255. L=256 levels Sketch the histogram (??) Normalized Count P(rk)=nk/MN N columns level count 2 ? 7 45 100 120 200 Normalized histogram (plot it) 1 0.5 0 100 200 Grad level(0-255) rk Histogram, color v.8b

Exercise 2 : In each histogram (a) Identify the gray levels that have not been used. (b) Which gray level is the highest? Bright image Histogram1 Pixels are concentrated at too high grade levels Answer:? Low contrast image Histogram2 Pixels are concentrated at too low grade levels, Distribution is too narrow. Both images are not ideal: too bright or too dark. To fix it, use histogram equalization Histogram, color v.8b 0 50 100 150 200 250 300

Histogram equalization: Motivation A mapping s=T(r) is needed, so that Probabilities of all pixel levels in the ‘s’ domain is a constant. Change the scale from ‘r’ to ‘s’ domain using the mapping s=T(r). Histogram quantization procedure: E.g. pixels of the gray level rk (say rk=0.75, for pixel levels are normalized from 0 to 1) in the original image may need to be changed to 0.82 in the normalized image.. etc. So that Ps(sk=0.1)=Ps(sk=0.82)=Ps(sk=0.95)...= Ps(sk=all values)=a_constant. They are the same. But because of digitization, some errors may exit. Output (normalized) gray values s 1 sk=T(rk) Sk r 0,0 rk 1 Input gray values (to be normalized) Histogram, color v.8b

Effect of histogram equalization Input: The picture is poorly shot. Most pixel gray levels are located in a small range. Output: Use histogram transform to map the pixels in ‘r’ domain to ‘s’ domain . So in the ‘s’ domain, each s gray level has a similar number of pixels. Input: Low contrast image r domain Output: High contrast image S domain Histogram, color v.8b

Histogram equalization: The main problem is to choose a monotonic increasing relation T(r) relation is needed L-1=T(L-1) T(r) sk=T(rk) r rk L-1 Histogram, color v.8b

Objective of histogram equalization To find the Relation s=T(r) We want to find T(r) so that Ps(s) is a flat line. T(r) L-1 sk Pr(r) r Ps(s)=a constant (flat horizontal line) s L-1 Equalized distribution Input random distribution The original image r rk L-1 s=T(r) The probability of all levels are the same In Ps(s) The probability of these levels are lower) The probability of these levels are higher Histogram, color v.8b

How to find S=T(s)? Assume we know, We want to prove that ps(s) is a constant, if the above formula holds. Later we will show: if formula (1) is true, ps(s) is a constant Histogram, color v.8b

Exercise 3 A numerical example, fill in the blanks Histogram, color v.8b

Exercise 4: Based on (1) we want to prove ps(s)= constant Histogram, color v.8b (2 slides back) We want to show: if formula1 is true, Ps(S) is a constant

Discrete form for practical use From the continuous form of formula (1) to its discrete form Histogram, color v.8b

How to do the mapping? Having found the relationship Look up table sk rk L-1 r T(r) Having found the relationship Transform the original image to obtain a equalized one by the Look-up table T(r). For (x=0;x<N-1;x++) //For all pixels in the image {For (y=0;y<M-1;y++) // { rk=source_image (x,y); newImage(x,y) = T(rk); //use the lookup table } Histogram, color v.8b

Exercise 5 (a) A numerical exercise, fill in the blanks (b) when rk=source_image(x,y)=4, newimage(x,y) will become ?__. (c) What is the relation of the variables : Total , M,N and nk? (d) What is the “histogram back projection" of a pixel having pixel level 2? (d) What is the “histogram back projection" of a pixel having pixel level 4? Histogram, color v.8b

Histogram equalization Most pictures are in color, having multiple color channels. We need to equalize color pictures Then, how to represent color images? Histogram, color v.8b

Color models Cartesian-coordinate representation RGB (Red , Green , Blue) Cylindrical-coordinate representation HSV (Hue, saturation, value) HSL (Hue, saturation, Light) etc RGB HSV http://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV Histogram, color v.8b

From RGB to HSV or HSL RGB=red, green, blue (Cartesian-coordinate representation) not relevant to our perception) So change RGB to cylindrical-coordinate representations , there are 3 choices: HSV (Hue, saturation, value) HSL (Hue, saturation, Light) HSI (Hue, saturation, Intensity) Histogram, color v.8b

Hue色調 http://en.wikipedia.org/wiki/Hue max=max_value(R,G,B) “the degree to which a stimulus can be described as similar to or different from stimuli that are described as red, green, blue, and yellow,” The same numerical value for ‘Hue’ in HSV and HSL representations of the same picture Encoded in degree max=max_value(R,G,B) min=min_value(R,G,B) if R = max, H1 = (G-B)/(max-min) if G = max, H1 = 2 + (B-R)/(max-min) if B = max, H1 = 4 + (R-G)/(max-min) H = H1 * 60 Hue Histogram, color v.8b

Cylindrical geometry of Hue (0-360o) Mixing Red/Green Mixing Green/Blue Mixing Blue/Red 0o Red Primary 120o Green Primary 240o Blue Primary Wrap round Histogram, color v.8b http://en.wikipedia.org/wiki/File:Hsv-hexagons-to-circles.svg

Lightness亮度: 3 different methods to encode brightness: Intensity (I), Value (V), Light (L) Given RGBraw (each channel 0-255 levels) pixels of a picture. Normalize it first , e.g. each channel is 8-bit. R=Rraw/255; G=Graw/255; B=Braw/255; Histogram, color v.8b

Saturation色彩飽和度 Saturation: “Saturation is the colorfulness of a color relative to its own brightness” from http://en.wikipedia.org/wiki/Colorfulness Not the same numerical values for HSV and HSL representations of the same picture HSV HSL Histogram, color v.8b

Different saturation (s) values (range 0-1) Less water More water Histogram, color v.8b

Saturation Calculation HSL HSV Histogram, color v.8b http://en.wikipedia.org/wiki/HSL_and_HSV

Exercise 6: From RGB (3x8-bit) to HSV max= max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) Hue (0-> 360o) Histogram, color v.8b

Exercise 7 RGB=(18,200,130) What are the values in HSV,HSL,HSI? Answer: Histogram, color v.8b

Exercise 8 (x16-17): An original gray level image has resolution M=50 rows and N=50 columns. The gray level resolution (L) of each pixel is 8 (gray level from 0 to 7). R(k) is the gray level of index k, N(k) is the number of pixels that have gray level R(k). Pr(R(k)) is the probability of the pixels in the image having gray level R(k). After histogram normalization, S(k) is the normalized gray level of index k. A table to help you to perform histogram equalization is shown below. Find the value of Y in the table. Discuss the relation between pixel resolution (bits per pixel) and the result of histogram normalization in image processing. For the following table, fill in the blanks. Discuss how to use histogram equalization to improve a colour picture.   Histogram, color v.8b r(k) N(k) Pr(r(k)) S(k) Round off (S(k)) r(0)    0.0056 r(1)  0.0228 r(2)  0.0940 r(3)  0.2460 r(4)  0.3248 r(5)  0.2000 r(6)  0.0808 r(7)  Y

Color histogram equalization Change the RGB representation to HSV Do histogram equalization for the V channel. The other two channels (H,S) remain unchanged. Put back the equalized HSV image back to RGB Histogram, color v.8b

Programs and demos Histogram in OpenCV: Calculate Histogram: http://opencv.willowgarage.com/documentation/cpp/histograms.html?highlight=calchist#calcHist Convert color space: http://opencv.willowgarage.com/documentation/cpp/miscellaneous_image_transformations.html?highlight=cvtcolor#cvtColor Histogram equalization http://opencv.willowgarage.com/documentation/cpp/histograms.html?highlight=equalizehist#equalizeHist Histogram, color v.8b

Programming Exercise A programming exercise with OpenCV to histogram equalize a color image Given an RGB color image, convert it to HSV color space, compute its histogram on the V channel Do histogram equalization for the V channel and generate the equalized RGB image. Histogram, color v.8b

Summary Studied gray level histograms Learned histogram equalization Learned color models and equalization of color images Histogram, color v.8b

Reference Digital image processing, R.C. González, R.E. Woods edition3. ch3 of Gonzalez ed.3 ch3.2 page 120-128. It can be found at http://books.google.com/ http://en.wikipedia.org/wiki/Histogram_equalization Histogram, color v.8b

Appendix Histogram, color v.8b

ANSWER1: Exercise 1: Normalized histogram 7 100 200 45 2 120 ANSWER1: Exercise 1: Normalized histogram M rows An image of 5x4 pixels (M=?__5, N=?___4) K=0,1,2,..,L-1=255. L=256 levels Sketch the histogram Normalized Count P(rk)=nk/MN N columns level count 2 1 7 3 45 4 100 6 120 200 Normalized histogram(plot it) 1 0.5 0 100 200 Grad level(0-255) rk Histogram, color v.8b

Answer2: Exercise 2 : In each histogram (a) Identify the gray levels that have not been used. (b) Which gray level is the highest? Bright image Histogram1 Pixels are concentrated at too high grade levels Answer: Histogram 1: 0->130 Histogram 2: 0->90, 140255 (b) Histogram 1, around255. Histogram 2 around 100 Low contrast image Histogram2 Pixels are concentrated at too low grade levels, Distribution is too narrow. Both images are not ideal: too bright or too dark. To fix it, use histogram equalization Histogram, color v.8b 0 50 100 150 200 250 300

Answer3a: Ex3 A numerical exercise Histogram, color v.8b 37

Answer 3b:Matlab : Exercise 4: %note index is shifted because matrix cannot have zero index n(1)= 790 n(2)= 1023 n(3)= 850 n(4)= 656 n(5)= 329 n(6)= 245 n(7)= 122 n(8)= 81 M =64 N =64 L =8 for j=1:L p(j)=n(j) temp=0 for k=1:j temp=n(k)+temp end s(j)=((L-1)/(M*N))*temp n s Round(s) s = 1.3501 3.0984 4.5510 5.6721 6.2344 6.6531 6.8616 7.0000 n = 790 1023 850 656 329 245 122 81 Roudn s= 1 3 5 6 6 7 7 7 Histogram, color v.8b

Answer4: Exercise 4: Based on (1) we want to prove ps(s)= constant The Second Fundamental Theorem of Calculus http://www.ltcconline.net/greenl/courses/105/Antiderivatives/secfund.htm Histogram, color v.8b Conclusion: if formula (1) is true, ps(s) is a constant

Answer5: Ex 5 (a) A numerical exercise, fill in the blanks (b) when rk=source_image(x,y)=4, newimage(x,y) will become ?_6_. (c) What is the relation of the variables : Total , M,N and nk? Answer: Total=M*N=Sum of all nk=0,1,..,Total Answer (d, e) In a certain image, the "histogram back projection of a gray level " means the probability of a pixel having that gray level. So "histogram back projection” is the same as pr (rk). Say, in this image the probability a pixel having pixel level rk=2 is 0.0078 or a pixel having pixel level rk=4 is 0.02393. That means in this image, the "histogram  back projection" of a pixel having pixel level 2 is 0.0078 or the "histogram back projection" of a pixel having pixel level 2 is 0.02393. Histogram, color v.8b

Exercise 6: From RGB (3x8-bit) to HSV max= max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) Ex6: Find R,G,B values and the color of each of following cases: when V=0.5,H=0o,S=1. when V=0.2,H=120o,S=0.8 when V=0.6,H=260o,S=0.5. when V=0,H=0o,S=1. H=0-120 120-240 240-260 H1=0-2 2-4 4-6 Histogram, color v.8b

Answer 6a,b:Exercise 6: From RGB (3x8-bit) to HSV Histogram, color v.8b Answer 6a,b:Exercise 6: From RGB (3x8-bit) to HSV 6a) when V=0.5,H=0,S=1, the color is : From (7) max=0.5*255=127.5 From (8) S=(max-min)/max=1, max-min=max, hence min=0, Since H=0, the only formula for H1 is (3), because the other formulas will make H more than 0 From (3) H1 = (G-B)/(max-min) (G-B)/127.5=0 , so G=B=0 The color is pure red. ---------------------------------------- 6b) V=0.2,H=120,S=0.8 H=120 hence H1=2 by formula (6) From (7) max=0.2*255=51 From (8) S=(max-min)/max=0.8, max-min=0.8*max, hence min=0.2*max=10.2 Since H1=2, G max be max, the only formula for H1 is (4), because the other formulas will make H1 deviate too much from 2 From (4) H1 =2+ (B-R)/(max-min) 2+(B-R)/(51-10.2)=2 , so G=B=0 is the only solution The color is pure green. max=max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) H=0-120 120-240 240-260 H1=0-2 2-4 4-6

Answer 6c:Exercise 6: From RGB (3x8-bit) to HSV Histogram, color v.8b Answer 6c:Exercise 6: From RGB (3x8-bit) to HSV 6c) when V=0.6,H=260,S=0.5, the color is : From (eq7) max=0.6*255=153 From (eq8) S=(max-min)/max=0.5, max-min=0.5*max, hence min=0.5*max=76.5 Since H=260, from (eq6) H1=260/60=4.333, the only formula for H1 is (eq5), because the other formulas will make H1 outside 4 to 6 From (eq5) H1 = 4 + (R-G)/(max-min) 4 + (R-G)/(max-min) =4.333 R-G= 0.333*(153-76.5)=25.47 B=max=153, R-G=25.47, hence R must be bigger than G, hence G=76.5, so R=G+min=76.5+25.47 =101.97 The color (R,G,B)=(153,101.97,76.6) The color is purple. ---------------------------------------- max=max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) Hue 0->360o) H=0-120 120-240 240-260 H1=0-2 2-4 4-6

Answer 6d,e:Exercise 6: From RGB (3x8-bit) to HSV Histogram, color v.8b Answer 6d,e:Exercise 6: From RGB (3x8-bit) to HSV 6d) when V=0,H=0,S=1, From (eq7) max=V*255=0*255=0, so min must be 0. (R,G,B)=(0,0,0) The color is black. ---------------------------------- 6e) when V=1,H=0,S=1, From (eq7) max=V*255=1*255=255, H=0, from (eq6) H1=0, the only formula for H1 is (eq3), because the other formulas will make H1 outside 0 to 2 From (eq3) H1 =(R-G)/(max-min) (R-G)/(max-min) = R-G= 0.333*(153-76.5)=25.47 B=max=153, R-G=25.47, hence R must be bigger than G, hence G=76.5, so R=G+min=76.5+25.47 =101.97 The color (R,G,B)=(153,101.97,76.6) The color is purple. ---------------------------------------- max=max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) Hue 0->360o) H=0-120 120-240 240-260 H1=0-2 2-4 4-6

Answer 6:Exercise 6: From RGB (3x8-bit) to HSV max=max_value(R,G,B) ------------------(1) min=min_value(R,G,B) --------------------(2) if R = max, H1 = (G-B)/(max-min) -------(3) if G = max, H1 = 2 + (B-R)/(max-min)---(4) if B = max, H1 = 4 + (R-G)/(max-min) ---(5) H = H1 * 60------------------------------------(6) V=max/255------------------------------------(7) if H < 0, H = H + 360 s=(max-min)/max---------------------------(8) Hue (0-> 360o) Histogram, color v.8b

Answer7 for ex7 RGB=(18,200,130). Can normalize it first What are the values in HSV? Answer: (for HSV on R=18/255, G=200/255, B=130/255), max=200/255, m=18/255, since green G=max H1=2+(B-R)/(max-min), H1= H1=2+(130-18)/(200-18)=2+(112/182)=2.615, need not to show 255 since they cancel each other in numerator and denominator H=H1*60=156.9 S=(max-min)/max=(200-18)/200=0.91 V=max/255=0.78 HSL, HSI , see formulas in note Histogram, color v.8b

a) Y=0.0260 %matlab n=[ 14 57 235 615 812 500 202 65 ] 50*50-sum(n) 'shoudl be 0' sum(x) pr=x/(50*50) %hence Y=65/(50*50)= 0.0260 Answer b: equalisation better with higher bits per pixel, but round %Make the picture looks better, better gray level distribution Answer8 (b): equalisation better with higher bits per pixel, but round %Make the picture looks better, better gray level distribution (c) (d) Use RGB to HSV or HSI. V or I is the intensity image, equalization V or I And replace V or I or the original picture. r(k) N(k) Pr(r(k)) S(k) Round off (S(k)) r(0) 14  0.0056  0.0392  0 r(1) 57  0.0228  0.1988 r(2) 235  0.0940  0.8568  1 r(3) 615  0.2460  2.5788  3 r(4) 812  0.3248  4.8524  5 r(5) 500  0.2000  6.2524  6 r(6) 202  0.0808  6.8180  7 r(7) 65  Y  7.0000 Histogram, color v.8b