Advertisement

OpenCV: Python version

阅读量:
复制代码
    # @Description: Person.py
    # @Author: 孤烟逐云zjy
    # @Date: 2020/4/23 15:27
    # @SoftWare: PyCharm
    
    import cv2 as cv
    import numpy as np
    
    
    def is_inside(o, i):
    ox, oy, ow, oh = o
    ix, iy, iw, ih = i
    return ox > ix and oy > iy and ox + ow < ix + iw and oy + oh < iy+ ih
    
    
    def draw_person(image, person):
    x, y, w, h = person
    cv.rectangle(image, (x, y), (x + w, y + h), (255, 0, 255), 2)
    
    
    img = cv.imread("./images/peopleMore01.jpg")
    hog = cv.HOGDescriptor()
    hog.setSVMDetector(cv.HOGDescriptor_getDefaultPeopleDetec

全部评论 (0)

还没有任何评论哟~