91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 10.17MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-10-25
  • 語言: Python
  • 標(biāo)簽:

資源簡介

采用python+opencv進(jìn)行車牌號碼識別程序編寫。程序介紹及部分解釋參加https://blog.csdn.net/chenkz123/article

資源截圖

代碼片段和文件信息

import?cv2
import?numpy?as?np
from?numpy.linalg?import?norm
import?sys
import?os
import?json

SZ?=?20??#?訓(xùn)練圖片長寬
MAX_WIDTH?=?1000??#?原始圖片最大寬度
MAX_HEIGHT?=?750??#?原始圖片最大高度度
Min_Area?=?2000??#?車牌區(qū)域允許最大面積
PROVINCE_START?=?1000


#?讀取圖片文件
def?imreadex(filename):
????return?cv2.imdecode(np.fromfile(filename?dtype=np.uint8)?cv2.IMREAD_COLOR)


def?point_limit(point):
????if?point[0]?????????point[0]?=?0
????if?point[1]?????????point[1]?=?0


#?根據(jù)設(shè)定的閾值和圖片直方圖,找出波峰,用于分隔字符
def?find_waves(threshold?histogram):
????up_point?=?-1??#?上升點
????is_peak?=?False
????if?histogram[0]?>?threshold:
????????up_point?=?0
????????is_peak?=?True
????wave_peaks?=?[]
????for?i?x?in?enumerate(histogram):
????????if?is_peak?and?x?????????????if?i?-?up_point?>?2:
????????????????is_peak?=?False
????????????????wave_peaks.append((up_point?i))
????????elif?not?is_peak?and?x?>=?threshold:
????????????is_peak?=?True
????????????up_point?=?i
????if?is_peak?and?up_point?!=?-1?and?i?-?up_point?>?4:
????????wave_peaks.append((up_point?i))
????return?wave_peaks


#?根據(jù)找出的波峰,分隔圖片,從而得到逐個字符圖片
def?seperate_card(img?waves):
????part_cards?=?[]
????for?wave?in?waves:
????????part_cards.append(img[:?wave[0]:wave[1]])
????return?part_cards


#?來自opencv的sample,用于svm訓(xùn)練???進(jìn)行仿射變換
def?deskew(img):
????m?=?cv2.moments(img)
????if?abs(m[‘mu02‘])?????????return?img.copy()
????skew?=?m[‘mu11‘]?/?m[‘mu02‘]
????M?=?np.float32([[1?skew?-0.5?*?SZ?*?skew]?[0?1?0]])
????img?=?cv2.warpAffine(img?M?(SZ?SZ)?flags=cv2.WARP_INVERSE_MAP?|?cv2.INTER_LINEAR)??#?仿射變換。。
????return?img


#?來自opencv的sample,用于svm訓(xùn)練??返回直方圖
def?preprocess_hog(digits):
????samples?=?[]
????for?img?in?digits:
????????gx?=?cv2.Sobel(img?cv2.CV_32F?1?0)
????????gy?=?cv2.Sobel(img?cv2.CV_32F?0?1)
????????mag?ang?=?cv2.cartToPolar(gx?gy)
????????bin_n?=?16
????????bin?=?np.int32(bin_n?*?ang?/?(2?*?np.pi))
????????bin_cells?=?bin[:10?:10]?bin[10:?:10]?bin[:10?10:]?bin[10:?10:]
????????mag_cells?=?mag[:10?:10]?mag[10:?:10]?mag[:10?10:]?mag[10:?10:]
????????hists?=?[np.bincount(b.ravel()?m.ravel()?bin_n)?for?b?m?in?zip(bin_cells?mag_cells)]
????????hist?=?np.hstack(hists)

????????#?transform?to?Hellinger?kernel
????????eps?=?1e-7
????????hist?/=?hist.sum()?+?eps
????????hist?=?np.sqrt(hist)
????????hist?/=?norm(hist)?+?eps

????????samples.append(hist)
????return?np.float32(samples)


#?不能保證包括所有省份
provinces?=?[
????“zh_cuan“?“川“
????“zh_e“?“鄂“
????“zh_gan“?“贛“
????“zh_gan1“?“甘“
????“zh_gui“?“貴“
????“zh_gui1“?“桂“
????“zh_hei“?“黑“
????“zh_hu“?“滬“
????“zh_ji“?“冀“
????“zh_jin“?“津“
????“zh_jing“?“京“
????“zh_jl“?“吉“
????“zh_liao“?“遼“
????“zh_lu“?“魯“
????“zh_meng“?“蒙“
????“zh_min“?“閩“
????“zh_ning“?“寧“
????“zh_qing“?“靑“
????“zh_qiong“?“瓊“
????“zh_shan“?“陜“
????“zh_su“?“蘇“
????“zh_sx“?“晉“
????“zh_wan“?“皖“
????“zh_xiang“?“湘“

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-21?19:24??License-Plate-Recognition-master\
?????文件????????1157??2018-05-26?22:39??License-Plate-Recognition-master\.gitignore
?????目錄???????????0??2018-11-21?19:35??License-Plate-Recognition-master\.idea\
?????文件?????????460??2018-11-20?19:32??License-Plate-Recognition-master\.idea\License-Plate-Recognition-master.iml
?????目錄???????????0??2018-11-21?19:35??License-Plate-Recognition-master\.idea\inspectionProfiles\
?????文件?????????313??2018-11-20?19:32??License-Plate-Recognition-master\.idea\misc.xml
?????文件?????????323??2018-11-19?23:48??License-Plate-Recognition-master\.idea\modules.xml
?????文件???????17775??2018-11-21?19:35??License-Plate-Recognition-master\.idea\workspace.xml
?????文件??????141788??2018-05-26?22:39??License-Plate-Recognition-master\1.jpg
?????文件????????1060??2018-05-26?22:39??License-Plate-Recognition-master\LICENSE
?????文件????????1804??2018-05-26?22:39??License-Plate-Recognition-master\README.md
?????目錄???????????0??2018-11-20?19:59??License-Plate-Recognition-master\Screenshots\
?????文件??????513442??2018-05-26?22:39??License-Plate-Recognition-master\Screenshots\3.png
?????文件??????335454??2018-05-26?22:39??License-Plate-Recognition-master\Screenshots\5.png
?????目錄???????????0??2018-11-21?19:25??License-Plate-Recognition-master\__pycache__\
?????文件???????14875??2018-11-20?16:24??License-Plate-Recognition-master\__pycache__\predict.cpython-35.pyc
?????文件???????13281??2018-11-21?19:25??License-Plate-Recognition-master\__pycache__\predict.cpython-36.pyc
?????文件???????13039??2018-11-20?00:21??License-Plate-Recognition-master\__pycache__\predict.cpython-37.pyc
?????文件?????????434??2018-11-20?00:25??License-Plate-Recognition-master\config.js
?????文件???????24849??2018-11-21?19:24??License-Plate-Recognition-master\predict.py
?????文件????????6398??2018-11-21?12:10??License-Plate-Recognition-master\surface.py
?????文件?????4595678??2018-05-26?22:39??License-Plate-Recognition-master\svm.dat
?????文件?????3645216??2018-05-26?22:39??License-Plate-Recognition-master\svmchinese.dat
?????目錄???????????0??2018-11-21?19:27??License-Plate-Recognition-master\test\
?????文件?????2718121??2018-05-26?22:39??License-Plate-Recognition-master\test\2.jpg
?????文件???????62588??2018-05-26?22:39??License-Plate-Recognition-master\test\cAA662F.jpg
?????文件???????27089??2018-05-26?22:39??License-Plate-Recognition-master\test\car3.jpg
?????文件???????25090??2018-05-26?22:39??License-Plate-Recognition-master\test\car4.jpg
?????文件???????28604??2018-05-26?22:39??License-Plate-Recognition-master\test\car5.jpg
?????文件???????27744??2018-05-26?22:39??License-Plate-Recognition-master\test\car7.jpg
?????文件???????24073??2018-05-26?22:39??License-Plate-Recognition-master\test\lLD9016.jpg
............此處省略6個文件信息

評論

共有 條評論