AttributeError: module 'cv2.cv2' has no attribute 'fillpoly' [closed]

asked 2019-11-24 00:34:18 -0600

Raghava gravatar image

updated 2019-11-24 03:31:46 -0600

berak gravatar image

Iam trying to do lane detection in opencv python I installed opencv using pip install opencv-python

and pip install opencv-contrib-python

I tried several ways but am getting this error please help me out code>>>>>>>>>>>

import cv2
import numpy as np

def canny(image):
    gray = cv2.cvtColor(lane_image,cv2.COLOR_RGB2GRAY)
    blur = cv2.GaussianBlur(gray,(5,5),0)
    canny = cv2.Canny(blur,50,150)
    return canny

def region_of_interest(image):
    height = image.shape[0]
    polygons = np.array([
    [(200,height),(1100,height),(550,250)]
    ])
    mask = np.zeros_like(image)
    cv2.fillpoly(mask,polygons,255)
    return mask


image = cv2.imread('test_image.jpg')
lane_image = np.copy(image)
canny = canny(lane_image)
cv2.imshow('result',region_of_interest(canny))
cv2.waitKey(0)
edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by berak
close date 2019-11-24 04:00:53.689612

Comments

seriously ?

berak gravatar imageberak ( 2019-11-24 02:17:28 -0600 )edit

yes please help me

Raghava gravatar imageRaghava ( 2019-11-24 03:25:52 -0600 )edit

please NO SCREENSHOTS OF CODE here ;(

let's revert your edit

berak gravatar imageberak ( 2019-11-24 03:30:17 -0600 )edit

off topics : read this

LBerger gravatar imageLBerger ( 2019-11-24 03:55:56 -0600 )edit
berak gravatar imageberak ( 2019-11-24 10:31:10 -0600 )edit