mpl_drawer.py 780 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. __author__ = "heider"
  4. __doc__ = r"""
  5. Created on 9/9/22
  6. """
  7. __all__ = []
  8. from draugr.drawers import ImageStreamPlot
  9. def asdasf() -> None:
  10. """
  11. :rtype: None
  12. """
  13. import cv2
  14. from draugr.opencv_utilities import frame_generator
  15. from draugr.visualisation.progress import progress_bar
  16. from functools import partial
  17. from draugr.opencv_utilities import AsyncVideoStream
  18. with AsyncVideoStream() as vc:
  19. coder = partial(cv2.cvtColor, code=cv2.COLOR_BGR2RGB)
  20. with ImageStreamPlot(coder(next(vc))) as s:
  21. for i in progress_bar(
  22. frame_generator(vc, coder=coder), auto_total_generator=False
  23. ):
  24. s.draw(i)
  25. asdasf()