How to find the euclidean distance

답변 (1개)

Jan
Jan 2013년 3월 6일
편집: Jan 2013년 3월 6일

0 개 추천

The term "distance" implies, that there are two different objects. So you can calculate trhe distance from one object to another only. Currently you have a "568x1 image", what is a really unusual format for an image, which are usually rectangular. Then you need another 568 x 1 vector to calculate the distance to:
img = rand(568, 1); % Test data!
img2 = rand(568, 1); % Missing in your question
dist = sqrt(sum((img - img2) .^ 2));

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2013년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by