这是一个开始
get the coordinates of the image by click the mouse.
eg:
o(x,y)
get the 2 dims so you must first do grayscale processing.
实现的功能是通过鼠标的点击,获得图片的相应的坐标
图片的缩放,或改变图片的坐标位置的大小
原理参见:
opencv图片的缩放的数学原理
# 图片坐标获取的方法:
# -*- coding:utf-8 -*-
import cv2
img=cv2.imread("4.jpg") # 定片位置
img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # 转化为灰度图
# 图片的缩放
#size=img.shape
#img=cv2.resize(img,(size[1]//2,size[0]//2),cv2.INTER_LINEAR)