Reference no: EM133115223
ECE 4470 Computer Vision - California State University, Bakersfield
Lab: K-Means for Color Segmentation
Goals
• Compare two color spaces (RGB and HSV)
• Use color spaces for segmentation
• Evaluate different distance measures
Technical Approach
Part 1: Color Space Representation Color Space Evaluation
Figure: Image for evaluation
You will need to load in the color image provided "fruit.jpg'. The image is read in using a RGB color space. Using subplot, plot the original image and the respective RGB color channels. Note the datatype and values that are used to represent the RGB color space. Pick out five fruits with different color and evaluate their representation is each color channel. For instance, white is R-high, G-high, B-high.
It will be useful to use the Data Cursor tool to navigate through the data of the image. It is activated using the following symbol: Newer versions renamed the Data Cursor to Data Tips under the Tools menu of a figure window.
Now you will convert your image to the HSV (Hue, Saturation, and Value) color space. Use the rgb2hsv function to convert from RGB. How is HSV represented in MATLAB? Consult the doc file and explain the datatype used. Do the same evaluation you did in the RGB space for the HSV space. Pick the same fruits. Note any differences you see between the two spaces.
Part 2: Color Segmentation
For the five fruit you have chosen we will now use the color domain to attempt segmentation of the specific fruits. To do this we will be using the Euclidean distance function:
d(q,p) = √(Σi=1n(qi - pi)2)
Where q and p are two points on the image and n is the number of dimensions in your color space. Note that this function weights each dimension equally, however this may not always be wanted. To do the segmentation, you will find a representative point in your fruit. After finding a representative you will find the distance of every pixel in the image to that representative. This will give you an image of color differences. Then you can threshold your image with the following.
D % Difference image for color space.
Fruit = zeros(size(D));
Fruit (D < T) = 1;
This will give an image where the image is one where the distance is less than T and zero if it is greater than T. You will need to find an optimal T and dimensions for each fruit. You may only need to use one dimension for some fruits, this will come from your evaluation in part one. Do this evaluation for all 5 fruits and for both color spaces. Remember what is represented in the HSV space, in some cases you may only need H or S. Usually V will not be needed. Note which fruits had error and why.
How did both color spaces fair in the segmentation? Was one of them clearly better? Explain.
Is there a better distance measure for completing these segmentations? If so, explain why it is better.
Attachment:- Computer Vision.rar
|
What is the accrual accounting rate of return
: The estimated useful life is 10 years, with no salvage value. Amaro's minimum expected return is 14 percent. What is the accrual accounting rate of return
|
|
Why the purchasing power parity may not hold in reality
: Discuss why the purchasing power parity may not hold in reality.
|
|
How many years is the annuity
: An annuity pays $100 each year. It is worth $507.57 today. The annual interest rate is 5 percent. How many years is the annuity?
|
|
Find the price of a call option on the stock
: Find the price of a call option on the stock that has a stock price of $14 and that expires in 6 months. (Hint: Use daily compounding.)
|
|
ECE 4470 Computer Vision Assignment
: ECE 4470 Computer Vision Assignment Help and Solution, California State University, Bakersfield - Assessment Writing Service
|
|
Determine the machines second year depreciation
: The machine's useful life is estimated to be 5 years, or 210,000 units of product, Determine the machines second year depreciation
|
|
Healthcare leadership skills
: List each step of the decision making process. Include the importance of each step of the decision-making process
|
|
Determine the overhead variance
: During the year, 40,000 direct labor hours were worked. Actual overhead costs for the year were $340,000. Determine the overhead variance
|
|
Expected return and standard deviation
: Consider two stocks, Stock D, with an expected return of 11 percent and a standard deviation of 26 percent, and Stock I, an international company, with an expec
|