图片坐标和数组坐标是相反的,坐标原点位于左上角 import numpy as np import cv2 height, width = 150, 200 img = np.zeros((height, width, 3), np.uint8) img[:, :] = [255, 255, 255] # Pixel position to draw at row, col = 20, 100 # Draw a square with position 20, 100 as the top le
opencv学习笔记(一)IplImage, CvMat, Mat 的关系 opencv中常见的与图像操作有关的数据容器有Mat,cvMat和IplImage,这三种类型都可以代表和显示图像,但是,Mat类型侧重于计算,数学性较高,openCV对Mat类型的计算也进行了优化.而CvMat和IplImage类型更侧重于“图像”,opencv对其中的图像操作(缩放.单通道提取.图像阈值操作等)进行了优化.在opencv2.0之前,opencv是完全用C实现的,但是,IplImage类型与CvMat类