What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Reply to thread

Your problem can not be done in Photoshop with any reasonable degree of precision because PS lacks a good simple programming interface to advanced mathematical procedures.  Rather, it is best done in a mathematical programming language such as Mathematica, Matlab, or any similar language that has decent graphical output capabilities. 


What you want to do is closely related to a classic mathematical problem known as "rectification of a curve" (ie,  finding the length of a specified section of a curve).  The solution to this problem was first given in the mid-1600's (http://www.maa.org/publications/periodicals/convergence/mathematical-treasures-van-heuraets-rectification-of-curves ).  


A basic summary of "rectification" is given in this Wikipedia article:

http://en.m.wikipedia.org/wiki/Arc_length


Most of the articles you will see on this topic assume that the curve is specified by analytical functions (eg, equations).  However, from the way you described the problem, it sounds like you need to do it when the curve is specified by data points, eg., (x, y) coordinates, not equations.  You can find quite a few articles on this by Googling {numerical rectification of a curve}.  The algorithms described in these articles will, of course, have to be modified for your particular variant of the problem, ie, the segments of "different colors", but that should be relatively easy to do by anyone with a good mathematical background.


If you need this done accurately, and there are either a lot of these curves, or each one is long, I really don't see any good alternative for you.  If math and mathematical programming at the junior or senior undergraduate level (in either math, physics, or engineering) is not your strong point, I would suggest that you team up with someone with those qualifications.


However, if you have to do only a small number of relatively short curves, and you can stand accuracies (ie, of the start and end points of each color segment) of order 10 or 20%, there is an old fashioned, completely manual procedure that I can describe if you are interested.


Cheers,


Tom  M


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top