フィルターのクリア

How to detect the critical points on the boundary..?

1 回表示 (過去 30 日間)
harshal j
harshal j 2015 年 12 月 5 日
コメント済み: harshal j 2015 年 12 月 6 日
Hello, I want to detect the critical pints on the object boundary, i am not getting how to code it in the MATLAB, My algorithm is given below let ....x-3,x-2,x-1,x,x+1,x+2,x+3... are the points on the boundary if the perpendicular distance from the x and straight line joining x-1 & x+1, is greater than the threshold then x-1 and x+1 will be our critical points and if it is less than the threshold then we progressively examine the neighbors, like x-2,x-1,x,x+1,x+2,x+3 again if it is greater than the threshold then x-2 and x+2 will be critical points and if it is less then then follow the same process, let our first set of critical points on the boundary are X+5 and X-5. Then for finding out next critical points i have to check the perpendicular distance between x+6 and straight line joining the x+5 and x+7,and again if it is less than the threshold i have to continue the process.
i would like to know how code it with the less number of for loops,i Also like to know how to save the co-ordinates of critical points after finding it. If possible please help i am beginner in MATLAB programming, Thanks in advance
  2 件のコメント
Image Analyst
Image Analyst 2015 年 12 月 5 日
What perpendicular distance? This is a 1-D problem. There is no y, is there? So how can anything be perpendicular when everything lies along a 1-D number line? Can you provide a diagram of this?
harshal j
harshal j 2015 年 12 月 5 日
Thanks for the comment, this program is not 1-D program,This is 2-D programming each point is having x and y co-ordinates,
for your reference consider the points b-3,b-2,b-1,b,b+1,b+2,b+3. Where b is the point on the boundary with coordinate (x,y. each point on the boundary is 2-D. for your reference i have included the figure of the object.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2015 年 12 月 5 日
I'd just put that into a for loop - nothing wrong with for loops for tiny amounts of data like this.
  3 件のコメント
Image Analyst
Image Analyst 2015 年 12 月 5 日
Have a separate loop counter
numCritical = 1;
for k = 1 : length(X)
% Code...
if itsACriticalPoint
% Save x and y values of this point into the criticalPoints array.
criticalPoints(numCritical, 1) = X(k);
criticalPoints(numCritical, 2) = Y(k);
numCritical = numCritical + 1;
end
end
harshal j
harshal j 2015 年 12 月 6 日
Thank u so much for the answer it will solve my problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by