필터 지우기
필터 지우기

A problem in using imhist to display histogram of indexed image

조회 수: 1 (최근 30일)
Iman Ansari
Iman Ansari 2016년 1월 28일
First i convert the image to an indexed image, and use only 5 colors to show what is my problem.
clear
img = imread('peppers.png');
[x,map] = rgb2ind(img,5);
figure;
imhist(x,map)
the colorbar doesn't match with the histogarm bars, this is my colormap:
map =
0.2784 0.1373 0.2353
0.7608 0.1686 0.1373
0.8902 0.7255 0.6353
0.4275 0.3765 0.2235
0.8471 0.5569 0.1020
the first one isn't white, It seems that the colorbar is shifted by one.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by