JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Tweet
PythonTutorial1.py
Go to the documentation of this file.
1
import
libjevois
as
jevois
2
import
cv2
3
import
numpy
as
np
4
5
## Simple example of image processing using OpenCV in Python on JeVois
6
#
7
# This module by default simply converts the input image to a grayscale OpenCV image, and then applies the Canny
8
# edge detection algorithm. Try to edit it to do something else (note that the videomapping associated with this
9
# module has grayscale image outputs, so that is what you should output).
10
#
11
# @author Laurent Itti
12
#
13
# @displayname Python Tutorial 1
14
# @videomapping GRAY 640 480 20.0 YUYV 640 480 20.0 JeVois PythonOpenCV
15
# @email itti\@usc.edu
16
# @address University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA
17
# @copyright Copyright (C) 2017 by Laurent Itti, iLab and the University of Southern California
18
# @mainurl http://jevois.org
19
# @supporturl http://jevois.org/doc
20
# @otherurl http://iLab.usc.edu
21
# @license GPL v3
22
# @distribution Unrestricted
23
# @restrictions None
24
# @ingroup modules
25
class
PythonTutorial1
:
26
# ###################################################################################################
27
## Process function with USB output
28
def
process
(self, inframe, outframe):
29
# Get the next camera image (may block until it is captured) and convert it to OpenCV GRAY:
30
inimggray = inframe.getCvGRAY()
31
32
# Detect edges using the Canny algorithm from OpenCV:
33
edges = cv2.Canny(inimggray, 100, 200, apertureSize = 3)
34
35
# Convert our GRAY output image to video output format and send to host over USB:
36
outframe.sendCvGRAY(edges)
PythonTutorial1.PythonTutorial1.process
def process(self, inframe, outframe)
Process function with USB output.
Definition:
PythonTutorial1.py:28
PythonTutorial1.PythonTutorial1
Simple example of image processing using OpenCV in Python on JeVois.
Definition:
PythonTutorial1.py:25
doc
snip
PythonTutorial1.py
Please help us improve this page: Edit it on
GitHub
or
email us your edits and suggestions.
Generated by
1.8.17