Python Forum
Counting flowers on a plant
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Counting flowers on a plant
#1
Hello i'm looking for a solution for counting flowers in plants.
I try opencv only i can't find the right sollution.
I think its the best to filter it by color and count the blobs.

Maby somebody here has the right libary for me ?

[Image: RmvdGDA.jpg]


So count the red flowers.
Reply
#2
Please show (code) that you have tried so far.
Reply
#3
# Standard imports

import cv2

import numpy as np;



# Read image

im = cv2.imread("testanturium.jpg")



# Setup SimpleBlobDetector parameters.

params = cv2.SimpleBlobDetector_Params()



# Change thresholds

params.minThreshold = 10

params.maxThreshold = 200





# Filter by Area.

params.filterByArea = True

params.minArea = 1500



# Filter by Circularity

params.filterByCircularity = True

params.minCircularity = 0.1



# Filter by Convexity

params.filterByConvexity = True

params.minConvexity = 0.87

    

# Filter by Inertia

params.filterByInertia = True

params.minInertiaRatio = 0.01



# Create a detector with the parameters

detector = cv2.SimpleBlobDetector(params)





# Detect blobs.

keypoints = detector.detect(im)



# Draw detected blobs as red circles.

# cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS ensures

# the size of the circle corresponds to the size of blob



im_with_keypoints = cv2.drawKeypoints(im, keypoints, np.array([]), (0,0,255), cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)



# Show blobs

cv2.imshow("Keypoints", im_with_keypoints)

cv2.waitKey(0)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Prediction of Coal Fire Power Plant Pollutants Emission Dalpi 2 2,156 May-08-2020, 06:28 PM
Last Post: Dalpi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020