automatically scale display range to eliminate outliers
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm currently using imagesc and imcontrast.
I was curious if it possible to have a script where it will automatically scale display range to eliminate outliers: 2% instead of manually changing the contrast when the figure is up.
0 Kommentare
Akzeptierte Antwort
Chunru
am 26 Apr. 2022
Bearbeitet: Chunru
am 26 Apr. 2022
y = randn(50, 50);
y (20, 20) = 1e8; % outlier
subplot(121)
imagesc(y); % outlier removed
colorbar
subplot(122)
imagesc_autoscale(y); % outlier removed
colorbar
function imagesc_autoscale(x)
s = prctile(x, [2 98], 'all');
imagesc(x);
clim(s);
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Explore and Edit Images with Image Viewer App finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!