GeezerVison is showing github.com — optimus code · ljd2000/EasyPR-Java@5f9d3ad
File treeExpand 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: .idea/libraries/javacpp.xml +9Lines changed: 9 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: .idea/libraries/javacv.xml +9Lines changed: 9 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: .idea/libraries/opencv.xml +9Lines changed: 9 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: .idea/libraries/opencv_windows_x86.xml +10Lines changed: 10 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: .idea/libraries/org_bytedeco_javacv_0_10.xml +5Lines changed: 5 additions & 0 deletions Collapse file Copy file name to clipboard +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> | 2 | | -<module type="WEB_MODULE" version="4"> | | 2 | +<module type="JAVA_MODULE" version="4"> | 3 | 3 | <component name="NewModuleRootManager" inherit-compiler-output="true"> | 4 | 4 | <exclude-output /> | 5 | 5 | <content url="file://$MODULE_DIR$"> | 6 | 6 | <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | 7 | 7 | </content> | 8 | 8 | <orderEntry type="inheritedJdk" /> | 9 | 9 | <orderEntry type="sourceFolder" forTests="false" /> | 10 | | - <orderEntry type="library" name="org.bytedeco:javacv:0.10" level="project" /> | | 10 | + <orderEntry type="library" name="opencv-windows-x86" level="project" /> | | 11 | + <orderEntry type="library" name="opencv" level="project" /> | | 12 | + <orderEntry type="library" name="javacv" level="project" /> | | 13 | + <orderEntry type="library" name="javacpp" level="project" /> | 11 | 14 | </component> | 12 | 15 | </module> |
Collapse file Copy file name to clipboardExpand all lines: src/org/easypr/core/CharsIdentify.java +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -119,12 +119,14 @@ public Mat features(final Mat in,int sizeData){ | 119 | 119 |
| 120 | 120 | int j = 0; | 121 | 121 | for(int i =0;i<vhist.cols();++i,++j){ | 122 | | - float val = (Float)MatHelper.getElement(vhist,i); | 123 | | - MatHelper.setElement(out,val,j); | | 122 | + byte []buffer = new byte[4]; | | 123 | + vhist.ptr(i).get(buffer); | | 124 | + out.ptr(j).put(buffer); | 124 | 125 | } | 125 | 126 | for(int i =0;i<hhist.cols();++i,++j){ | 126 | | - float val = (Float)MatHelper.getElement(hhist,i); | 127 | | - MatHelper.setElement(out,val,j); | | 127 | + byte []buffer = new byte[4]; | | 128 | + hhist.ptr(i).get(buffer); | | 129 | + out.ptr(j).put(buffer); | 128 | 130 | } | 129 | 131 | for(int x=0; x<lowData.cols(); x++) | 130 | 132 | for(int y=0; y<lowData.rows(); y++,++j){ | |
Collapse file Copy file name to clipboardExpand all lines: src/org/easypr/core/Features.java +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -67,12 +67,14 @@ public Mat getTheFeatures(Mat in) { | 67 | 67 | //Asign values to feature,样本特征为水平、垂直直方图 | 68 | 68 | int j = 0; | 69 | 69 | for (int i = 0; i < vhist.cols(); i++, ++j) { | 70 | | - float val = (Float) MatHelper.getElement(vhist, i); | 71 | | - MatHelper.setElement(out, val, j); | | 70 | + byte []buffer = new byte[4]; | | 71 | + vhist.ptr(i).get(buffer); | | 72 | + out.ptr(j).put(buffer); | 72 | 73 | } | 73 | 74 | for (int i = 0; i < hhist.cols(); i++, ++j) { | 74 | | - float val = (Float) MatHelper.getElement(hhist, i); | 75 | | - MatHelper.setElement(out, val, j); | | 75 | + byte []buffer = new byte[4]; | | 76 | + hhist.ptr(i).get(buffer); | | 77 | + out.ptr(j).put(buffer); | 76 | 78 | } | 77 | 79 | return out; | 78 | 80 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/org/easypr/train/ANNTrain.java +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,12 +62,14 @@ public Mat features(Mat in, int sizeData) { | 62 | 62 | //Asign values to feature,ANN的样本特征为水平、垂直直方图和低分辨率图像所组成的矢量 | 63 | 63 | int j = 0; | 64 | 64 | for (int i = 0; i < vhist.cols(); i++, ++j) { | 65 | | - float val = (Float) MatHelper.getElement(vhist, i); | 66 | | - MatHelper.setElement(out, val, j); | | 65 | + byte []buffer = new byte[4]; | | 66 | + vhist.ptr(i).get(buffer); | | 67 | + out.ptr(j).put(buffer); | 67 | 68 | } | 68 | 69 | for (int i = 0; i < hhist.cols(); i++, ++j) { | 69 | | - float val = (Float) MatHelper.getElement(hhist, i); | 70 | | - MatHelper.setElement(out, val, j); | | 70 | + byte []buffer = new byte[4]; | | 71 | + hhist.ptr(i).get(buffer); | | 72 | + out.ptr(j).put(buffer); | 71 | 73 | } | 72 | 74 | for (int x = 0; x < lowData.cols(); x++) { | 73 | 75 | for (int y = 0; y < lowData.rows(); y++, ++j) { | |
Collapse file Copy file name to clipboardExpand all lines: src/org/easypr/train/SVMTrain.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | package org.easypr.train; | 2 | 2 |
| 3 | 3 |
| 4 | | -import org.bytedeco.javacpp.opencv_core; | 5 | 4 | import org.easypr.core.Features; | 6 | 5 | import org.easypr.util.MatHelper; | 7 | 6 | import org.easypr.core.SVMCallback; | | 14 | 13 |
| 15 | 14 | import java.util.*; | 16 | 15 |
| 17 | | -/** | 18 | | - * Created by Anonymous on 2015-03-17. | | 16 | +/* | | 17 | + * Created by fanwenjie | | 18 | + * @version 1.1 | 19 | 19 | */ | 20 | 20 | public class SVMTrain { | 21 | 21 |
| |
|