Histogram of a gray image in MATLAB | Digital image processing part-8
Вставка
- Опубліковано 15 вер 2024
- Histogram of an image in MATLAB | Digital image processing part-8
An image histogram is a chart that shows the distribution of intensities in an indexed or grayscale image. The hist function creates a histogram plot by defining n equally spaced bins, each representing a range of data values, and then calculating the number of pixels within each range.
There is a bug in the code. Since the array indexing for MATLAB starts from 1, compared to other languages where it starts from 0; this code in the video will generate an indexing error if value of any pixel g(i,j) is 0 which will render arr(m) to arr(0) hence the error. The correction would be as follows:
initiate a variable : n = 0 : 255;
line 12 : arr(g(i,j) + 1) = arr(g(i,j) + 1) +1;
stem(n , arr);
I am 1st😃😃
Would it be possible to actually count which is proportion of ecah color in the original imagine? Could I use digital image processing to sort and classify and imagine based on the amount of an specific color pixels on it? for example what % of green color exist on the imagine??
thank you for that demo can you send me the code