91 def __init__(self, image_in, image_out, name="default", target=Target.DEFAULT) :
92 Node.__init__(self,
"vx_tutorial_graph.phase_rgb", image_in, image_out)
93 self.
setParams(1, 1, Type.IMAGE, Type.IMAGE)
105 Node.checkParams(self, *param_type_args)
107 assert ( self.
ref[0].width == self.
ref[1].width ),
"Input and Output width MUST match" 108 assert ( self.
ref[0].height == self.
ref[1].height ),
"Input and Output height MUST match" 109 assert ( self.
ref[0].df_image == DfImage.U8 ),
"Input data format must be U8" 110 assert ( self.
ref[1].df_image == DfImage.RGB ),
"Output data format must be RGB" 113 def make_my_graph() :
115 context =
Context(
"vx_tutorial_graph_user_kernel_pytiovx_uc")
126 in_image =
Image(width, height, DfImage.U8, name=
"input")
129 grad_x =
Image(width, height, DfImage.S16, name=
"grad_x")
132 grad_y =
Image(width, height, DfImage.S16, name=
"grad_y")
135 phase =
Image(width, height, DfImage.U8, name=
"phase")
138 phase_rgb =
Image(width, height, DfImage.RGB, name=
"phase_rgb")
141 graph.add (
NodeSobel3x3(in_image, grad_x, grad_y, target=Target.DSP1) )
144 graph.add (
NodePhase(grad_x, grad_y, phase, target=Target.DSP1) )
147 graph.add (
NodePhaseRgb(phase, phase_rgb, target=Target.DSP1) )
150 context.add ( graph )
def __init__(self, image_in, image_out, name="default", target=Target.DEFAULT)
Constructor for user/target kernel class.
Export objects from context to JPG image file.
Graph object (OpenVX equivalent = vx_graph)
def setTarget(self, target)
Specify target on which to run this node.
Image object (OpenVX equivalent = vx_image, specifically returned from vxCreateImage) ...
Class to represent user/target kernel.
Node object used to generate a Sobel3x3 node.
def setKernelEnumName(self, kernel_enum_name)
Specify kernel enum name to use.
Context object (OpenVX equivalent = vx_context)
Export objects from context to C source code.
def setParams(self, num_in, num_out, param_type_args)
Specify number of input/output parameters and data object type for each.
Node object used to generate a Phase node.
def checkParams(self, param_type_args)
Parameter checking function.
Node object (OpenVX equivalent = vx_node)