有没有一种简单的方法可以将OpenCV图像坐标系的原点更改为左下角?使用numpy
例如?我正在使用 OpenCv 2.4.12 和 Python 2.7。
有关的:Numpy 翻转坐标系 https://stackoverflow.com/questions/31527016/numpy-flipped-coordinate-system,但这只是显示。我想要一些可以在我的算法中一致使用的东西。
Update:
def imread(*args, **kwargs):
img = plt.imread(*args, **kwargs)
img = np.flipud(img)
return img
#read reference image using cv2.imread
imref=cv2.imread('D:\\users\\gayathri\\all\\new\\CoilA\\Resized_Results\\coilA_1.png',-1)
cv2.circle(imref, (0,0),30,(0,0,255),2,8,0)
cv2.imshow('imref',imref)
#read the same image using imread function
im=imread('D:\\users\\gayathri\\all\\new\\CoilA\\Resized_Results\\coilA_1.png',-1)
img= im.copy()
cv2.circle(img, (0,0),30,(0,0,255),2,8,0)
cv2.imshow('img',img)
Image read using cv2.imread:
Image flipped using imread function:
如图所示,在原始图像和翻转图像中,圆都是在左上角的原点处绘制的。但图像看起来翻转了,这是我不希望的。