728x90
oepnCV motion detect
-
openCV를 이용한 motion detection 후 이미지 캡쳐 코드Machine Learning 2021. 2. 15. 17:57
def image(ipath,file, spath,name): global cnt,fp path = os.path.join(ipath, file) #file_name = file.split(".", 1)[0] #print(file_name) cap = cv.VideoCapture(path) firstframe = None fps = int(cap.get(5)) # cap.set(cv.CAP_PROP_FRAME_WIDTH, 680) # cap.set(cv.CAP_PROP_FRAME_HEIGHT, 480) print("fps : %s"%fps) if (fp==0): fp=input("crop fps : ") int(fp) # 배경빼기 fgbg = cv.createBackgroundSubtractorMOG2(..