Path: news.mathworks.com!not-for-mail
From: "Ignazioc calo" <ignazioc@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: calculate distance on particular direction.
Date: Sun, 3 Jul 2011 17:50:24 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <iuqa50$1um$1@newscl01ah.mathworks.com>
Reply-To: "Ignazioc calo" <ignazioc@gmail.com>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1309715424 2006 172.30.248.35 (3 Jul 2011 17:50:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 3 Jul 2011 17:50:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2921051
Xref: news.mathworks.com comp.soft-sys.matlab:734725

hi, i have a BW image, i found centroids and boundaries for each blob.
now i need to calculate some distances between centroids and boundaries on particular directions.
i solved the simple problem for 0/90/180/270 degrees, now i have some doubt for the other directions, like 45 or 30 degree..
i tried two possible solution:
1) rotate image and reuse the same approach used for orthogonal axes
2) check for every point in boundaries his angle with centroid, if this angle == 45 i found a point and i can calculate euclidean distance.
i think  both approaches aren't very smart and i'm pretty sure that someone here can show me a better way to solve this problem.

thanks in advance..