|
车牌检测的识别率挺低啊,试了10张能有2-3张能识别到,用的是python ,是我用错了吗?
import time
import argparse
from rockx import RockX
import cv2
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="RockX Carplate Demo")
parser.add_argument('-img', '--imgpath', help="img name", type=str, default="")
parser.add_argument('-d', '--device', help="target device id", type=str)
args = parser.parse_args()
carplate_det_handle = RockX(RockX.ROCKX_MODULE_CARPLATE_DETECTION, target_device=args.device)
in_img = cv2.imread(args.imgpath)
in_img_h, in_img_w = in_img.shape[:2]
start = time.time()
ret, results = carplate_det_handle.rockx_carplate_detect(in_img, in_img_w, in_img_h, RockX.ROCKX_PIXEL_FORMAT_BGR888)
end = time.time()
print('carplate detect use: ', end - start)
for result in results:
cv2.rectangle(in_img,
(result.box.left, result.box.top),
(result.box.right, result.box.bottom),
(0, 255, 0), 2)
print (result.box)
cv2.imwrite("resul_carplat_detect/" + str(start) + '.jpg', in_img)
#print ("292929")
# cv2.imshow('RockX Carplate - ' + str(args.device), show_frame)
#
# cv2.destroyAllWindows()
carplate_det_handle.release()
|
|