hello, I am receiving an error . It says Undefined function or variable 'grayImage'. please let me know how i can define the function . here is my code

4 vues (au cours des 30 derniers jours)
[pixelCount, grayLevels] = imhist(grayImage);
bar(grayLevels, pixelCount); % Plot it as a bar chart.
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlabel('Gray Level', 'FontSize', fontSize);
ylabel('Pixel Count', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.

Réponse acceptée

Peng Li
Peng Li le 30 Mar 2020
you have to have image data first which the grayImage is supposed to be. you can use imread to read an image in your disk for example.
  3 commentaires
Peng Li
Peng Li le 30 Mar 2020
I = imread('pout.tif');
[count, level] = imhist(rgb2gray(I));

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by