I am trying to crop an image after rotation , but unfortunately the crop is being done on original image instead of rotated image. I am using open cv . Here is my code for rotation -
rotateImage(event) {
var sampleimage = document.getElementById("sample");
console.log(sampleimage.height);
var scope = this;
if (event.target.id === "rotateC") {
rotate = rotate + 90;
// sampleimage.style.transform = "rotate(" + rotate + "deg)";
scope.imageRotate();
}
if (event.target.id === "rotateA") {
rotate = rotate - 90;
sampleimage.style.transform = "rotate(" + rotate + "deg)";
}}
Is there a simple solution for the same. Any help will be appreciated.