It would therefore solve this problem nicely, but learning enough theory to properly understand and implement this solution may take you a considerable amount of time. (Think multiple weeks.) Sorry, but I don't know the theory. I did learn it at one point, but I forgot it somewhere in the last millennium.
If you're looking for easier heuristics I'd suggest something like this. Take the minimum and maximum values on the Y-axis. Suppose that range is 60-140. Divide the range into 20 pieces. (20 is arbitrary, try it with several other numbers until you get satisfactory results.) So you'd have intervals 60-64, 64-68, 68-72 and so on. Now make (overlapping) intervals of adjacent pairs. So you'd have 60-68, 64-72, 68-76 and so on. For each of those slices on the Y-axis there are one or more maximal intervals on the X-axis where you stay inside of the range. Compute all of those.
You now have a ton of overlapping intervals on the X-axis. Take out the longest interval you've got. That's a stable area. Then cut out the longest interval in what is left. And the largest that is left in that. And so on.
Then what you do is call all labels above a certain length stable, and you know their end points.
(The reason for making them overlapping is that if you have a stable interval varying around, say, 68, you want to notice it even if 68 is one of the boundaries of a vertical slice you're looking at.)
You'll have to play around with how many pieces to cut the vertical into, and how long a horizontal piece will be called stable. It won't be pretty code and you will need some playing around. But you will probably get somewhat reasonable results. And you won't have to learn a ton of math to do it properly.
In reply to Re: How to Determine Stable Y-Values... or Detect an Edge..?
by tilly
in thread How to Determine Stable Y-Values... or Detect an Edge..?
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |