Skip to main content
added 15 characters in body
Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

Here's a Manipulate that applies any affine transformation to an image. The 2-by-2 matrix transformation is in the upper 2-by-2 block of the affine function and the {b1,b2} parameters shift the image left-right and up-down.

img = Import["https://i.sstatic.net/pp27n.png"]; Manipulate[ GraphicsRow[{AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}], ImageTransformation[img, AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}]]}, ImageSize -> {600}], Row[{Control[{{a11, 1}, -1, 1}], Spacer[20], Control[{{a12, 0.015}, -1, 1}]}], Row[{Control[{{a21, 0.595}, -1, 1}], Spacer[20], Control[{{a22, 0.415}, -1, 1}]}], Row[{Control[{{b1, 0.225}, -1, 1}], Spacer[20], Control[{{b2, -0.03}, -1, 1}]}]] 

enter image description here

Here's a Manipulate that applies any affine transformation to an image. The 2-by-2 matrix is in the upper 2-by-2 block of the affine function and the {b1,b2} parameters shift the image left-right and up-down.

img = Import["https://i.sstatic.net/pp27n.png"]; Manipulate[ GraphicsRow[{AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}], ImageTransformation[img, AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}]]}, ImageSize -> {600}], Row[{Control[{{a11, 1}, -1, 1}], Spacer[20], Control[{{a12, 0.015}, -1, 1}]}], Row[{Control[{{a21, 0.595}, -1, 1}], Spacer[20], Control[{{a22, 0.415}, -1, 1}]}], Row[{Control[{{b1, 0.225}, -1, 1}], Spacer[20], Control[{{b2, -0.03}, -1, 1}]}]] 

enter image description here

Here's a Manipulate that applies any affine transformation to an image. The 2-by-2 matrix transformation is in the upper 2-by-2 block of the affine function and the {b1,b2} parameters shift the image left-right and up-down.

img = Import["https://i.sstatic.net/pp27n.png"]; Manipulate[ GraphicsRow[{AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}], ImageTransformation[img, AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}]]}, ImageSize -> {600}], Row[{Control[{{a11, 1}, -1, 1}], Spacer[20], Control[{{a12, 0.015}, -1, 1}]}], Row[{Control[{{a21, 0.595}, -1, 1}], Spacer[20], Control[{{a22, 0.415}, -1, 1}]}], Row[{Control[{{b1, 0.225}, -1, 1}], Spacer[20], Control[{{b2, -0.03}, -1, 1}]}]] 

enter image description here

Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

Here's a Manipulate that applies any affine transformation to an image. The 2-by-2 matrix is in the upper 2-by-2 block of the affine function and the {b1,b2} parameters shift the image left-right and up-down.

img = Import["https://i.sstatic.net/pp27n.png"]; Manipulate[ GraphicsRow[{AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}], ImageTransformation[img, AffineTransform[{{{a11, a12}, {a21, a22}}, {b1, b2}}]]}, ImageSize -> {600}], Row[{Control[{{a11, 1}, -1, 1}], Spacer[20], Control[{{a12, 0.015}, -1, 1}]}], Row[{Control[{{a21, 0.595}, -1, 1}], Spacer[20], Control[{{a22, 0.415}, -1, 1}]}], Row[{Control[{{b1, 0.225}, -1, 1}], Spacer[20], Control[{{b2, -0.03}, -1, 1}]}]] 

enter image description here