python - Detect the green lines in this image and calculate their lengths -
sample images the image can more noisy @ times more objects intervene background. right using various techniques using rgb colour space detect lines fails when there change in colour due intervening obstacles background. using opencv , python. have read hsv better colour detection , used haven't been successful yet. not able find generic solution problem. hints or clues in direction of great help. still in progress first of all, rgb image consists of 3 grayscale images. since need green color deal 1 channel. green one. so, can split image, can use b,g,r = cv2.split('your image') . output if showing green channel: after should threshold image using desired way. prefer otsu's thresholding in case. output after thresholding is: it's obvious thresholded image extremley noisy. performing erosion reduce noise little bit. noise reduced image similar following: i tried using closing instead of dilation , closing preserves unwanted noise. s...