Apply a function in x and y for translation of pixels
Posted: 2008-02-29T13:03:55-07:00
Hi,
I've spent a few hours reading the documentation and could use some help.
What I'd like to do is "unwrap" an image of a label on a bottle so it can be read.
I've derived equations to determine how far to move pixels in x and y depending on their location in the image, assuming the bottle is vertical and centered in the image. I'm assuming I'll be able to unwrap about 120 - 160 degress of the label facing the camera.
Question: It appears that I should be using the convert command (?)
Question: It seems as though I could use an -affine matrix, but I can't figure out how to create an equation to translate the pixels as a function of x and y in the image?
I'm thinking something like this {1, 0, 0, 1, sin(a)*blah/blah, (x/y)*sin(b)/blah*blah} where a and b denote distance from the center of the image in x and y.
(the actual equations are much longer and totally different).
Question: Should I be using an -fx command instead? That one made less sense to me as to how I would apply it to this situation, especially because I have two variables and therefore two equations, one in x and one in y.
Question: Are there any help pages I am missing that describe this?
Thanks,
I've spent a few hours reading the documentation and could use some help.
What I'd like to do is "unwrap" an image of a label on a bottle so it can be read.
I've derived equations to determine how far to move pixels in x and y depending on their location in the image, assuming the bottle is vertical and centered in the image. I'm assuming I'll be able to unwrap about 120 - 160 degress of the label facing the camera.
Question: It appears that I should be using the convert command (?)
Question: It seems as though I could use an -affine matrix, but I can't figure out how to create an equation to translate the pixels as a function of x and y in the image?
I'm thinking something like this {1, 0, 0, 1, sin(a)*blah/blah, (x/y)*sin(b)/blah*blah} where a and b denote distance from the center of the image in x and y.
(the actual equations are much longer and totally different).
Question: Should I be using an -fx command instead? That one made less sense to me as to how I would apply it to this situation, especially because I have two variables and therefore two equations, one in x and one in y.
Question: Are there any help pages I am missing that describe this?
Thanks,