determine a point curve

i have a vector with the x points, and another with the y points.
could anyone help me with the matlab code for the following objective: determine the ‘’first’’ intersection point in order to obtain only (the data points of ) the closed curve(inside red).
this intersection point is not necessarily a x,y point from my data, but belongs to the its line. Also, the intersections can be located at the left of the closed curve (as in this figure) or at the right.
So my objective is just to know the ‘’first’’ intersection point.
Thank you very very much.

 채택된 답변

Image Analyst
Image Analyst 2012년 9월 26일

0 개 추천

Are you starting with the RGB image of some cartoon someone drew by hand? Or do you have actual numerical data for the lines/curves? I also don't know what this means: " intersection point is not necessarily a x,y point from my data, but belongs to the its line" What is an "its" line? How do you define "first" intersection point when there is substantial overlap of two curves?

댓글 수: 8

joo
joo 2012년 9월 26일
no, no. it is all numerical data. i meant that i want the 'first intersection' between the two lines (it can be a point that it is not in my sampled data). am i clear? i sent you the excel file. thank you!
joo
joo 2012년 9월 26일
if you could just tell me how to do it just in this case it would be perfect! thank you very much!
Image Analyst
Image Analyst 2012년 9월 26일
Sorry I don't have any code for that all ready to go, plus my email doesn't take attachments and I never look at it. I'd have to write custom code and you can do that just as well as I can (well, almost).
joo
joo 2012년 9월 26일
i have been searching, i think the correct term for what i need is self intersection of the line itself. thank you very much.
Image Analyst
Image Analyst 2012년 9월 26일
joo
joo 2012년 9월 26일
no... but i think the code is not appropriate since what i have is a closed curve and a polygon is all about straight lines. am i wrong? i am trying for days, but I find very strange the inexistence of code to this simple problem: self intersection of the line itself. Maybe I am missing some good word.
Again thank you very very much for your help and kindness.
Image Analyst
Image Analyst 2012년 9월 27일
I don't see any difference between a closed curve and a polygon. Your "closed curve" is made up of an ordered set of (x,y) coordinates isn't it? So why can't those be considered as endpoints of a straight line segment? So you could do the brute force case of seeing if any adjacent pairs of vertices (i.e. a single line segment) crosses any other line segment in the list of coordinates. You'll easily find web sites that explain exactly how to do that like: http://bloggingmath.wordpress.com/2009/05/29/line-segment-intersection/, http://ptspts.blogspot.com/2010/06/how-to-determine-if-two-line-segments.html, http://mathforum.org/kb/thread.jspa?forumID=226&threadID=1312304&messageID=4142617, etc.
joo
joo 2012년 9월 28일
ok. i made it! thank you very much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

태그

질문:

joo
2012년 9월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by