Query on NDVI image

23 views
Skip to first unread message

Aman Dalmia

unread,
Jan 19, 2017, 2:07:37 AM1/19/17
to OpenCV with Python Blueprints
Hi All,


I have an ndvi image, let say http://www.sunrise21.org.au/userfiles/ndvi.jpg

I need to make a border around the dense red area. How can I do this.

Thanks,
-Aman

Michael Beyeler

unread,
Jan 19, 2017, 3:04:44 PM1/19/17
to OpenCV with Python Blueprints
Hi Aman,

Here's a possible outline:
  • Convert to HSV.
  • Find the distribution (range) of HSV values of pixels in the red zone.
  • Use this range to make a mask that only contains the red pixels (using inRange).
  • Find the contours of all red blobs.
  • For each contour, find the outermost pixels (x_min, x_max, y_min, y_max). Use as boundaries for rectangles.
  • Draw a rectangle in the original image.
Best,
Michael
Reply all
Reply to author
Forward
0 new messages