Skip to content

Commit

Permalink
Add example to 'find_objects' function docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Jun 1, 2021
1 parent 9cd0127 commit f010297
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions moviepy/video/tools/segmenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ def find_objects(clip, size_threshold=500, preview=False):
preview : bool, optional
Previews with matplotlib the different objects found in the image before
applying the size threshold. Requires matplotlib installed.
Examples
--------
>>> clip = ImageClip("media/afterimage.png")
>>> objects = find_objects(clip)
>>>
>>> print(len(objects))
>>> print([obj_.screenpos for obj_ in objects])
"""
image = clip.get_frame(0)
if not clip.mask: # pragma: no cover
Expand Down

0 comments on commit f010297

Please sign in to comment.