Exemplo n.º 1
0
def test_chars_identify():
    print "test_chars_identify"
    img_plate = cv2.imread("resources/image/chars_identify.jpg",cv2.IMREAD_COLOR)

    # 车牌分割
    segmented = CharsSegmenter.charsSegment(img_plate)
    licence = ''
    CharsIndentifier.initModel()
    for index, char in enumerate(segmented):
        print 'char:'
        print char
        # licence += CharsIndentifier.identify(char)
        char_feature = CharsIndentifier.features(char,kPredictSize)
        if index == 0:
            char_text = CharsIndentifier.identifyChinese(char_feature)
        else:
            char_text = CharsIndentifier.identifyDigitLetter(char_feature)
        licence += char_text


    print "识别结果:"
    print licence
Exemplo n.º 2
0
def test_chars_identify():
    print "test_chars_identify"
    img_plate = cv2.imread("resources/image/chars_identify.jpg",
                           cv2.IMREAD_COLOR)

    # 车牌分割
    segmented = CharsSegmenter.charsSegment(img_plate)
    licence = ''
    CharsIndentifier.initModel()
    for index, char in enumerate(segmented):
        print 'char:'
        print char
        # licence += CharsIndentifier.identify(char)
        char_feature = CharsIndentifier.features(char, kPredictSize)
        if index == 0:
            char_text = CharsIndentifier.identifyChinese(char_feature)
        else:
            char_text = CharsIndentifier.identifyDigitLetter(char_feature)
        licence += char_text

    print "识别结果:"
    print licence