From: "Ignazioc calo" <>
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$>
Reply-To: "Ignazioc calo" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1309715424 2006 (3 Jul 2011 17:50:24 GMT)
NNTP-Posting-Date: Sun, 3 Jul 2011 17:50:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2921051
Xref: 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..