Search code examples
python-3.xopencvface-recognitionbounding-boxdrawrectangle

i'm stuck on show bounding box. these error (cv2.rectangle(img(x1,y1), (x2,y2), (0,255,0),2) TypeError: 'numpy.ndarray' object is not callable )


these are the code that's i try

y1,x1,y2,x2 = faceLoc
y1, x1, y2, x2 =  y1*4,x1*4,y2*4,x2*4
cv2.rectangle(img(x1,y1), (x2,y2), (0,255,0),2)

Solution

  • You are missing a comma after "img":

    cv2.rectangle(img, (x1,y1), (x2,y2), (0,255,0),2)