I have the following original image:
I want to contour the dark brownfield and calculate its area.
Full code so far:
image=cv2.imread(file)
blurred_frame = cv2.GaussianBlur(image, (5, 5), 0)
hsv = cv2.cvtColor(blurred_frame, cv2.COLOR_BGR2HSV)
brown_lo=np.array([10,0,0])
brown_hi=np.array([20,150,150])
mask=cv2.inRange(hsv,brown_lo,brown_hi)
contours, _ = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
for contour in contours:
cv2.drawContours(image, contour, -1, (0, 255, 0), 3)
show(image)
show(mask)
But I do not get the filled field.
I have received a much better image after the comment. How do I calculate the area of the field now?