0

I got this code from online. Can someone help me what went wrong? Here's the snippet where the error popped up:

import cv2
import numpy as np

_, contours, _ = cv2.findContours(Nucleus_img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
pad_del = np.zeros_like(Nucleus_img)
Jeru Luke
  • 20,118
  • 13
  • 80
  • 87

1 Answers1

0

The CV2 findCountours function return 2 values, not 3. They are contours and hierarchy.

Change your code, for example:

contours, hierarchy = cv2.findContours(...)
jarmod
  • 71,565
  • 16
  • 115
  • 122