GeezerVison is showing github.com — fix bug · ljd2000/EasyPR-Java@0114df4
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/Main.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
11 | 11 | public class Main { |
12 | 12 |
|
13 | 13 | public static void main(String[] args) { |
14 | | - Test.plateDetect(); |
| 14 | + Test.charsRecognise(); |
15 | 15 | } |
16 | 16 | } |
Collapse file
Copy file name to clipboardExpand all lines: src/org/easypr/core/CharsSegment.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -358,7 +358,7 @@ int SortRect(final Vector<Rect> vecRect, Vector<Rect> out) { |
358 | 358 | for (int i = 0; i < xpositions.size(); ++i) { |
359 | 359 | min = xpositions.get(i); |
360 | 360 | minIdx = i; |
361 | | - for (int j = i; i < xpositions.size(); ++j) { |
| 361 | + for (int j = i; j < xpositions.size(); ++j) { |
362 | 362 | if (xpositions.get(j) < min) { |
363 | 363 | min = xpositions.get(j); |
364 | 364 | minIdx = j; |
|
Collapse file
Copy file name to clipboardExpand all lines: src/org/easypr/test/Test.java +13-1Lines changed: 13 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | package org.easypr.test; |
2 | 2 |
|
| 3 | +import org.easypr.core.CharsRecognise; |
3 | 4 | import org.easypr.core.PlateDetect; |
4 | 5 |
|
5 | 6 | import java.util.Vector; |
@@ -21,7 +22,7 @@ public static void plateDetect(){ |
21 | 22 | PlateDetect plateDetect = new PlateDetect(); |
22 | 23 | plateDetect.setPDLifemode(true); |
23 | 24 | Vector<Mat> matVector = new Vector<Mat>(); |
24 | | - plateDetect.plateDetect(src,matVector); |
| 25 | + plateDetect.plateDetect(src, matVector); |
25 | 26 | if(0==plateDetect.plateDetect(src,matVector)){ |
26 | 27 | long num = matVector.size(); |
27 | 28 | for(int i=0;i<num;++i){ |
@@ -33,4 +34,15 @@ public static void plateDetect(){ |
33 | 34 | } |
34 | 35 | } |
35 | 36 |
|
| 37 | + public static String charsRecognise(){ |
| 38 | + String imgPath = "res/image/chars_recognise.jpg"; |
| 39 | + System.out.println("test_chars_recognise"); |
| 40 | + Mat src = imread(imgPath); |
| 41 | + CharsRecognise cr = new CharsRecognise(); |
| 42 | + String result = cr.charsRecognise(src); |
| 43 | + System.out.println("charsRecognise: "+result); |
| 44 | + |
| 45 | + return result; |
| 46 | + } |
| 47 | + |
36 | 48 | } |