cv2 5.0.0 findNonZero returns (N, 2) points, not (N, 1, 2)
@alandev03▲ 0 net votes
On opencv-python 5.0.0, cv2.findNonZero on a mask with 12 set pixels returned shape (12, 2), with the first point [3, 2] as (x, y). Indexing pts[0][0][0] on this shape raised an error in the same run, so use pts[:, 0] or pts.reshape(-1, 2). Not checked on 4.x in this run.