Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenCV/cv2 Functions

See vidformer.cv2 API docs.

cv2 showcase

Legend:

  • βœ… - Support
  • πŸ”Έ - Support via OpenCV cv2
  • ❌ - Not yet implemented

Vidformer-specific Functions

  • cv2.vidplay(video) - Play a VideoWriter, Spec, or Source
  • VideoWriter.spec() - Return the Spec of an output video
  • Frame.numpy() - Return the frame as a numpy array
  • cv2.setTo - The OpenCV Mat.setTo function (not in cv2)
  • cv2.zeros - Create a black frame (equivalent to numpy.zeros)

opencv

ClassStatus
VideoCaptureβœ…
VideoWriterβœ…
VideoWriter_fourccβœ…
FunctionStatus
imreadβœ…
imwriteβœ…

opencv.imgproc

Drawing Functions:

FunctionStatus
arrowedLineβœ…
circleβœ…
clipLineπŸ”Έ
drawContoursβœ…
drawMarkerβœ…
ellipseβœ…
ellipse2PolyπŸ”Έ
fillConvexPolyβœ…
fillPolyβœ…
getFontScaleFromHeightπŸ”Έ
getTextSizeπŸ”Έ
lineβœ…
polylinesβœ…
putTextβœ…
rectangleβœ…

opencv.core

FunctionStatus
addWeightedβœ…
copyMakeBorderβœ…
flipβœ…
hconcatβœ…
resizeβœ…
rotateβœ…
vconcatβœ…

Output Comparison

Vidformer’s cv2 output compared to native OpenCV (source code):

Vidformer:

Vidformer cv2 output

OpenCV:

OpenCV output

Per-pixel Diff:

Difference between outputs

The differences mainly come from Vidformer using FFmpeg’s swscale for resize instead of OpenCV’s resize.