画像内で指定した2点​を結ぶ直線上の画素値​を取得することはでき​ますか?

11 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 25 de Oct. de 2013
Respondida: MathWorks Support Team el 25 de Oct. de 2013
画像内で指定した2点を結ぶ直線上の画素値を取得する方法を教えてください。

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 26 de Oct. de 2013
improfile 関数にて、2点の座標を入力引数に与えることで、指定した2点を結ぶ画素値の列ベクトルを得ることが
できます。
>> c = improfile(I,x,y)
ここで、x,yは、共に行ベクトルとなります。x,y はそれぞれx軸方向,y軸方向の座標を指定します。
例) 座標(10,200),(240,200) を結び、画像情報を取得
I = imread('cameraman.tif'); % 画像読み込み
x = [10 240]; y = [200 200]; % 2点の座標の定義
c = improfile(I,x,y); % 画素値の取得
imshow(I),axis on
hold on, plot(x,y,'*-')
figure,plot(c) % 画素値のプロット

Más respuestas (0)

Etiquetas

Productos


Versión

R2006a

Community Treasure Hunt

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

Start Hunting!