Unable to correctly recognize license plate number in Halcon

1.png
The value of the Class variable is '0' 'I' '0' 'H' '0' '4'
I hope the value of the Class variable is A' 'T' '0' 'H' '6' '9'
I tried using sort_region to sort SelectedRegions1, but it still didn't work

    read_image (Image1, 'C:/Users/29185/Desktop/1.png')
    get_image_size (Image1, Width, Height)
    dev_close_window ()
    dev_open_window (0, 0, Width, Height, 'black', WindowHandle)

    rgb1_to_gray (Image1, GrayImage)
    dev_display (GrayImage)

    gen_rectangle1 (Rectangle, 59, 49, 89, 159)
    reduce_domain (GrayImage, Rectangle, ImageReduced)

    threshold (ImageReduced, Regions, 98, 194)
    shape_trans (Regions, RegionTrans1, 'rectangle1')

    reduce_domain (GrayImage, RegionTrans1, ImageReduced1)

    orientation_region (RegionTrans1, Phi)
    Phi area_center (RegionTrans1, Area, Row, Column)
    vector_angle_to_rigid (Row, Column, rad(180)-Phi, Row, Column,0 , HomMat2D)
    Phi>0 , [rad(180)-Phi]
    affine_trans_image (Image1, ImageAffineTrans, HomMat2D, 'constant', 'false')
    reduce_domain (ImageAffineTrans, RegionTrans1, ImageReduced)

    threshold (ImageReduced, Regions1, 100, 215)
    connection (Regions1, ConnectedRegions)
    select_shape (ConnectedRegions, SelectedRegions1, 'area', 'and', 89.39, 169.58)

    read_ocr_class_mlp ('Industrial_0-9A-Z_NoRej.omc', OCRHandle4)

    do_ocr_multi_class_mlp (SelectedRegions1, ImageReduced, OCRHandle4, Class, Confidence)
    disp_message (WindowHandle, Class, 'window', 0, 0, 'black', 'true')
CategoriesUncategorized