OpenCV

作者: 恒忏 | 来源:发表于2018-01-01 10:55 被阅读0次

    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()
    

    相关文章

      网友评论

          本文标题:OpenCV

          本文链接:https://www.haomeiwen.com/subject/rottnxtx.html