画像内の点の色相値を出す
-
21-12-2019 - |
質問
私は画像を持っています、そして私は画像上の特定の点から色相値を得ることができたいです。
私はImpixelを使って色の値を出ていましたが、SpeICIFCピクセルの色相値を取得するためのImpixelのような機能があるかどうか疑問に思いました。
解決
im = imread('peppers.png'); %// example image
im = im2double(im); %// convert to double values in [0, 1]
c = [12 146 410]; %// column coordinates of desired pixels
r = [104 156 129]; %// row coordinates of desired pixels
pixels = impixel(im,c,r); %// rgb values of pixels
hsv = rgb2hsv(pixels); %// convert to hsv
hue = hsv(:,1); %// hue is first column of hsv
. 所属していません StackOverflow