I want to shear an image along the y-axis, but keeping a given x value in the same height. If I use a shear matrix as:
[1, 0, 0]
[s, 1, 0]
with s = the shear factor with the function "warpAffine", I do get my sheared image, but it's always with origin at 0,0. I need to have my origin at another x (and maybe even y).
So I think I should combine translation matrices, to translate the image to the left, perform the shear and translate the image back to the right, but I am unsure how to combine these matrices, since:
[1, 0, dx] [1, 0, 0] [1, 0, -dx]
[0, 1, dy] * [s, 1, 0] * [0, 1, -dy]
obviously won't work.
How can I perform a shearing operation on a chosen origin other than 0,0?