如何使用OpenCV对物体进行搜索检测与识别( 四 )

< numShowRects):x, y, w, h = rectcv2.rectangle(imOut, (x, y), (x+w, y+h), (0, 255, 0), 1, cv2.LINE_AA)else:break# show outputcv2.imshow("Output", imOut)# record key pressk = cv2.waitKey(0) & 0xFF# m is pressedif k == 109:# increase total number of rectangles to show by incrementnumShowRects += increment# l is pressedelif k == 108 and numShowRects > increment:# decrease total number of rectangles to show by incrementnumShowRects -= increment# q is pressedelif k == 113:break# close image show windowcv2.destroyAllWindows()