Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

simple blob Detection

$
0
0
Hi, I am trying to detect simple blobs in an image but while running code, I get the image without any keypoints plotted. Why am I not able to detect the blobs? import cv2 import numpy as np; im = cv2.imread('blob1.jpeg', cv2.IMREAD_GRAYSCALE) # Setup SimpleBlobDetector parameters. params = cv2.SimpleBlobDetector_Params() # Change thresholds params.minThreshold = 50 params.maxThreshold = 150 # Filter by Area. params.filterByArea = True params.minArea = 150 detector = cv2.SimpleBlobDetector_create(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([]), (255,0,0), cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS) # Show blobs cv2.imshow("Keypoints", im_with_keypoints) cv2.waitKey(0) cv2.destroyAllWindows() ![image description](/upfiles/14692971185610413.jpeg) ![image description](/upfiles/14692971412585507.png)

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>