Difference between revisions of "RidgeRun OpenCV Fork"

From RidgeRun Developer Connection
Jump to: navigation, search
(GStreamer Video Capture)
(GStreamer Video Capture)
Line 24: Line 24:
 
* The following script:
 
* The following script:
 
<source lang=python>
 
<source lang=python>
#!/usr/bin/env python3
 
 
 
import cv2 as cv
 
import cv2 as cv
  
Line 37: Line 35:
 
while True:
 
while True:
 
     ret, frame = cap.read()
 
     ret, frame = cap.read()
    cv.imshow('display', frame)
 
    if cv.waitKey(1) & 0xFF == ord('q'):
 
        break
 
  
 
cap.release()
 
cap.release()
 
cv.destroyAllWindows()
 
cv.destroyAllWindows()
 
</source>
 
</source>

Revision as of 00:15, 18 September 2020

Introduction

The RidgeRun OpenCV fork is a modified version of the project with various improvements around speed and efficiency. While some changes are general (i.e.: any platform will benefit from them), others are specific to the NVIDIA Jetson family.

The fork is hosted at:

https://github.com/RidgeRun/opencv

Building the Project

Follow the instructions in our Compiling OpenCV from Source page. Make sure you select:

  • RidgeRun fork
  • GStreamer support
  • CUDA support (if applicable)

Enhancements

GStreamer Video Capture

Tested under the following conditions

  • OpenCV Version: 4.4.0
  • FPS and CPU usage taken with the GstPerf element.
  • The following script:
import cv2 as cv

PIPE = "videotestsrc pattern=black !  \
        video/x-raw,format=BGR,width=1920,height=1080 ! \
        perf print-arm-load=true ! \
        appsink sync=false drop=false max-buffers=3"

cap = cv.VideoCapture(PIPE, cv.CAP_GSTREAMER)

while True:
    ret, frame = cap.read()

cap.release()
cv.destroyAllWindows()