[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[py8] OpenCV

Computer Vision support for S8 running on top of python VM.

Installation

  1. Install OpenCV package with pip (opencv-python, opencv-contrib-python or opencv-python-headless for server support)
  2. fileIn the OpenCV framework and start using your objects to implement computer vision solutions
To test the python installation:
Connect the U8 tools top a running py8 system and evaluate the following expressions in a workspace
Python import: #cv2
return a Python instance (the cv2 module wrapper)
| cv2 |
cv2 := Python import: #cv2.
cv2 @ #data basicAt: #haarcascades
Return the path name of haar cascades repository

Samples

See also OpenCV-Python Tutorials
Samplecode to evaluate (in a remote workspace)
Get library version Core getVersionString
Library build information Core getBuildInformation
Path to Lena.jpg sample file (or empty string)CVSamples findFile: 'Lena.jpg' required: false
Path to haar cascade repoCore library @@ #(data haarcascades)
Load an image from file as an instance of Mat (or nil)Imgcodecs imread: 'Lena.jpg'
Show an image in a window (titled myWindow) and wait a for a key pressedHighGUI imshow: #myWindow mat: (Imgcodecs imread: 'Lena.jpg')
HighGUI waitKey: 0
Update a windowHighGUI updateWindow: #myWindow
Close all windowsHighGUI destroyAllWindows
Show a windows with an image converted to grayscale; and wait for a key pressed
| gray lena |
lena := Mat fileName: 'Lena.jpg'.
gray := Imgproc cvtColor: lena code: Imgproc colorBgr2gray.
HighGUI imshow: #myWindow mat: gray.
HighGUI waitKey: 0.
HighGUI destroyAllWindows

Uploaded Image: idea.gifFor more examples browse class side methods in CVExample or connect from remote U8 toolset and open examples in QuickList

See also


References