Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For my class I need to graph the frequency of occurrence of each gray level for the image Flower.jpg that size [512, 512]. We cannot
For my class I need to graph the frequency of occurrence of each gray level for the image Flower.jpg that size [512, 512]. We cannot use the built in histogram function in MATlab an I am having trouble making a function that calculates the occurrences and plots on the histogram. Here is the code I attempted to use please help me fix it so the code will run and properly answer the question
1 2 % read in the image function h Questioni (lowekajpanh; I=imread('Flower.jpg'); figure; imshow(I); 3 - 4 - 5 6 7 - 8 % count the occurances of each gray level in the image h = zeros (512,1); for l=0:512 h(1+1)=sum ( sum(I 1));| end figure; bar(h); 9 10 11 12 13 14 15 16 % plot the occurances of each gray level on a histogram colormap(gray) imgagesc(h) z LULUI 24 Command Window CITOLI TILE. vues LIUI11.III LIIC Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses. >> Question1 fx Error: File: Question1.m Line: 2 Column: 24
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started