-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added jevois module generation for python #872
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#set($enums = []) | ||
#set($lines = false) | ||
import libjevois as jevois | ||
import cv2 | ||
import numpy as np | ||
import $moduleName | ||
|
||
class GRIPRunner: | ||
|
||
def __init__(self): | ||
self.pipeline = $moduleName.$className() | ||
|
||
def process(self, inframe, outframe = None): | ||
# Execute the pipeline | ||
img = inframe.getCvBGR() | ||
self.pipeline.process(img) | ||
|
||
# stream to USB output if current mapping is setup for that | ||
if outframe is not None: | ||
#foreach($step in $pipeline.getSteps())#if($foreach.last)#foreach($output in $step.getOutputs()) | ||
#set($oName = $tMeth.pyName($output.name())) | ||
#if($oName.contains("contour") || $oName.contains("hull")) | ||
cv2.drawContours(img,self.pipeline.$tMeth.pyName($output.name()), -1, (0,255,0),2) | ||
#end#end#end#end | ||
outframe.sendCvBGR(img) | ||
|
||
# TODO: send contour report over USB | ||
# TODO: add parameter(s) to enable/disable individual values of the report over USB | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you plan to do this before this is merged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to yes - I also have some refactoring in the template I'd like to include (using socket type rather than name to determine whether or not to generate the drawing code). I'll amend the commit over the next couple of days; please let me know if any other thins to look at as well. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't aligned correctly. Tabs vs spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm possibly. I didn't edit that file manually so I guess SceneBuilder didn't align. I'll update manually