Skip to content

Instantly share code, notes, and snippets.

@nishanthbhat07
Last active July 14, 2021 18:25
Show Gist options
  • Save nishanthbhat07/9d87ab7a4bb779b7fb8e4ffdd0b6d5b4 to your computer and use it in GitHub Desktop.
Save nishanthbhat07/9d87ab7a4bb779b7fb8e4ffdd0b6d5b4 to your computer and use it in GitHub Desktop.
360 Rotation

Given an image, this function flips the image 90, 180, 270 and 360 degrees in java (android).

 Mat rotate(Mat image){
    Mat src = image;
    Mat dst1 = new Mat();
    /* -1 for 180deg rotation; 
        0 for flipping along x-axis; 
        1 for flipping along y-axis; */
    Core.flip(src, dst1, -1); 
    return dst1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment