Skip to content

barrowsb/labview_opencv

Repository files navigation

OpenCV for LabVIEW

Written originally in C++ but wrapped up for Python, OpenCV is the de facto industry standard for open-sourced, computer vision. Using this repo, it can now be implemented in LabVIEW through the Python Node.

EX PROJ - Rotating Laptop Stand is the code I used on a laptop stand that rotates to follow a face. It uses these SubVIs along with the uPython palette for communicating with the SPIKE Prime.

SubVIs included

  • Initialize CV Session
    cv2.VideoCapture()
  • Close CV Session
    self.caprelease(), cv2.destroyAllWindows()
  • Snap Image
    self.cap.read()
  • Python Debug
    Python print() to LabVIEW front panel
  • Python Path
    path to python source file
  • Flip Horizontal/Vetical
    cv2.flip()
  • Face Detection/Tracking
    cv2.cascadeClassifier()
  • Edge Detection
    cv2.Canny()

SubVIs to add

  • General convolution
    cv2.filter2D()
    https://www.pyimagesearch.com/2016/07/25/convolutions-with-opencv-and-python/
  • Colorspace
    cv2.cvtColor()
  • Color channels
    cv2.split()
  • Blur
    cv2.blur()
  • Contours
    cv2.findContours()
  • Harris corner
    cv2.cornerHarris()
  • Save frames
    cv2.imwrite()
  • Translation
    cv2.warpAffine()
  • Rotation
    cv2.warpAffine()
  • Histograms
    cv2.calcHist()
  • Drawing
    cv2.rectangle()/circle()/[shape]()
  • Color detection
    cv2.inRange()
  • Decoding
    cv2.QRCodeDetector.[]()
  • CNN/DeepNN
    cv2.dnn()
  • Resize/zoom **
    cv2.resize()
  • Crop **
    numpy indexing
  • ROI/Masks **
    cv2.bitwise_and(mask=kwarg)

  • ** Resizes image (would require undoing hardcoding of 640x480)

About

A LabVIEW 2019 implementation of the OpenCV package using the Python Node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages