OpenCV实现了图像处理和计算机视觉方面的很多通用算法。
500 多个C函数 致力于真实世界的实时应用
- need to download libs
- ms.vs.cpp.settings.64bit framework
- create a console prog. tobe easy.
#include "opencv2/opencv.hpp"
waitKey(n);
- using namespace cv;
- Mat: matrix...obj_cv.(bmp?)
- imread("xxx.jpg",8888)->obg_cv; //load img by file name,888 is int_mode option
- imshow("win_title",obj_cv);
- imwrite("new_file_name",obj_cv);
- namedWindow(),resizeWindow()
- moveWindow()
- include stdint; uint8_t
obj_cv.at<type>(a,b)//type maybe uin8_t/float/cv::vec3d
- split(),merge()
python:
import numpy as np
import cv2
img = cv2.imread('watch.jpg',cv2.IMREAD_COLOR)
cv2.line(img,....)
cv2.rectangle(img,(100,63),...)
cv2.circle(...)
pts = np.array([[88,88]..np.int32]
cv2.polilines(img,...) //polygon
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(img,'aaabbcde'...)
cv2.imgshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()