ImageWriter

class imagepypelines.core.io.ImageWriter(output_dir, base_filename='image.png', size=None, interpolation=0)[source]

Bases: object

Class that operates as a system that saves single frames to a specified output directory.

every new frame passed in will be saved in the following format:
output_dir/000001example_filename.png output_dir/000002example_filename.png output_dir/000003example_filename.png …

automatic resizing is also available

Parameters:
  • output_dir (str) – path to output directory that images will be saved to
  • base_filename (str) – default is ‘image.png’ filename common among all images, these will be incremented numerically with each new image saved
  • size (tuple,None) – Default is None size of the image if forced resizing is desired, or None if raw write is desired
  • interpolation (cv2 interpolation type) – Default is cv2.INTER_NEAREST interpolation method to be used if resizing is desired

Methods Summary

write(frame) writes an image frame to the specificed directory, forces resizing if specified when the class is instantiated

Methods Documentation

write(frame)[source]

writes an image frame to the specificed directory, forces resizing if specified when the class is instantiated

Parameters:frame (np.ndarray) – frame to be saved to the output_dir
Returns:None