-2

I'm trying to make a program to detect some points in curves and I want to separate 2 types of curves:

Open curve

Small cuve

I've got a set of points that define those lines and as this is not my strong side I don't know how I can, with a set of points, separate this 2 types. Can you help me?

Notes: Ignore the green line because it's for other processing. The red dot is the point where the line changes it's direction (up-down and down-up).

EDIT:

Data for the first image:

X:1172 Y:2626
X:1174 Y:2624
X:1177 Y:2620
X:1182 Y:2615
X:1188 Y:2607
X:1194 Y:2597
X:1198 Y:2586
X:1201 Y:2576
X:1202 Y:2569
X:1203 Y:2564
X:1203 Y:2562
X:1202 Y:2562
X:1202 Y:2562
X:1202 Y:2565
X:1201 Y:2571
X:1199 Y:2581
X:1196 Y:2593
X:1193 Y:2605
X:1194 Y:2614
X:1196 Y:2623
X:1199 Y:2629
X:1203 Y:2634
X:1208 Y:2636
X:1214 Y:2637
X:1221 Y:2636
X:1227 Y:2632
X:1235 Y:2625
X:1241 Y:2620
X:1244 Y:2612
X:1245 Y:2603
X:1247 Y:2597
X:1247 Y:2593
X:1246 Y:2589
X:1244 Y:2586
X:1243 Y:2585
X:1243 Y:2585

Data for the second image:

X:1258 Y:2632
X:1264 Y:2630
X:1269 Y:2627
X:1272 Y:2624
X:1276 Y:2619
X:1281 Y:2613
X:1283 Y:2608
X:1284 Y:2602
X:1284 Y:2598
X:1283 Y:2595
X:1282 Y:2590
X:1283 Y:2588
X:1284 Y:2584
X:1286 Y:2581
X:1287 Y:2579
X:1290 Y:2579
X:1293 Y:2579
X:1300 Y:2578
X:1306 Y:2578
X:1313 Y:2578
X:1318 Y:2580
X:1323 Y:2584
X:1325 Y:2589
X:1327 Y:2595
X:1326 Y:2603
X:1325 Y:2610
X:1324 Y:2616
X:1323 Y:2620
X:1322 Y:2623
X:1322 Y:2623
X:1322 Y:2623
X:1323 Y:2621
X:1324 Y:2618
X:1326 Y:2611
X:1328 Y:2604
X:1332 Y:2597
X:1337 Y:2591
X:1344 Y:2587
X:1352 Y:2584
X:1359 Y:2582

This data is from a Livescrive smartpen.

  • Do you have many points that are "near" the red dots? Samples of your data (one for the first case, one for the second case) might help. – David K May 03 '15 at 22:43
  • Are you saying that the first type of curve is "smooth" (the 2D derivative exists and is nonzero at the point) and the second is a "cusp" (the 2D one-sided derivatives exist and are in the opposite directions)? What about other types of curves such as "corners"? – Rory Daulton May 03 '15 at 22:48
  • @DavidK I updated the post with the data. – patricia May 03 '15 at 23:26
  • @RoryDaulton I only want to process this 2 types of curves that are close to the green line. I just can't differenciate them because I lack the math part to doing it. – patricia May 03 '15 at 23:27
  • It appears to me that the first data set goes with the second image and the second data set goes with the first image. Is this so? – Rory Daulton May 03 '15 at 23:52
  • The data look adequate for what you want to do, and I would recommend Rory Daulton's answer as a good approach. – David K May 04 '15 at 00:53
  • This would fit better at [dsp.se] or [so] –  May 04 '15 at 00:53

1 Answers1

2

Let's first analyze your first series, which goes with your second graphic.

enter image description here

You apparently want to analyze the points with the smallest values of $Y$, which are the points

X:1203 Y:2562

X:1202 Y:2562

X:1202 Y:2562

Note that both the $X$ and the $Y$ values change very little or not at all. In math this means that the curve is not "smooth" there. In your program you will need to decide that "very little" means in this context.

Be aware that it is possible for the $X$ and $Y$ values to drop to zero and for the curve to still look smooth, but it is unlikely.

Now the second series.

enter image description here

Again you apparently want to analyze the points with the smallest values of $Y$, which are all or some of the points

X:1287 Y:2579

X:1290 Y:2579

X:1293 Y:2579

X:1300 Y:2578

X:1306 Y:2578

X:1313 Y:2578

Note here that the $Y$ values also change little or not at all, but the $X$ values change by sizable amounts. The first three points have $X$ changes of $3$, which is close to stopping, but the other points change by $6$ or $7$. You could consider this evidence of a smooth curve. Again, you would need to decide how much change in $X$ is needed for this application.


This analysis is somewhat simplistic, since there are other possibilities we have not considered here. But if you are dealing only with these two types of curves, this strategy should suffice.

Rory Daulton
  • 32,288