JobeeOpenCV

Project.JobeeOpenCV History

Hide minor edits - Show changes to markup

Changed lines 8-29 from:
to:
  1. Standard imports

import cv2 import numpy as np;

  1. Read image

im = cv2.imread("image3visblob.jpg", cv2.IMREAD_GRAYSCALE)

  1. Set up the detector with default parameters.

detector = cv2.SimpleBlobDetector()

  1. Detect blobs.

keypoints = detector.detect(im) print keypoints

  1. Draw detected blobs as red circles.
  2. 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)

cv2.imwrite("blobdetected.jpg", im_with_keypoints)

  1. Show keypoints

cv2.imshow("Keypoints", im_with_keypoints) cv2.waitKey(0)

Added lines 1-9:

OpenCV to count bees

We now can fetch image from camera.

OpenCV, Open source Computer Vision could replace our eyes in giving some to a computer. :-)

(:source lang=python:)

(:sourceend:)