feat: 特殊车牌生成管线 + C++/多进程/色温校正

This commit is contained in:
kirl committed 2026-06-21 10:32:37 +08:00
1 parent 3808b9f035
commit 3101992f51
29 files changed
+2336 -80

No files matched your search

@@ -114,6 +114,9 @@ class MultiPlateGenerator:
self.location_xys['{}_{}_{}'.format(i, j, k)] = \
get_location_data(length=i, split_id=j, height=k)
# 底板背景缓存(避免每次 generate_plate_special 读盘)
self._plate_bg_cache = {}
# 获取字符位置
def get_location_multi(self, plate_number, height=140):
length = len(plate_number)
@@ -227,9 +230,15 @@ class MultiPlateGenerator:
"""
height = 220 if is_double else 140
# print(plate_number, height, bg_color, is_double)
number_xy = self.get_location_multi(plate_number, height)
img_plate_model = cv2.imread(os.path.join(self.adr_plate_model, '{}_{}.PNG'.format(bg_color, height)))
# 底板背景(缓存读取,避免每张图读盘)
cache_key = '{}_{}'.format(bg_color, height)
if cache_key not in self._plate_bg_cache:
bg_path = os.path.join(self.adr_plate_model, '{}.PNG'.format(cache_key))
self._plate_bg_cache[cache_key] = cv2.imdecode(
np.fromfile(bg_path, dtype=np.uint8), cv2.IMREAD_COLOR)
img_plate_model = self._plate_bg_cache[cache_key].copy()
img_plate_model = cv2.resize(img_plate_model, (440 if len(plate_number) == 7 else 480, height))
for i in range(len(plate_number)):