简体   繁体   English

图像旋转后像素值改变

[英]pixel value change after image rotate

Is it possible the value pixel of image is change after image rotate? 图像旋转后图像的像素值是否可能改变? I rotate an image, ex, I rotate image 13 degree, so I pick a random pixel before the image rotate and say it X, then I brute force in image has been rotate, and I not found pixel value as same as X. so is it possible the value pixel can change after image rotate? 我旋转图像,例如,将图像旋转13度,所以我在图像旋转之前选择了一个随机像素并说X,然后图像中的蛮力已经旋转,而我找不到与X相同的像素值。图像旋转后像素值可能会改变吗? I rotate with opencv library in python. 我用python中的opencv库旋转。

Any help would be appreciated. 任何帮助,将不胜感激。

Yes, it is possible for the initial pixel value not to be found in the transformed image. 是的,在转换后的图像中可能找不到初始像素值。

To understand why this would happen, remember that pixels are not infinitely small dots, but they are rectangles with horizontal and vertical sides, with small but non-zero width and height. 要了解为什么会发生这种情况,请记住像素不是无限小的点,而是像素,它们是具有水平垂直边的矩形,其宽度和高度很小,但不为零。

After a 13 degrees rotation, these rectangles (which have constant color inside) will not have their sides horizontal and vertical anymore. 旋转13度后,这些矩形(内部具有恒定的颜色)将不再具有水平和垂直的边。

Therefore an approximation needs to be made in order to represent the rotated image using pixels of constant color, with sides horizontal and vertical. 因此,需要进行近似以便使用具有恒定颜色的像素(水平和垂直的侧面)来表示旋转的图像。

If you just rotate the same image plane the image pixels will remain same. 如果仅旋转同一图像平面,则图像像素将保持不变。 Simple maths 简单的数学

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM