예제 #1
0
two input images (usually the 'previous' image and the 'current'
image), and also takes the list of corners in the 'previous' image as
input.  It returns the set of corners in the 'current' image (for use
as input to the next call), and a bunch of flow vectors."""),
  [("old_input", "vx_image", "The previous image."),
   ("new_input", "vx_image", "The current image."),
   ("old_corners", "vx_buffer", "The previous corners.")],
  [("corners", "vx_buffer", "The new corners."),
   ("points", "vx_buffer", "The resulting flow vectors.")]),

(("NormalizeVectors", "NORMALIZE_VECTORS", "VECNORM", "The vector normalization node."),
 [("input", "vx_buffer", "The input vectors.")],
 [("output", "vx_buffer", "The normalized vectors.")]),

(("FastCornersVectors", "FAST_CORNERS", "FAST", "The FAST corner vector node."),
 [("input", "vx_buffer", "The input buffer.")],
 [("output", "vx_image", "The FAST corner image."),
  ("points", "vx_buffer", "The FAST corner points.")]),

]


# Check that the table above is properly formatted.  Need to "run"
# this file after editing the table above.
import sys
from vxNodeUtils import checkNodeTable
if not checkNodeTable(vxNodeTable):
    print("Node table format error...exiting.", sys.stderr)
    exit(0)

예제 #2
0
kernelFilename = None

# Get the output file name
if len(sys.argv) > 2:
    nodeFilename = sys.argv[1]
    kernelFilename = sys.argv[2]
else:
    print ("Usage: python %s <vx_nodes.h> <vx_kernels.h>" % sys.argv[0], file=sys.stderr)
    exit()

# Pull in the node table and utility functions
from vxNodes import vxNodeTable
from vxNodeUtils import checkNodeTable, writeNodeHeaderFile, writeKernelHeaderFile

# Try to write the file and inform the user of success or failure
if checkNodeTable(vxNodeTable):
    try: # write the node header file
        writeNodeHeaderFile(vxNodeTable, nodeFilename)
    except:
        print("Error writing file %s...exiting." % nodeFilename, file=sys.stderr)
        raise

    print("Node header file successfully written to", nodeFilename, file=sys.stdout)

    try: # write the kernel header file
        writeKernelHeaderFile(vxNodeTable, kernelFilename)
    except:
        print("Error writing file %s...exiting." % kernelFilename, file=sys.stderr)
        raise

    print("Kernel header file successfully written to", kernelFilename, file=sys.stdout)
예제 #3
0
# Get the output file name
if len(sys.argv) > 2:
    nodeFilename = sys.argv[1]
    kernelFilename = sys.argv[2]
else:
    print("Usage: python %s <vx_nodes.h> <vx_kernels.h>" % sys.argv[0],
          file=sys.stderr)
    exit()

# Pull in the node table and utility functions
from vxNodes import vxNodeTable
from vxNodeUtils import checkNodeTable, writeNodeHeaderFile, writeKernelHeaderFile

# Try to write the file and inform the user of success or failure
if checkNodeTable(vxNodeTable):
    try:  # write the node header file
        writeNodeHeaderFile(vxNodeTable, nodeFilename)
    except:
        print("Error writing file %s...exiting." % nodeFilename,
              file=sys.stderr)
        raise

    print("Node header file successfully written to",
          nodeFilename,
          file=sys.stdout)

    try:  # write the kernel header file
        writeKernelHeaderFile(vxNodeTable, kernelFilename)
    except:
        print("Error writing file %s...exiting." % kernelFilename,
예제 #4
0
two input images (usually the 'previous' image and the 'current'
image), and also takes the list of corners in the 'previous' image as
input.  It returns the set of corners in the 'current' image (for use
as input to the next call), and a bunch of flow vectors."""),
  [("old_input", "vx_image", "The previous image."),
   ("new_input", "vx_image", "The current image."),
   ("old_corners", "vx_buffer", "The previous corners.")],
  [("corners", "vx_buffer", "The new corners."),
   ("points", "vx_buffer", "The resulting flow vectors.")]),

(("NormalizeVectors", "NORMALIZE_VECTORS", "VECNORM", "The vector normalization node."),
 [("input", "vx_buffer", "The input vectors.")],
 [("output", "vx_buffer", "The normalized vectors.")]),

(("FastCornersVectors", "FAST_CORNERS", "FAST", "The FAST corner vector node."),
 [("input", "vx_buffer", "The input buffer.")],
 [("output", "vx_image", "The FAST corner image."),
  ("points", "vx_buffer", "The FAST corner points.")]),

]


# Check that the table above is properly formatted.  Need to "run"
# this file after editing the table above.
import sys
from vxNodeUtils import checkNodeTable
if not checkNodeTable(vxNodeTable):
    print("Node table format error...exiting.", sys.stderr)
    exit(0)