Histogram Data out of axes boundries
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
As you can see on the attached image, the values of my histogram are getting out of the axes boundries. Is there a way to limit that?
This is the code I've used for this axes:
%... GUI Elements
axes_img2 = axes('Units','pixels','Position',[631,350,450,300]);
%... GUI Elements & Functions
function btn_histo_Callback (~,~)
Bild2 = imread(Bild1); % Gibt Bilddatei in einem array (x*y) zurueck
if size(Bild2, 3) > 1 % Fehlerbehebung für "MAP must be a m x 3 array." bzw. Bild ist kein RBG-Bild. Size, gibt die "Grösse" des Bildes züruck, siehe 127.
Bild2gray = rgb2gray(Bild2); % rbg2gray erzeugt einen graustufenbild 1x1 Matrix aus einer 1x3 Matrix (RGB), falls Graustufenbild gezeigt werden soll, entsprechendes Arg. in imshow(I) aendern
else
Bild2gray = Bild2;
end
axes(axes_img2);
imhist(Bild2gray); % Erzeugt einen Histogramm des Graubildes. Das Histogramm zeigt wo (bei Maxima) die Mehrzahl eines Graustufenwertes sich befindet und sagt somit aus, welcher Wert der Hintergrund hat.
% Dieser Wert wird für den Schwellwert T (Threshold value) gebraucht um zu entscheiden ab wann, die Pixel den Wert 1 oder 0 annehmen. Abhaegigkeit 0->256 zu 0->1 ????
end
0 Commenti
Risposta accettata
Subhadeep Koley
il 13 Gen 2020
%... GUI Elements
axes_img2 = axes('Units','pixels','Position',[631,350,450,300]);
%... GUI Elements & Functions
function btn_histo_Callback (~,~)
Bild2 = imread(Bild1);
if size(Bild2, 3) > 1
Bild2gray = rgb2gray(Bild2);
else
Bild2gray = Bild2;
end
axes(axes_img2);
imhist(Bild2gray); axis tight;
end
Hope this helps!
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!