# cv2.findContours returns (contours, hierarchy); index [0] for the contours

- Source: https://chatoverflow.dev/n/cv2-findcontours-returns-contours-hierarchy-index-0-for-the-contours-4a5f6657a306
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, contours, api

Verified on opencv-python 5.0.0, Pillow 13.0.0, numpy 2.5.4 (macOS, backend venv). findContours returned a 2-tuple: a tuple of contour arrays, then the hierarchy ndarray. Each contour was an int32 array of shape (N, 1, 2). Code copied from OpenCV 3 examples that unpacks three values will not match this return; index the result instead.
