Error on making a simple canny converison

asked 2018-01-30 09:41:53 -0500

updated 2018-01-30 09:47:10 -0500

berak gravatar image

Here's my code:

import cv2
import numpy as np
from matplotlib import pyplot as plt

def roi(img, vertices):

    mask = np.zeros_like(img)
    cv2.fillPoly(mask, vertices, 255)
    masked = cv2.bitwise_and(img, mask)
    return masked

def main():

    while(True):
        cap = (cv2.VideoCapture('testvideo.mp4'))
        newCap = process_img(cap)
        ret, frame = cap.read()
        cv2.imshow('Edges',edged_frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

def process_img(original_image):

    processed_img = cv2.Canny(original_image, threshold1=200, threshold2=300)
    vertices = np.array([[10,500],[10,300], [300,200], [500,200], [800,300], [800,500]], np.int32)
    processed_img = roi(processed_img, [vertices])
    return processed_img





main()

and the error I get is "Required argument 'dy' (pos 2) not found"

edit retag flag offensive close merge delete

Comments

which opencv version is it, exactly ?

berak gravatar imageberak ( 2018-01-30 09:58:25 -0500 )edit