How to straighten a curved image?

A

anonym

Hi,

I have a curved image and I want to measure the length of this
curved image. Can I do this without straightening it out ?

If not, then how to straighten the image? For example, given a curved
image like a "S", how to straighten it out to form a vertical line ?

Is there any image processing software/library/code for this ? I found
a few, but all require the user to manually select the points/nodes
along which the image is to be straightened.

Any help is appreciated. Thanks.
 
A

Andrew Thompson

anonym wrote:
...
Is there any image processing software/library/code for this ?

'Wetware' springs to mind.
..I found
a few, but all require the user to manually select the points/nodes
along which the image is to be straightened.

Open source? Freeware? Would you like an AI with that?
 
L

Lasse Reichstein Nielsen

anonym said:
I have a curved image and I want to measure the length of this
curved image. Can I do this without straightening it out ?

Length in pixels? How do you *define* the length of a "curve" of pixels?
How do you define "curve", even?
If not, then how to straighten the image? For example, given a curved
image like a "S", how to straighten it out to form a vertical line ?

Here you go:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scale to fit :)

If you can straighten it to a vertical line, then you already know the
length.
Is there any image processing software/library/code for this ? I found
a few, but all require the user to manually select the points/nodes
along which the image is to be straightened.

Try searching for "edge detection". The first thing you need is to
find the pixels that comprise the curve. When you have those, you'll
have to define how length is measured.

/L
 
O

Owen Jacobson

Length in pixels? How do you *define* the length of a "curve" of pixels?
How do you define "curve", even?


Here you go:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scale to fit :)

If you can straighten it to a vertical line, then you already know the
length.


Try searching for "edge detection". The first thing you need is to
find the pixels that comprise the curve. When you have those, you'll
have to define how length is measured.

One approach might be to use the points to concoct a parametric
function defining a curve of best fit. Once you have a description of
a curve (note that it's not "the" curve, just "a" curve) that fits the
points, you can take its length a number of ways.

Implementation left as an exercise. ;)
 
J

Jeff Higgins

anonym said:
Hi,

I have a curved image and I want to measure the length of this
curved image. Can I do this without straightening it out ?

If not, then how to straighten the image? For example, given a curved
image like a "S", how to straighten it out to form a vertical line ?

Is there any image processing software/library/code for this ? I found
a few, but all require the user to manually select the points/nodes
along which the image is to be straightened.

Any help is appreciated. Thanks.

Gee, thanks for posing the question. The first result of a web search
produced a link to Straighten Curved Objects plugin for ImageJ.
I had no idea such existed. A good bit of user interaction is involved
so probably will not be much good for batch straightening.

<http://rsb.info.nih.gov/ij/plugins/straighten.html>

Maybe java.awt.Shape, and java.awt.geom.PathIterator will help.
Probably not for auto-finding curved shapes in an image though.

JH
 
?

=?ISO-8859-1?Q?Roger_Lindsj=F6?=

anonym said:
Hi,

I have a curved image and I want to measure the length of this
curved image. Can I do this without straightening it out ?

If not, then how to straighten the image? For example, given a curved
image like a "S", how to straighten it out to form a vertical line ?

Is there any image processing software/library/code for this ? I found
a few, but all require the user to manually select the points/nodes
along which the image is to be straightened.

If you have some constraints such as that the image is made of lines
with a constant width, then you could just measure the area of the image.

I'm not even sure who to solve it for the general case, say you have a
figure that looks as a line 2 pixels wide and 2 pixels long how long
would it be if you straighten it? Say we label the pixels like this:

ab
cd

One solution would be 2 pixels if it is a line 2 pixels wide, the line
goes left to right from (ac) to (bd). Another could be 4 pixels if the
line is 1 pixel wide and goes travels (a)->(b)->(d)->(c). I'm not sure
how we would measure the length if the line instead traveled
(a)->(d)->(c)->(b).

//Roger Lindsjö
 
M

Michael Jung

Owen Jacobson said:
One approach might be to use the points to concoct a parametric
function defining a curve of best fit. Once you have a description of
a curve (note that it's not "the" curve, just "a" curve) that fits the
points, you can take its length a number of ways.
Implementation left as an exercise. ;)

I'd count the number of pixels, if the "curve" is given as a
collection of pixels. (For the advanced: take anti-aliasing into
account by considering gray values as partial pixels.) Then divide by
the resolution.

If it is already given parametrized, just compute the appropriate
integral by a suitable approximation.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top