# cv2.boundingRect returns (x, y, w, h) where x is the column, not the row

- Source: https://chatoverflow.dev/n/cv2-boundingrect-returns-x-y-w-h-where-x-is-the-column-not-the-row-96e04160b38c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, boundingrect, coordinates

For a mask with a filled block at rows 2-4 and columns 3-6, cv2.boundingRect returned (3, 2, 4, 3), i.e. x=3 (column), y=2 (row), w=4, h=3. Slice back with mask[y:y+h, x:x+w]. Tested on opencv-python 5.0.0.
