How to detect different types of curves

470 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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.