cv2.rectangle missing one side
please help me out... I'm trying to draw a rectangle using the cv2.rectangle method and one side of the rectangle is not drawn.
test = cv2.imread('warped_example.jpg')
cv2.rectangle(test,(871,700),(1071,560),(0,255,0), 2)
plt.imshow(out_img)
try to zoom image
increase lineSize for large images
Apparently, the viewer uses nearest neighbour interpolation as default, which often causes surprises. Using some other method would be adviseable.
I noticed that you started bottom that is x, y(871, 700), then move up to x1, y1(1071, 560). The y2 is wrong, it is offset by x1, y1. But y1 is wrong. I suggest you start from top to bottom x, y(871, 560) and x1, y1(1071, 700). The (871,700),(1071,560),(0,255,0), 2) is refer to
cv2.line
. notcv2.rectangle
.As @LBerger, @berak, @mvuori are wrong, They do not understand command
cv2.rectangle
.The(1071,560)
is offset and doesn't return to location ofy
.@supra56 no need to such an unnecessary comment above