Пример #1
0
def main():
    usage = "%s [options]  <MSS File> <MSSout>" % (sys.argv[0])
    version = "%prog 0.2\n Longbin Chen, [email protected]"
    oparser = optparse.OptionParser(usage=usage, version=version)
    oparser.add_option('-t',
                       '--head',
                       dest='head',
                       type='int',
                       default=None,
                       help='use first h as target')

    (options, args) = oparser.parse_args(sys.argv)

    if len(args) != 3:
        oparser.parse_args([sys.argv[0], "--help"])
        sys.exit(1)
    sc = exSC()
    mss = MSS()
    mss.load(args[1])
    keypoints = mss.getAllPoints()
    if (options.head == None):
        hl = len(keypoints)
    else:
        hl = options.head
    sc.ExtractFeature(keypoints, range(hl))
    mss.save(args[2])
Пример #2
0
def main():

    usage = "%prog [options] <msshape> <outputmss>"
    version = "%prog 0.2\n Longbin Chen, [email protected]"
    oparser = optparse.OptionParser(usage=usage, version=version)
    oparser.add_option('-a',
                       '--angle',
                       dest='angle',
                       default=False,
                       action='store_true',
                       help='generate angle feature')
    oparser.add_option('-d',
                       '--das',
                       dest='das',
                       default=False,
                       action='store_true',
                       help='generate das feature')
    oparser.add_option('-s',
                       '--sc',
                       dest='sc',
                       default=False,
                       action='store_true',
                       help='generate shape context feature')
    oparser.add_option('-o',
                       '--offset',
                       dest='offset',
                       default=False,
                       action='store_true',
                       help='generate offset feature')

    (options, args) = oparser.parse_args(sys.argv)

    if len(args) != 3:
        oparser.parse_args([sys.argv[0], "--help"])
        sys.exit(1)
    if (not options.angle and not options.das and not options.sc
            and not options.offset):
        options.angle = True
        options.das = True
        options.sc = True
        options.offset = True

    das = exDAS()
    agl = exAngle()
    sc = exSC()
    mss = MSS()
    mss.load(args[1])
    for seq in mss.seqs:
        if (options.das):
            das.ExtractFeature(seq.points, None)
        if (options.angle):
            agl.ExtractFeature(seq.points, None)
    if (options.sc):
        keypoints = mss.getAllPoints()
        sc.ExtractFeature(keypoints, None)
    if (options.offset):
        oft = exOffset()
        oft.ExtractFeature(keypoints, None)
    mss.save(args[2])
Пример #3
0
def main():
    usage = "%s [options]  <MSS File> <MSSout>" % (sys.argv[0])
    version = "%prog 0.2\n Longbin Chen, [email protected]"
    oparser = optparse.OptionParser(usage=usage, version=version)
    oparser.add_option('-t', '--head', dest = 'head', type='int',default = None, help = 'use first h as target')

    (options, args) = oparser.parse_args(sys.argv)

    if len(args) != 3:
        oparser.parse_args([sys.argv[0], "--help"])
        sys.exit(1)
    sc = exSC()
    mss = MSS()
    mss.load(args[1])
    keypoints = mss.getAllPoints()
    if (options.head == None):
        hl = len(keypoints)
    else:
        hl = options.head
    sc.ExtractFeature(keypoints, range(hl))
    mss.save(args[2])
Пример #4
0
def main():

    usage = "%prog [options] <msshape> <outputmss>"
    version = "%prog 0.2\n Longbin Chen, [email protected]"
    oparser = optparse.OptionParser(usage=usage, version=version)
    oparser.add_option('-a', '--angle', dest = 'angle', default = False, action = 'store_true', help = 'generate angle feature')
    oparser.add_option('-d', '--das', dest = 'das', default = False, action = 'store_true', help = 'generate das feature')
    oparser.add_option('-s', '--sc', dest = 'sc', default = False, action = 'store_true', help = 'generate shape context feature')
    oparser.add_option('-o', '--offset', dest = 'offset', default = False, action = 'store_true', help = 'generate offset feature')


    (options, args) = oparser.parse_args(sys.argv)

    if len(args) != 3:
        oparser.parse_args([sys.argv[0], "--help"])
        sys.exit(1)
    if (not options.angle and not options.das and not options.sc and not options.offset):
        options.angle = True
        options.das   = True
        options.sc    = True
        options.offset= True

    das = exDAS()
    agl = exAngle()
    sc = exSC()
    mss = MSS()
    mss.load(args[1])
    for seq in mss.seqs:
        if (options.das):
            das.ExtractFeature(seq.points, None)
        if (options.angle):
            agl.ExtractFeature(seq.points, None)
    if (options.sc):
        keypoints = mss.getAllPoints()
        sc.ExtractFeature(keypoints, None)
    if (options.offset):
        oft = exOffset()
        oft.ExtractFeature(keypoints, None)
    mss.save(args[2])