How to do shear transformation Python

asked 2018-10-17 12:35:06 -0600

Caseguy gravatar image

updated 2018-10-17 12:41:59 -0600

berak gravatar image

Working on making a shear algoritme pixel by pixel.

i have the basic math which is

https://paste.ofcode.org/36ULUSQrvNWs...

from there i'm stuck and have problems progressing

edit retag flag offensive close merge delete

Comments

What can i do to get the help i need ?

Caseguy gravatar imageCaseguy ( 2018-10-17 12:38:28 -0600 )edit

have a look at remapping

berak gravatar imageberak ( 2018-10-17 12:41:03 -0600 )edit

" pixel by pixel." -- that's exactly the opposite, of how it should be done.

calculate the mapping once, re-use for any further image..

berak gravatar imageberak ( 2018-10-17 12:48:50 -0600 )edit

that i do not know to do. I'm in this big dilemma, i have to learn opencv and python at the same time, and python is so simpel my mind cant comprehend. Iknow that image shearing is an affine transformation, but how to make an algortihm out of it is getting to me. I'm stuck at the point of not knowing how to od it.

Caseguy gravatar imageCaseguy ( 2018-10-17 12:56:06 -0600 )edit

yea, noobs will be noobs. just take your sweet time. but learn, that blindly asking around won't get you anywhere. it's YOUR ellbow grease required here.

berak gravatar imageberak ( 2018-10-17 13:36:02 -0600 )edit

Hate it, i have to make the algortihm before 26th okt :D

Caseguy gravatar imageCaseguy ( 2018-10-17 13:48:50 -0600 )edit

again,we can't help you with the algorithm, or mend your (lack of) programming skills, sorry for being brutal, hate it

berak gravatar imageberak ( 2018-10-17 13:53:37 -0600 )edit

// Shear

    double shear = 2;

    vector_3 vertex0(-0.5,  0.5, 0); // v0  v3
    vector_3 vertex1(-0.5, -0.5, 0); //
    vector_3 vertex2( 0.5, -0.5, 0); //
    vector_3 vertex3( 0.5,  0.5, 0); // v1  v2

    vertex0.x = vertex0.x + shear*vertex0.y;
    vertex1.x = vertex1.x + shear*vertex1.y;
    vertex2.x = vertex2.x + shear*vertex2.y;
    vertex3.x = vertex3.x + shear*vertex3.y;
sjhalayka gravatar imagesjhalayka ( 2018-10-17 16:15:13 -0600 )edit

I do not understand much of that :/ sorry

Caseguy gravatar imageCaseguy ( 2018-10-17 16:40:28 -0600 )edit