Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
distance2 つの異なるセットに属する 2 つのピクセルの間を見つけるにはどうすればよいですか? 私はそれを行うと思いますpdistが、単一のオブジェクトに対してですか?
distance
pdist
ありがとう。
ユークリッド距離を計算するだけです:
p1 % a 1x2 vector of the x y position of the first pixel p2 % a 1x2 vector of the x y position of the second pixel d = sqrt( ( p1(1)-p2(1) ).^2 + (p1(2)-p2(2)).^2 );