Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

AttributeError: module 'cv2.cv2' has no attribute 'fillpoly'

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)

AttributeError: module 'cv2.cv2' has no attribute 'fillpoly'

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>>>>>>>>>>> code>>>>>>>>>>>

Blockquote

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)

Blockquote

AttributeError: module 'cv2.cv2' has no attribute 'fillpoly'

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>>>>>>>>>>>out C:\fakepath\Capture.PNG

Blockquote

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)

Blockquote

click to hide/show revision 4
No.4 Revision

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

berak gravatar image

AttributeError: module 'cv2.cv2' has no attribute 'fillpoly'

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 C:\fakepath\Capture.PNGout 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)