1ZLAB_Color_Block_Finder
1ZLAB_Color_Block_Finder copied to clipboard
can't run
in color_block_finder
bimg, contours, hier = cv2.findContours(img_bin, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
如果用opencv4.0版本以上的把 ’color_feature.py‘和’test_color_feature.py‘里面的 “bimg, contours, hier = cv2.findContours(img_bin,
cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)”改为: tmp = cv2.findContours(img_bin,cv2.RETR_CCOMP,cv2.CHAIN_APPROX_SIMPLE) contours = tmp[0] if len(tmp) == 2 else tmp[1]