Questions tagged [image-rotation]

Image rotation is performing a geometric rotation with certain angle on a particular image.

Image rotation is performing a geometric rotation with certain angle on a particular image. An image can be rotated by a positive angle or negative angle, which will rotate the image clockwise or counterclockwise. Rotating an image by 360 degrees or -360 degrees will actually result in the same image as the original image, while rotating on 180 or -180 degrees will display an inverted copy of the original image.

844 questions
10
votes
2 answers

rotating an image 90 degrees in java

I have managed to rotate an image 180 degrees but wish to rotate it 90 degrees clockwise can someone edit my code so that it does this with explanation. Thanks. private void rotateClockwise() { if(currentImage != null){ int…
Ryan Gibson
  • 283
  • 2
  • 3
  • 9
9
votes
1 answer

Rotating an image without the Image Processing Toolbox

I would like to rotate a non-squared image with Matlab: without using the imrotate function, since it is part of the Image Processing Toolbox, with the loose parameter, which means the size of the output differs from the size of the input…
Wok
  • 4,956
  • 7
  • 42
  • 64
9
votes
4 answers

help to calculate atan2 properly

I need to calculate the angle between lines. I need to calculate atan. So I am using such code static inline CGFloat angleBetweenLinesInRadians2(CGPoint line1Start, CGPoint line1End) { CGFloat dx = 0, dy = 0; dx = line1End.x -…
yozhik
  • 4,644
  • 14
  • 65
  • 98
9
votes
1 answer

understanding usage of ImageView Matrix

I know that SO is full of Matrix questions, but I can't find a question where it is fully explained. I guess that any ImageView has a Matrix which is responsible for scaling, rotating and the position. But why I can't rotate an Image using a Matrix…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
8
votes
2 answers

Rotate Images Around a Circle?

Please take a look at this app snapshot: This is a bank application. it has 6 buttons around the bank logo. You can rotate the images by click-and-hold in one of them and move your finger in either direction (clockwise or counter-clockwise). So,…
iTurki
  • 16,292
  • 20
  • 87
  • 132
8
votes
3 answers

How to get a Drawable that's a mirrored version of a different Drawable?

Background I know it's possible to create a rotated version of a Drawable (or Bitmap), as such (written about it here) : @JvmStatic fun getRotateDrawable(d: Drawable, angle: Int): Drawable { if (angle % 360 == 0) return d return…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
8
votes
1 answer

How to maintain white background when using opencv warpaffine

I'm trying to rotate image using void rotate(cv::Mat& src, double angle, cv::Mat& dst) { int len = std::max(src.cols, src.rows); cv::Point2f pt(len / 2., len / 2.); cv::Mat r = cv::getRotationMatrix2D(pt, angle, 1.0); …
Ruwanka De Silva
  • 3,555
  • 6
  • 35
  • 51
8
votes
2 answers

preview an image before uploading using FileReader, rotates the image

i saw many posts on viewing an image before uploading. one post had a very supposed to be easy method to implement using FileReader: function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); …
ufk
  • 30,912
  • 70
  • 235
  • 386
8
votes
4 answers

rotate dial in limited degrees

All I want rotate image in particular angle as like below image. I have code for rotation but it rotate 360 degree but I want it only for particular degrees and get the selected number which is upper side of dial. below is my code. My custom View…
8
votes
1 answer

How to move canvas speedometer needle slowly?

I use following codes in order to move a picture in canvas for my speedometer. var meter = new Image, needle = new Image; window.onload = function () { var c = document.getElementsByTagName('canvas')[0]; var ctx = c.getContext('2d'); …
user1874941
  • 3,013
  • 4
  • 20
  • 31
8
votes
2 answers

Obtain Rotation Axis from Rotation Matrix and translation vector in OpenCV

I have a chessboard in two images with some angle of rotation. Lets find the rotation angle of second image with reference of first image. For that I found the Rotation Matrix (3x3) and translation matrix (3x1) of those objects. How can I find the…
aranga
  • 377
  • 1
  • 6
  • 20
7
votes
3 answers

How do I rotate a PyTorch image tensor around it's center in a way that supports autograd?

I'd like to randomly rotate an image tensor (B, C, H, W) around it's center (2d rotation I think?). I would like to avoid using NumPy and Kornia, so that I basically only need to import from the torch module. I'm also not using…
ProGamerGov
  • 870
  • 1
  • 10
  • 23
7
votes
1 answer

How to rotate images at different angles randomly in tensorflow

I know that I can rotate images in tensorflow using tf.contrib.image.rotate. But suppose I want to apply the rotation randomly at an angle between -0.3 and 0.3 in radians as follows: images = tf.contrib.image.rotate(images,…
I. A
  • 2,252
  • 26
  • 65
7
votes
2 answers

Rotate JLabel or ImageIcon on Java Swing

first of all, this is the first week that I use swing, then sorry if my question is too obvious. Also, I need solutions that use the standard java libraries, since this is for homework and I'm not allowed to use strange libraries. I'm using JLabel…
dgnin
  • 1,565
  • 2
  • 20
  • 33
7
votes
1 answer

Camera image gets rotated when I upload to server

I either take photo or select a photo from gallery and show it in an ImageView as it should be (in terms of rotation). But, whenever I upload it to server, it always uploads in landscape mode, even though it is in portrait mode in my gallery. How…
Esteban
  • 667
  • 9
  • 22
1 2
3
56 57