opencv-contour

openCV 2.4.10 bwlabel - connected components

两盒软妹~` 提交于 2019-11-26 21:30:33
问题 Here is the original code from matlab: % Calculate each separated object area cDist=regionprops(bwImg, 'Area'); cDist=[cDist.Area]; % Label each object [bwImgLabeled, ~]=bwlabel(bwImg); % Calculate min and max object size based on assumptions on the color % checker size maxLabelSize = prod(size(imageData)./[4 6]); minLabelSize = prod(size(imageData)./[4 6]./10); % Find label indices for objects that are too large or too small remInd = find(cDist > maxLabelSize); remInd = [remInd find(cDist <

How to use `cv2.findContours` in different OpenCV versions?

妖精的绣舞 提交于 2019-11-26 06:46:26
问题 I am trying to use OpenCV with Python in order to detect squares in a live video feed from a Raspberry Pi camera. However, the cv2.GaussianBlur and cv2.Canny functions in the code below are causing the following error: \"TypeError: numpy.ndarray\' object is not callable\" . I cannot seem to resolve the error. Any help is appreciated. Code taken from https://www.pyimagesearch.com/2015/05/04/target-acquired-finding-targets-in-drone-and-quadcopter-video-streams-using-python-and-opencv/#comment