Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LPR-Accuracy-Testing
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bruce
LPR-Accuracy-Testing
Commits
8bdd3716
Commit
8bdd3716
authored
Jun 26, 2019
by
Bruce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Accuracy_Testing.ipynb
parent
c19ecfad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
47 deletions
+47
-47
Accuracy_Testing.ipynb
Accuracy_Testing.ipynb
+47
-47
No files found.
Accuracy_Testing.ipynb
View file @
8bdd3716
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
"from hyperlpr import calculation_raito_origin as fm\n",
"from hyperlpr import calculation_raito_origin as fm\n",
"from hyperlpr import finemapping_vertical as fv\n",
"from hyperlpr import finemapping_vertical as fv\n",
"from hyperlpr import segmentation_0124 as segmentation\n",
"from hyperlpr import segmentation_0124 as segmentation\n",
"import plate_judgment\n"
"\n",
"\n",
"\n",
"\n",
"import numpy as np\n",
"import numpy as np\n",
...
@@ -165,62 +166,61 @@
...
@@ -165,62 +166,61 @@
"\n",
"\n",
"###車牌辨識方法\n",
"###車牌辨識方法\n",
"def MYSimpleRecognizePlate(img):\n",
"def MYSimpleRecognizePlate(img):\n",
" car=img\n",
" y1,y2,x1,x2=0,1080,0,1000 ##限定區域\n"
" w,h=car.shape[:2]\n",
" car=img[y1:y2,x1:x2]\n",
" h=int(w*500/h)\n",
" images=detect.detectPlateRough(car,500)\n",
" w=500\n",
" car=cv2.resize(car,(w,h))\n",
" images=detect.detectPlateRough(car,car.shape[0])\n",
"\n",
"\n",
" origin_plate_list=[]\n",
" origin_plate_list=[]\n",
" image_rgb_rl_list=[]\n",
" image_rgb_rl_list=[]\n",
" for j,plate in enumerate(images):\n",
" for j,plate in enumerate(images):\n",
" plate, rect, origin_plate,flg =plate\n",
" plate, rect, origin_plate,flg =plate\n",
" img =cv2.resize(origin_plate,(300,100))\n",
" judgment_type=plate_judgment.SimplePredict(origin_plate)"
" img = cv2.bitwise_not(img)\n",
" if(judgment_type==0):"
" ### 車排上下定位\n",
" img =cv2.resize(origin_plate,(300,100))\n",
" image_rgb = fm.findContoursAndDrawBoundingBox(img)\n",
" img = cv2.bitwise_not(img)\n",
" image_rgb = cv2.bitwise_not(image_rgb)\n",
" ### 車排上下定位\n",
" plt.figure(\"Imgae\"+str(j))\n",
" image_rgb = fm.findContoursAndDrawBoundingBox(img)\n",
" plt.imshow(image_rgb)\n",
" image_rgb = cv2.bitwise_not(image_rgb)\n",
" plt.show\n",
" plt.figure(\"Imgae\"+str(j))\n",
" ### 車排左右定位\n",
" plt.imshow(image_rgb)\n",
" image_rgb = cv2.bitwise_not(image_rgb)\n",
" plt.show\n",
" image_rgb_rl = fv.finemappingVertical(image_rgb)\n",
" ### 車排左右定位\n",
" image_rgb_rl = cv2.bitwise_not(image_rgb_rl)\n",
" image_rgb = cv2.bitwise_not(image_rgb)\n",
" image_rgb_rl = fv.finemappingVertical(image_rgb)\n",
" image_rgb_rl = cv2.bitwise_not(image_rgb_rl)\n",
"\n",
"\n",
" plt.figure(\"Imgae2\"+str(j))\n",
"
plt.figure(\"Imgae2\"+str(j))\n",
" plt.imshow(image_rgb_rl)\n",
"
plt.imshow(image_rgb_rl)\n",
" plt.show\n",
"
plt.show\n",
"\n",
"\n",
" ### 車牌辨識\n",
"
### 車牌辨識\n",
" image_gray = cv2.cvtColor(image_rgb_rl,cv2.COLOR_RGB2GRAY)\n",
"
image_gray = cv2.cvtColor(image_rgb_rl,cv2.COLOR_RGB2GRAY)\n",
" val = segmentation.slidingWindowsEval(image_gray)\n",
"
val = segmentation.slidingWindowsEval(image_gray)\n",
" refined,name,con,nums,cut_data=val\n",
"
refined,name,con,nums,cut_data=val\n",
" \n",
"
\n",
" ### 分割機率圖\n",
"
### 分割機率圖\n",
" p=cut_data[0]\n",
"
p=cut_data[0]\n",
" lmin=cut_data[1]\n",
"
lmin=cut_data[1]\n",
" x=np.zeros(114)\n",
"
x=np.zeros(114)\n",
" \n",
"
\n",
" for i in lmin:\n",
"
for i in lmin:\n",
" x[i]=p[i]\n",
"
x[i]=p[i]\n",
" \n",
"
\n",
" \n",
"
\n",
" plt.figure()\n",
"
plt.figure()\n",
" plt.plot(x,'*',p) \n",
"
plt.plot(x,'*',p) \n",
" \n",
"
\n",
"\n",
"\n",
" ### 切割出的字元\n",
"
### 切割出的字元\n",
" for i,one in enumerate (refined):\n",
"
for i,one in enumerate (refined):\n",
" plt.figure(\"Imgae3\"+str(i))\n",
"
plt.figure(\"Imgae3\"+str(i))\n",
" plt.imshow(one)\n",
"
plt.imshow(one)\n",
" plt.show\n",
"
plt.show\n",
"\n",
"\n",
" ### 辨識結果\n",
"
### 辨識結果\n",
" print('車牌',name,'可信度',con,'字數',nums)\n",
"
print('車牌',name,'可信度',con,'字數',nums)\n",
" \n",
"
\n",
"
return cut_data
\n",
"
return name,con,nums
\n",
" \n",
" \n",
" \n",
" \n",
"LPR=MYSimpleRecognizePlate(img)\n",
"LPR=MYSimpleRecognizePlate(img)\n",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment