ovl.image_utilities.display_contours module

ovl.image_utilities.display_contours.display_contours(image, contours, amount=0, display_loop=False, window_name='image', color=(0, 255, 0), save_path=None)[source]

Displays the image with the current_vision list of contours

This can be used to display detected contours (object outlines) on an image (numpy array)

import ovl
import cv2

image = cv2.imread("path/to/image.png")

(define a vision pipeline to detect contours)

contours, _ = vision.detect(image)

ovl.display_contours(image, contours)
Parameters:
  • image – image from which the contours were taken from, numpy array or image path
  • contours – the list of contours to display_image
  • color – the color of the of the contours outline
  • display_loop – if display is used in a loop should be true, else false
  • window_name – the window name, this is useful when display multiple different images at the same time
  • amount – amount of contours to display
  • save_path – if the image should be saved, pass the wanted result path
Returns:

the image with the drawn contours.