├── .gitignore
├── README.md
├── app
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── yanyu
│ │ └── com
│ │ └── mrcar
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── mrcar
│ │ │ ├── ann.xml
│ │ │ ├── annCh.xml
│ │ │ ├── ann_chinese.xml
│ │ │ ├── province_mapping.xml
│ │ │ ├── simhei.ttf
│ │ │ └── svm_hist.xml
│ ├── java
│ │ └── yanyu
│ │ │ └── com
│ │ │ └── mrcar
│ │ │ ├── BeepManager.java
│ │ │ ├── CVCameraActivity.java
│ │ │ ├── CameraActivity.java
│ │ │ ├── MRAssetUtil.java
│ │ │ ├── MRCar.java
│ │ │ ├── MRMediaFileUtil.java
│ │ │ ├── MRPlate.java
│ │ │ ├── PhotoActivity.java
│ │ │ └── ViewfinderView.java
│ ├── jni
│ │ ├── CvText.cpp
│ │ ├── include
│ │ │ ├── CvText.h
│ │ │ ├── easypr.h
│ │ │ ├── easypr
│ │ │ │ ├── api.hpp
│ │ │ │ ├── config.h
│ │ │ │ ├── core
│ │ │ │ │ ├── character.hpp
│ │ │ │ │ ├── chars_identify.h
│ │ │ │ │ ├── chars_recognise.h
│ │ │ │ │ ├── chars_segment.h
│ │ │ │ │ ├── core_func.h
│ │ │ │ │ ├── feature.h
│ │ │ │ │ ├── params.h
│ │ │ │ │ ├── plate.hpp
│ │ │ │ │ ├── plate_detect.h
│ │ │ │ │ ├── plate_judge.h
│ │ │ │ │ ├── plate_locate.h
│ │ │ │ │ └── plate_recognize.h
│ │ │ │ ├── train
│ │ │ │ │ ├── annCh_train.h
│ │ │ │ │ ├── ann_train.h
│ │ │ │ │ ├── create_data.h
│ │ │ │ │ ├── svm_train.h
│ │ │ │ │ └── train.h
│ │ │ │ ├── util
│ │ │ │ │ ├── kv.h
│ │ │ │ │ ├── program_options.h
│ │ │ │ │ ├── switch.hpp
│ │ │ │ │ └── util.h
│ │ │ │ └── version.h
│ │ │ ├── freetype
│ │ │ │ ├── config
│ │ │ │ │ ├── ftconfig.h
│ │ │ │ │ ├── ftheader.h
│ │ │ │ │ ├── ftmodule.h
│ │ │ │ │ ├── ftoption.h
│ │ │ │ │ └── ftstdlib.h
│ │ │ │ ├── freetype.h
│ │ │ │ ├── ftadvanc.h
│ │ │ │ ├── ftbbox.h
│ │ │ │ ├── ftbdf.h
│ │ │ │ ├── ftbitmap.h
│ │ │ │ ├── ftcache.h
│ │ │ │ ├── ftchapters.h
│ │ │ │ ├── ftcid.h
│ │ │ │ ├── fterrdef.h
│ │ │ │ ├── fterrors.h
│ │ │ │ ├── ftgasp.h
│ │ │ │ ├── ftglyph.h
│ │ │ │ ├── ftgxval.h
│ │ │ │ ├── ftgzip.h
│ │ │ │ ├── ftimage.h
│ │ │ │ ├── ftincrem.h
│ │ │ │ ├── ftlcdfil.h
│ │ │ │ ├── ftlist.h
│ │ │ │ ├── ftlzw.h
│ │ │ │ ├── ftmac.h
│ │ │ │ ├── ftmm.h
│ │ │ │ ├── ftmodapi.h
│ │ │ │ ├── ftmoderr.h
│ │ │ │ ├── ftotval.h
│ │ │ │ ├── ftoutln.h
│ │ │ │ ├── ftpfr.h
│ │ │ │ ├── ftrender.h
│ │ │ │ ├── ftsizes.h
│ │ │ │ ├── ftsnames.h
│ │ │ │ ├── ftstroke.h
│ │ │ │ ├── ftsynth.h
│ │ │ │ ├── ftsystem.h
│ │ │ │ ├── fttrigon.h
│ │ │ │ ├── fttypes.h
│ │ │ │ ├── ftwinfnt.h
│ │ │ │ ├── ftxf86.h
│ │ │ │ ├── internal
│ │ │ │ │ ├── autohint.h
│ │ │ │ │ ├── ftcalc.h
│ │ │ │ │ ├── ftdebug.h
│ │ │ │ │ ├── ftdriver.h
│ │ │ │ │ ├── ftgloadr.h
│ │ │ │ │ ├── ftmemory.h
│ │ │ │ │ ├── ftobjs.h
│ │ │ │ │ ├── ftpic.h
│ │ │ │ │ ├── ftrfork.h
│ │ │ │ │ ├── ftserv.h
│ │ │ │ │ ├── ftstream.h
│ │ │ │ │ ├── fttrace.h
│ │ │ │ │ ├── ftvalid.h
│ │ │ │ │ ├── internal.h
│ │ │ │ │ ├── pcftypes.h
│ │ │ │ │ ├── psaux.h
│ │ │ │ │ ├── pshints.h
│ │ │ │ │ ├── services
│ │ │ │ │ │ ├── svbdf.h
│ │ │ │ │ │ ├── svcid.h
│ │ │ │ │ │ ├── svgldict.h
│ │ │ │ │ │ ├── svgxval.h
│ │ │ │ │ │ ├── svkern.h
│ │ │ │ │ │ ├── svmm.h
│ │ │ │ │ │ ├── svotval.h
│ │ │ │ │ │ ├── svpfr.h
│ │ │ │ │ │ ├── svpostnm.h
│ │ │ │ │ │ ├── svpscmap.h
│ │ │ │ │ │ ├── svpsinfo.h
│ │ │ │ │ │ ├── svsfnt.h
│ │ │ │ │ │ ├── svttcmap.h
│ │ │ │ │ │ ├── svtteng.h
│ │ │ │ │ │ ├── svttglyf.h
│ │ │ │ │ │ ├── svwinfnt.h
│ │ │ │ │ │ └── svxf86nm.h
│ │ │ │ │ ├── sfnt.h
│ │ │ │ │ ├── t1types.h
│ │ │ │ │ └── tttypes.h
│ │ │ │ ├── t1tables.h
│ │ │ │ ├── ttnameid.h
│ │ │ │ ├── tttables.h
│ │ │ │ ├── tttags.h
│ │ │ │ └── ttunpat.h
│ │ │ ├── ft2build.h
│ │ │ ├── opencv
│ │ │ │ ├── cv.h
│ │ │ │ ├── cv.hpp
│ │ │ │ ├── cvaux.h
│ │ │ │ ├── cvaux.hpp
│ │ │ │ ├── cvwimage.h
│ │ │ │ ├── cxcore.h
│ │ │ │ ├── cxcore.hpp
│ │ │ │ ├── cxeigen.hpp
│ │ │ │ ├── cxmisc.h
│ │ │ │ ├── highgui.h
│ │ │ │ └── ml.h
│ │ │ └── opencv2
│ │ │ │ ├── aruco.hpp
│ │ │ │ ├── aruco
│ │ │ │ ├── charuco.hpp
│ │ │ │ └── dictionary.hpp
│ │ │ │ ├── bgsegm.hpp
│ │ │ │ ├── bioinspired.hpp
│ │ │ │ ├── bioinspired
│ │ │ │ ├── bioinspired.hpp
│ │ │ │ ├── retina.hpp
│ │ │ │ ├── retinafasttonemapping.hpp
│ │ │ │ └── transientareassegmentationmodule.hpp
│ │ │ │ ├── calib3d.hpp
│ │ │ │ ├── calib3d
│ │ │ │ ├── calib3d.hpp
│ │ │ │ └── calib3d_c.h
│ │ │ │ ├── ccalib.hpp
│ │ │ │ ├── ccalib
│ │ │ │ ├── multicalib.hpp
│ │ │ │ ├── omnidir.hpp
│ │ │ │ └── randpattern.hpp
│ │ │ │ ├── core.hpp
│ │ │ │ ├── core
│ │ │ │ ├── affine.hpp
│ │ │ │ ├── base.hpp
│ │ │ │ ├── bufferpool.hpp
│ │ │ │ ├── core.hpp
│ │ │ │ ├── core_c.h
│ │ │ │ ├── cuda.hpp
│ │ │ │ ├── cuda.inl.hpp
│ │ │ │ ├── cuda
│ │ │ │ │ ├── block.hpp
│ │ │ │ │ ├── border_interpolate.hpp
│ │ │ │ │ ├── color.hpp
│ │ │ │ │ ├── common.hpp
│ │ │ │ │ ├── datamov_utils.hpp
│ │ │ │ │ ├── detail
│ │ │ │ │ │ ├── color_detail.hpp
│ │ │ │ │ │ ├── reduce.hpp
│ │ │ │ │ │ ├── reduce_key_val.hpp
│ │ │ │ │ │ ├── transform_detail.hpp
│ │ │ │ │ │ ├── type_traits_detail.hpp
│ │ │ │ │ │ └── vec_distance_detail.hpp
│ │ │ │ │ ├── dynamic_smem.hpp
│ │ │ │ │ ├── emulation.hpp
│ │ │ │ │ ├── filters.hpp
│ │ │ │ │ ├── funcattrib.hpp
│ │ │ │ │ ├── functional.hpp
│ │ │ │ │ ├── limits.hpp
│ │ │ │ │ ├── reduce.hpp
│ │ │ │ │ ├── saturate_cast.hpp
│ │ │ │ │ ├── scan.hpp
│ │ │ │ │ ├── simd_functions.hpp
│ │ │ │ │ ├── transform.hpp
│ │ │ │ │ ├── type_traits.hpp
│ │ │ │ │ ├── utility.hpp
│ │ │ │ │ ├── vec_distance.hpp
│ │ │ │ │ ├── vec_math.hpp
│ │ │ │ │ ├── vec_traits.hpp
│ │ │ │ │ ├── warp.hpp
│ │ │ │ │ ├── warp_reduce.hpp
│ │ │ │ │ └── warp_shuffle.hpp
│ │ │ │ ├── cuda_stream_accessor.hpp
│ │ │ │ ├── cuda_types.hpp
│ │ │ │ ├── cv_cpu_dispatch.h
│ │ │ │ ├── cv_cpu_helper.h
│ │ │ │ ├── cvdef.h
│ │ │ │ ├── cvstd.hpp
│ │ │ │ ├── cvstd.inl.hpp
│ │ │ │ ├── directx.hpp
│ │ │ │ ├── eigen.hpp
│ │ │ │ ├── fast_math.hpp
│ │ │ │ ├── hal
│ │ │ │ │ ├── hal.hpp
│ │ │ │ │ ├── interface.h
│ │ │ │ │ ├── intrin.hpp
│ │ │ │ │ ├── intrin_cpp.hpp
│ │ │ │ │ ├── intrin_neon.hpp
│ │ │ │ │ ├── intrin_sse.hpp
│ │ │ │ │ └── intrin_vsx.hpp
│ │ │ │ ├── ippasync.hpp
│ │ │ │ ├── mat.hpp
│ │ │ │ ├── mat.inl.hpp
│ │ │ │ ├── matx.hpp
│ │ │ │ ├── neon_utils.hpp
│ │ │ │ ├── ocl.hpp
│ │ │ │ ├── ocl_genbase.hpp
│ │ │ │ ├── opengl.hpp
│ │ │ │ ├── operations.hpp
│ │ │ │ ├── optim.hpp
│ │ │ │ ├── ovx.hpp
│ │ │ │ ├── persistence.hpp
│ │ │ │ ├── ptr.inl.hpp
│ │ │ │ ├── saturate.hpp
│ │ │ │ ├── softfloat.hpp
│ │ │ │ ├── sse_utils.hpp
│ │ │ │ ├── traits.hpp
│ │ │ │ ├── types.hpp
│ │ │ │ ├── types_c.h
│ │ │ │ ├── utility.hpp
│ │ │ │ ├── utils
│ │ │ │ │ ├── logger.hpp
│ │ │ │ │ └── trace.hpp
│ │ │ │ ├── va_intel.hpp
│ │ │ │ ├── version.hpp
│ │ │ │ ├── vsx_utils.hpp
│ │ │ │ └── wimage.hpp
│ │ │ │ ├── cvconfig.h
│ │ │ │ ├── datasets
│ │ │ │ ├── ar_hmdb.hpp
│ │ │ │ ├── ar_sports.hpp
│ │ │ │ ├── dataset.hpp
│ │ │ │ ├── fr_adience.hpp
│ │ │ │ ├── fr_lfw.hpp
│ │ │ │ ├── gr_chalearn.hpp
│ │ │ │ ├── gr_skig.hpp
│ │ │ │ ├── hpe_humaneva.hpp
│ │ │ │ ├── hpe_parse.hpp
│ │ │ │ ├── ir_affine.hpp
│ │ │ │ ├── ir_robot.hpp
│ │ │ │ ├── is_bsds.hpp
│ │ │ │ ├── is_weizmann.hpp
│ │ │ │ ├── msm_epfl.hpp
│ │ │ │ ├── msm_middlebury.hpp
│ │ │ │ ├── or_imagenet.hpp
│ │ │ │ ├── or_mnist.hpp
│ │ │ │ ├── or_pascal.hpp
│ │ │ │ ├── or_sun.hpp
│ │ │ │ ├── pd_caltech.hpp
│ │ │ │ ├── pd_inria.hpp
│ │ │ │ ├── slam_kitti.hpp
│ │ │ │ ├── slam_tumindoor.hpp
│ │ │ │ ├── tr_chars.hpp
│ │ │ │ ├── tr_icdar.hpp
│ │ │ │ ├── tr_svt.hpp
│ │ │ │ ├── track_alov.hpp
│ │ │ │ ├── track_vot.hpp
│ │ │ │ └── util.hpp
│ │ │ │ ├── dnn.hpp
│ │ │ │ ├── dnn
│ │ │ │ ├── all_layers.hpp
│ │ │ │ ├── dict.hpp
│ │ │ │ ├── dnn.hpp
│ │ │ │ ├── dnn.inl.hpp
│ │ │ │ ├── layer.details.hpp
│ │ │ │ ├── layer.hpp
│ │ │ │ └── shape_utils.hpp
│ │ │ │ ├── dpm.hpp
│ │ │ │ ├── face.hpp
│ │ │ │ ├── face
│ │ │ │ ├── bif.hpp
│ │ │ │ ├── facerec.hpp
│ │ │ │ └── predict_collector.hpp
│ │ │ │ ├── features2d.hpp
│ │ │ │ ├── features2d
│ │ │ │ └── features2d.hpp
│ │ │ │ ├── flann.hpp
│ │ │ │ ├── flann
│ │ │ │ ├── all_indices.h
│ │ │ │ ├── allocator.h
│ │ │ │ ├── any.h
│ │ │ │ ├── autotuned_index.h
│ │ │ │ ├── composite_index.h
│ │ │ │ ├── config.h
│ │ │ │ ├── defines.h
│ │ │ │ ├── dist.h
│ │ │ │ ├── dummy.h
│ │ │ │ ├── dynamic_bitset.h
│ │ │ │ ├── flann.hpp
│ │ │ │ ├── flann_base.hpp
│ │ │ │ ├── general.h
│ │ │ │ ├── ground_truth.h
│ │ │ │ ├── hdf5.h
│ │ │ │ ├── heap.h
│ │ │ │ ├── hierarchical_clustering_index.h
│ │ │ │ ├── index_testing.h
│ │ │ │ ├── kdtree_index.h
│ │ │ │ ├── kdtree_single_index.h
│ │ │ │ ├── kmeans_index.h
│ │ │ │ ├── linear_index.h
│ │ │ │ ├── logger.h
│ │ │ │ ├── lsh_index.h
│ │ │ │ ├── lsh_table.h
│ │ │ │ ├── matrix.h
│ │ │ │ ├── miniflann.hpp
│ │ │ │ ├── nn_index.h
│ │ │ │ ├── object_factory.h
│ │ │ │ ├── params.h
│ │ │ │ ├── random.h
│ │ │ │ ├── result_set.h
│ │ │ │ ├── sampling.h
│ │ │ │ ├── saving.h
│ │ │ │ ├── simplex_downhill.h
│ │ │ │ └── timer.h
│ │ │ │ ├── fuzzy.hpp
│ │ │ │ ├── fuzzy
│ │ │ │ ├── fuzzy_F0_math.hpp
│ │ │ │ ├── fuzzy_F1_math.hpp
│ │ │ │ ├── fuzzy_image.hpp
│ │ │ │ └── types.hpp
│ │ │ │ ├── highgui.hpp
│ │ │ │ ├── highgui
│ │ │ │ ├── highgui.hpp
│ │ │ │ └── highgui_c.h
│ │ │ │ ├── img_hash.hpp
│ │ │ │ ├── img_hash
│ │ │ │ ├── average_hash.hpp
│ │ │ │ ├── block_mean_hash.hpp
│ │ │ │ ├── color_moment_hash.hpp
│ │ │ │ ├── img_hash_base.hpp
│ │ │ │ ├── marr_hildreth_hash.hpp
│ │ │ │ ├── phash.hpp
│ │ │ │ └── radial_variance_hash.hpp
│ │ │ │ ├── imgcodecs.hpp
│ │ │ │ ├── imgcodecs
│ │ │ │ ├── imgcodecs.hpp
│ │ │ │ ├── imgcodecs_c.h
│ │ │ │ └── ios.h
│ │ │ │ ├── imgproc.hpp
│ │ │ │ ├── imgproc
│ │ │ │ ├── detail
│ │ │ │ │ └── distortion_model.hpp
│ │ │ │ ├── hal
│ │ │ │ │ ├── hal.hpp
│ │ │ │ │ └── interface.h
│ │ │ │ ├── imgproc.hpp
│ │ │ │ ├── imgproc_c.h
│ │ │ │ └── types_c.h
│ │ │ │ ├── line_descriptor.hpp
│ │ │ │ ├── line_descriptor
│ │ │ │ └── descriptor.hpp
│ │ │ │ ├── ml.hpp
│ │ │ │ ├── ml
│ │ │ │ └── ml.hpp
│ │ │ │ ├── objdetect.hpp
│ │ │ │ ├── objdetect
│ │ │ │ ├── detection_based_tracker.hpp
│ │ │ │ ├── objdetect.hpp
│ │ │ │ └── objdetect_c.h
│ │ │ │ ├── opencv.hpp
│ │ │ │ ├── opencv_modules.hpp
│ │ │ │ ├── optflow.hpp
│ │ │ │ ├── optflow
│ │ │ │ ├── motempl.hpp
│ │ │ │ ├── pcaflow.hpp
│ │ │ │ └── sparse_matching_gpc.hpp
│ │ │ │ ├── phase_unwrapping.hpp
│ │ │ │ ├── phase_unwrapping
│ │ │ │ ├── histogramphaseunwrapping.hpp
│ │ │ │ └── phase_unwrapping.hpp
│ │ │ │ ├── photo.hpp
│ │ │ │ ├── photo
│ │ │ │ ├── cuda.hpp
│ │ │ │ ├── photo.hpp
│ │ │ │ └── photo_c.h
│ │ │ │ ├── plot.hpp
│ │ │ │ ├── reg
│ │ │ │ ├── map.hpp
│ │ │ │ ├── mapaffine.hpp
│ │ │ │ ├── mapper.hpp
│ │ │ │ ├── mappergradaffine.hpp
│ │ │ │ ├── mappergradeuclid.hpp
│ │ │ │ ├── mappergradproj.hpp
│ │ │ │ ├── mappergradshift.hpp
│ │ │ │ ├── mappergradsimilar.hpp
│ │ │ │ ├── mapperpyramid.hpp
│ │ │ │ ├── mapprojec.hpp
│ │ │ │ └── mapshift.hpp
│ │ │ │ ├── rgbd.hpp
│ │ │ │ ├── rgbd
│ │ │ │ └── linemod.hpp
│ │ │ │ ├── saliency.hpp
│ │ │ │ ├── saliency
│ │ │ │ ├── saliencyBaseClasses.hpp
│ │ │ │ └── saliencySpecializedClasses.hpp
│ │ │ │ ├── shape.hpp
│ │ │ │ ├── shape
│ │ │ │ ├── emdL1.hpp
│ │ │ │ ├── hist_cost.hpp
│ │ │ │ ├── shape.hpp
│ │ │ │ ├── shape_distance.hpp
│ │ │ │ └── shape_transformer.hpp
│ │ │ │ ├── stereo.hpp
│ │ │ │ ├── stereo
│ │ │ │ ├── descriptor.hpp
│ │ │ │ ├── matching.hpp
│ │ │ │ └── stereo.hpp
│ │ │ │ ├── stitching.hpp
│ │ │ │ ├── stitching
│ │ │ │ ├── detail
│ │ │ │ │ ├── autocalib.hpp
│ │ │ │ │ ├── blenders.hpp
│ │ │ │ │ ├── camera.hpp
│ │ │ │ │ ├── exposure_compensate.hpp
│ │ │ │ │ ├── matchers.hpp
│ │ │ │ │ ├── motion_estimators.hpp
│ │ │ │ │ ├── seam_finders.hpp
│ │ │ │ │ ├── timelapsers.hpp
│ │ │ │ │ ├── util.hpp
│ │ │ │ │ ├── util_inl.hpp
│ │ │ │ │ ├── warpers.hpp
│ │ │ │ │ └── warpers_inl.hpp
│ │ │ │ └── warpers.hpp
│ │ │ │ ├── structured_light.hpp
│ │ │ │ ├── structured_light
│ │ │ │ ├── graycodepattern.hpp
│ │ │ │ ├── sinusoidalpattern.hpp
│ │ │ │ └── structured_light.hpp
│ │ │ │ ├── superres.hpp
│ │ │ │ ├── superres
│ │ │ │ └── optical_flow.hpp
│ │ │ │ ├── surface_matching.hpp
│ │ │ │ ├── surface_matching
│ │ │ │ ├── icp.hpp
│ │ │ │ ├── pose_3d.hpp
│ │ │ │ ├── ppf_helpers.hpp
│ │ │ │ ├── ppf_match_3d.hpp
│ │ │ │ └── t_hash_int.hpp
│ │ │ │ ├── text.hpp
│ │ │ │ ├── text
│ │ │ │ ├── erfilter.hpp
│ │ │ │ └── ocr.hpp
│ │ │ │ ├── tracking.hpp
│ │ │ │ ├── tracking
│ │ │ │ ├── feature.hpp
│ │ │ │ ├── kalman_filters.hpp
│ │ │ │ ├── onlineBoosting.hpp
│ │ │ │ ├── onlineMIL.hpp
│ │ │ │ ├── tldDataset.hpp
│ │ │ │ ├── tracker.hpp
│ │ │ │ └── tracking.hpp
│ │ │ │ ├── video.hpp
│ │ │ │ ├── video
│ │ │ │ ├── background_segm.hpp
│ │ │ │ ├── tracking.hpp
│ │ │ │ ├── tracking_c.h
│ │ │ │ └── video.hpp
│ │ │ │ ├── videoio.hpp
│ │ │ │ ├── videoio
│ │ │ │ ├── cap_ios.h
│ │ │ │ ├── videoio.hpp
│ │ │ │ └── videoio_c.h
│ │ │ │ ├── videostab.hpp
│ │ │ │ ├── videostab
│ │ │ │ ├── deblurring.hpp
│ │ │ │ ├── fast_marching.hpp
│ │ │ │ ├── fast_marching_inl.hpp
│ │ │ │ ├── frame_source.hpp
│ │ │ │ ├── global_motion.hpp
│ │ │ │ ├── inpainting.hpp
│ │ │ │ ├── log.hpp
│ │ │ │ ├── motion_core.hpp
│ │ │ │ ├── motion_stabilizing.hpp
│ │ │ │ ├── optical_flow.hpp
│ │ │ │ ├── outlier_rejection.hpp
│ │ │ │ ├── ring_buffer.hpp
│ │ │ │ ├── stabilizer.hpp
│ │ │ │ └── wobble_suppression.hpp
│ │ │ │ ├── xfeatures2d.hpp
│ │ │ │ ├── xfeatures2d
│ │ │ │ ├── cuda.hpp
│ │ │ │ └── nonfree.hpp
│ │ │ │ ├── ximgproc.hpp
│ │ │ │ ├── ximgproc
│ │ │ │ ├── deriche_filter.hpp
│ │ │ │ ├── disparity_filter.hpp
│ │ │ │ ├── edge_filter.hpp
│ │ │ │ ├── estimated_covariance.hpp
│ │ │ │ ├── fast_hough_transform.hpp
│ │ │ │ ├── fast_line_detector.hpp
│ │ │ │ ├── lsc.hpp
│ │ │ │ ├── paillou_filter.hpp
│ │ │ │ ├── peilin.hpp
│ │ │ │ ├── seeds.hpp
│ │ │ │ ├── segmentation.hpp
│ │ │ │ ├── slic.hpp
│ │ │ │ ├── sparse_match_interpolator.hpp
│ │ │ │ ├── structured_edge_detection.hpp
│ │ │ │ └── weighted_median_filter.hpp
│ │ │ │ ├── xobjdetect.hpp
│ │ │ │ ├── xphoto.hpp
│ │ │ │ └── xphoto
│ │ │ │ ├── bm3d_image_denoising.hpp
│ │ │ │ ├── dct_image_denoising.hpp
│ │ │ │ ├── inpainting.hpp
│ │ │ │ └── white_balance.hpp
│ │ ├── jni.cpp
│ │ ├── main.cpp
│ │ ├── mrcar.cpp
│ │ ├── mrcar.h
│ │ ├── src
│ │ │ ├── core
│ │ │ │ ├── chars_identify.cpp
│ │ │ │ ├── chars_recognise.cpp
│ │ │ │ ├── chars_segment.cpp
│ │ │ │ ├── core_func.cpp
│ │ │ │ ├── feature.cpp
│ │ │ │ ├── params.cpp
│ │ │ │ ├── plate_detect.cpp
│ │ │ │ ├── plate_judge.cpp
│ │ │ │ ├── plate_locate.cpp
│ │ │ │ └── plate_recognize.cpp
│ │ │ ├── train
│ │ │ │ ├── annCh_train.cpp
│ │ │ │ ├── ann_train.cpp
│ │ │ │ ├── create_data.cpp
│ │ │ │ ├── svm_train.cpp
│ │ │ │ └── train.cpp
│ │ │ └── util
│ │ │ │ ├── kv.cpp
│ │ │ │ ├── program_options.cpp
│ │ │ │ └── util.cpp
│ │ ├── thirdparty
│ │ │ ├── CMakeLists.txt
│ │ │ ├── LBP
│ │ │ │ ├── helper.cpp
│ │ │ │ ├── helper.hpp
│ │ │ │ ├── lbp.cpp
│ │ │ │ └── lbp.hpp
│ │ │ ├── mser
│ │ │ │ ├── mser2.cpp
│ │ │ │ └── mser2.hpp
│ │ │ ├── svm
│ │ │ │ ├── corrected_svm.cpp
│ │ │ │ └── precomp.hpp
│ │ │ ├── textDetect
│ │ │ │ ├── erfilter.cpp
│ │ │ │ └── erfilter.hpp
│ │ │ └── xmlParser
│ │ │ │ ├── AFPL-license.txt
│ │ │ │ ├── xmlParser.cpp
│ │ │ │ └── xmlParser.h
│ │ └── util.h
│ ├── jniLibs
│ │ ├── arm64-v8a
│ │ │ ├── libfreetype2-static.a
│ │ │ └── libopencv_java3.so
│ │ └── armeabi-v7a
│ │ │ ├── libfreetype2-static.a
│ │ │ └── libopencv_java3.so
│ └── res
│ │ ├── drawable
│ │ ├── camera.png
│ │ └── folder.png
│ │ ├── layout
│ │ ├── activity_camera.xml
│ │ ├── activity_cvcamera.xml
│ │ └── activity_main.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── raw
│ │ └── zxl_beep.mp3
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── yanyu
│ └── com
│ └── mrcar
│ └── ExampleUnitTest.java
├── build.gradle
├── cameralive.png
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── openCVLibrary320
├── AndroidManifest.xml
├── build.gradle
├── lint.xml
├── project.properties
├── res
│ └── values
│ │ └── attrs.xml
└── src
│ └── org
│ └── opencv
│ ├── android
│ ├── AsyncServiceHelper.java
│ ├── BaseLoaderCallback.java
│ ├── Camera2Renderer.java
│ ├── CameraBridgeViewBase.java
│ ├── CameraGLRendererBase.java
│ ├── CameraGLSurfaceView.java
│ ├── CameraRenderer.java
│ ├── FpsMeter.java
│ ├── InstallCallbackInterface.java
│ ├── JavaCameraView.java
│ ├── LoaderCallbackInterface.java
│ ├── OpenCVLoader.java
│ ├── StaticHelper.java
│ └── Utils.java
│ ├── aruco
│ ├── Aruco.java
│ ├── Board.java
│ ├── CharucoBoard.java
│ ├── DetectorParameters.java
│ ├── Dictionary.java
│ └── GridBoard.java
│ ├── bioinspired
│ ├── Bioinspired.java
│ ├── Retina.java
│ ├── RetinaFastToneMapping.java
│ └── TransientAreasSegmentationModule.java
│ ├── calib3d
│ ├── Calib3d.java
│ ├── StereoBM.java
│ ├── StereoMatcher.java
│ └── StereoSGBM.java
│ ├── core
│ ├── Algorithm.java
│ ├── Core.java
│ ├── CvException.java
│ ├── CvType.java
│ ├── DMatch.java
│ ├── KeyPoint.java
│ ├── Mat.java
│ ├── MatOfByte.java
│ ├── MatOfDMatch.java
│ ├── MatOfDouble.java
│ ├── MatOfFloat.java
│ ├── MatOfFloat4.java
│ ├── MatOfFloat6.java
│ ├── MatOfInt.java
│ ├── MatOfInt4.java
│ ├── MatOfKeyPoint.java
│ ├── MatOfPoint.java
│ ├── MatOfPoint2f.java
│ ├── MatOfPoint3.java
│ ├── MatOfPoint3f.java
│ ├── MatOfRect.java
│ ├── MatOfRect2d.java
│ ├── Point.java
│ ├── Point3.java
│ ├── Range.java
│ ├── Rect.java
│ ├── Rect2d.java
│ ├── RotatedRect.java
│ ├── Scalar.java
│ ├── Size.java
│ ├── TermCriteria.java
│ └── TickMeter.java
│ ├── dnn
│ ├── DictValue.java
│ ├── Dnn.java
│ ├── Importer.java
│ ├── Layer.java
│ └── Net.java
│ ├── engine
│ └── OpenCVEngineInterface.aidl
│ ├── features2d
│ ├── AKAZE.java
│ ├── AgastFeatureDetector.java
│ ├── BFMatcher.java
│ ├── BOWImgDescriptorExtractor.java
│ ├── BOWKMeansTrainer.java
│ ├── BOWTrainer.java
│ ├── BRISK.java
│ ├── DescriptorExtractor.java
│ ├── DescriptorMatcher.java
│ ├── FastFeatureDetector.java
│ ├── Feature2D.java
│ ├── FeatureDetector.java
│ ├── Features2d.java
│ ├── FlannBasedMatcher.java
│ ├── GFTTDetector.java
│ ├── KAZE.java
│ ├── MSER.java
│ ├── ORB.java
│ └── Params.java
│ ├── img_hash
│ ├── AverageHash.java
│ ├── BlockMeanHash.java
│ ├── ColorMomentHash.java
│ ├── ImgHashBase.java
│ ├── Img_hash.java
│ ├── MarrHildrethHash.java
│ ├── PHash.java
│ └── RadialVarianceHash.java
│ ├── imgcodecs
│ └── Imgcodecs.java
│ ├── imgproc
│ ├── CLAHE.java
│ ├── Imgproc.java
│ ├── LineSegmentDetector.java
│ ├── Moments.java
│ └── Subdiv2D.java
│ ├── ml
│ ├── ANN_MLP.java
│ ├── Boost.java
│ ├── DTrees.java
│ ├── EM.java
│ ├── KNearest.java
│ ├── LogisticRegression.java
│ ├── Ml.java
│ ├── NormalBayesClassifier.java
│ ├── ParamGrid.java
│ ├── RTrees.java
│ ├── SVM.java
│ ├── SVMSGD.java
│ ├── StatModel.java
│ └── TrainData.java
│ ├── objdetect
│ ├── BaseCascadeClassifier.java
│ ├── CascadeClassifier.java
│ ├── HOGDescriptor.java
│ └── Objdetect.java
│ ├── osgi
│ ├── OpenCVInterface.java
│ └── OpenCVNativeLoader.java
│ ├── phase_unwrapping
│ ├── HistogramPhaseUnwrapping.java
│ ├── PhaseUnwrapping.java
│ └── Phase_unwrapping.java
│ ├── photo
│ ├── AlignExposures.java
│ ├── AlignMTB.java
│ ├── CalibrateCRF.java
│ ├── CalibrateDebevec.java
│ ├── CalibrateRobertson.java
│ ├── MergeDebevec.java
│ ├── MergeExposures.java
│ ├── MergeMertens.java
│ ├── MergeRobertson.java
│ ├── Photo.java
│ ├── Tonemap.java
│ ├── TonemapDrago.java
│ ├── TonemapDurand.java
│ ├── TonemapMantiuk.java
│ └── TonemapReinhard.java
│ ├── structured_light
│ ├── GrayCodePattern.java
│ ├── Params.java
│ ├── SinusoidalPattern.java
│ ├── StructuredLightPattern.java
│ └── Structured_light.java
│ ├── text
│ ├── BaseOCR.java
│ ├── Callback.java
│ ├── ClassifierCallback.java
│ ├── ERFilter.java
│ ├── OCRBeamSearchDecoder.java
│ ├── OCRHMMDecoder.java
│ ├── OCRTesseract.java
│ └── Text.java
│ ├── tracking
│ ├── MultiTracker.java
│ ├── Tracker.java
│ ├── TrackerBoosting.java
│ ├── TrackerGOTURN.java
│ ├── TrackerKCF.java
│ ├── TrackerMIL.java
│ ├── TrackerMedianFlow.java
│ ├── TrackerTLD.java
│ └── Tracking.java
│ ├── utils
│ └── Converters.java
│ ├── video
│ ├── BackgroundSubtractor.java
│ ├── BackgroundSubtractorKNN.java
│ ├── BackgroundSubtractorMOG2.java
│ ├── DenseOpticalFlow.java
│ ├── DualTVL1OpticalFlow.java
│ ├── FarnebackOpticalFlow.java
│ ├── KalmanFilter.java
│ ├── SparseOpticalFlow.java
│ ├── SparsePyrLKOpticalFlow.java
│ └── Video.java
│ ├── videoio
│ ├── VideoCapture.java
│ ├── VideoWriter.java
│ └── Videoio.java
│ └── xfeatures2d
│ ├── BoostDesc.java
│ ├── BriefDescriptorExtractor.java
│ ├── DAISY.java
│ ├── FREAK.java
│ ├── HarrisLaplaceFeatureDetector.java
│ ├── LATCH.java
│ ├── LUCID.java
│ ├── MSDDetector.java
│ ├── PCTSignatures.java
│ ├── PCTSignaturesSQFD.java
│ ├── SIFT.java
│ ├── SURF.java
│ ├── StarDetector.java
│ ├── VGG.java
│ └── Xfeatures2d.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea
5 | .DS_Store
6 | build/
7 | app/build/
8 | app/.externalNativeBuild
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 基于EasyPR的车牌识别android实现
2 |
3 | EasyPR4Android,基于[EasyPR](https://github.com/liuruoze/EasyPR)1.6的android实现, 提供编译好的[mrcar.apk](https://github.com/imistyrain/EasyPR4Android/releases)安装运行demo.
4 |
5 | ### 效果图
6 |
7 | 特性:动态注册jni函数, 摄像头实时预览
8 |
9 |
10 |
11 | ### 编译和运行:
12 |
13 | 环境: android studio3.5开发实现,ndk版本为R16b,OpenCV版本为3.2,android SDK版本为28,最低要求21。
14 |
15 | * 1.下载并配置[android studio 3.5](http://www.android-studio.org/)
16 |
17 | * 2.配置NDK16b[ndk r16b](http://blog.csdn.net/shuzfan/article/details/52690554)
18 |
19 | * 3.编译并运行,也可以直接下载编译好的[apk](https://github.com/imistyrain/EasyPR4Android/releases)安装使用
20 |
21 | 本项目定义了三个Activity, 其中
22 |
23 | * [PhotoActivity](app/src/main/java/yanyu/com/mrcar/PhotoActivity.java)是从图片和系统相机抓取图片进行识别
24 |
25 | * [CVCameraActivity](app/src/main/java/yanyu/com/mrcar/CVCameraActivity.java)是用OpenCV的JavaCameraView实时识别,由于OpenCV实现的限制,其只能用于横屏,虽然也有trick能使其支持竖屏,但会有性能损失,为此产生了第三种
26 |
27 | * [CameraActivity](app/src/main/java/yanyu/com/mrcar/CameraActivity.java)原始摄像头实时识别,抓取NV21数据送到jni中,并将其抓换成RGB数据进行处理,其支持竖屏识别。
28 |
29 | ### 参考:
30 |
31 | * 1.[Native方式集成OpenCV](https://github.com/ShawnZhang31/opencv-android-studio)
32 |
33 | * 3.[Android Camera1 教程 · 第二章 · 预览](https://www.jianshu.com/p/705d4792e836)
34 |
35 | * 4.[ios 端车牌识别](https://github.com/imistyrain/EasyPR-Swift)
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Sets the minimum version of CMake required to build the native
2 | # library. You should either keep the default value or only pass a
3 | # value of 3.4.0 or lower.
4 |
5 | cmake_minimum_required(VERSION 3.4.1)
6 |
7 | set(LIB_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/jniLibs/${ANDROID_ABI}/)
8 |
9 | #add include dir
10 | include_directories(src/main/jni/include)
11 | include_directories(src/main/jni)
12 |
13 | #add source files
14 | aux_source_directory(src/main/jni SOURCE_FILES)
15 | aux_source_directory(src/main/jni/src/core SOURCE_FILES_CORE)
16 | aux_source_directory(src/main/jni/src/train SOURCE_FILES_TRAIN)
17 | aux_source_directory(src/main/jni/src/util SOURCE_FILES_UTIL)
18 | aux_source_directory(src/main/jni/thirdparty/LBP SOURCE_FILES_LBP)
19 | aux_source_directory(src/main/jni/thirdparty/mser SOURCE_FILES_MSER)
20 | aux_source_directory(src/main/jni/thirdparty/svm SOURCE_FILES_SVM)
21 | aux_source_directory(src/main/jni/thirdparty/textDetect SOURCE_FILES_TEXTDETECT)
22 | aux_source_directory(src/main/jni/thirdparty/xmlParser SOURCE_FILES_XML)
23 | list(REMOVE_ITEM SOURCE_FILES main.cpp)
24 | list(APPEND SOURCE_FILES ${SOURCE_FILES_CORE})
25 | list(APPEND SOURCE_FILES ${SOURCE_FILES_SOURCE_FILES_SVM})
26 | list(APPEND SOURCE_FILES ${SOURCE_FILES_CORE})
27 | list(APPEND SOURCE_FILES ${SOURCE_FILES_TRAIN})
28 | list(APPEND SOURCE_FILES ${SOURCE_FILES_UTIL})
29 | list(APPEND SOURCE_FILES ${SOURCE_FILES_LBP})
30 | list(APPEND SOURCE_FILES ${SOURCE_FILES_MSER})
31 | list(APPEND SOURCE_FILES ${SOURCE_FILES_TEXTDETECT})
32 | list(APPEND SOURCE_FILES ${SOURCE_FILES_XML})
33 | list(APPEND SOURCE_FILES "src/main/jni/jni.cpp")
34 |
35 | add_library(lib_opencv_java3 SHARED IMPORTED)
36 | add_library(lib_freetype STATIC IMPORTED)
37 | set_target_properties(lib_opencv_java3 PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/libopencv_java3.so)
38 | set_target_properties(lib_freetype PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/libfreetype2-static.a)
39 | add_library(mrcar SHARED ${SOURCE_FILES})
40 |
41 | find_library(log-lib log)
42 | target_link_libraries(mrcar lib_opencv_java3 ${log-lib} lib_freetype)
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion "28.0.3"
6 | defaultConfig {
7 | applicationId "yanyu.com.mrcar"
8 | minSdkVersion 21
9 | targetSdkVersion 28
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | ndk{
14 | abiFilters 'arm64-v8a'//armeabi-v7a
15 | }
16 | externalNativeBuild {
17 | cmake {
18 | cppFlags "-std=c++11 -fexceptions"
19 | }
20 | }
21 | }
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 |
29 | externalNativeBuild {
30 | cmake {
31 | path "CMakeLists.txt"
32 | }
33 | }
34 | }
35 |
36 | dependencies {
37 | implementation fileTree(include: ['*.jar'], dir: 'libs')
38 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
39 | exclude group: 'com.android.support', module: 'support-annotations'
40 | })
41 | implementation 'com.android.support:appcompat-v7:28.0.0'
42 | androidTestImplementation 'junit:junit:4.12'
43 | implementation project(path: ':openCVLibrary320')
44 | }
45 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Java\adroidsdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/yanyu/com/mrcar/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package yanyu.com.mrcar;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/assets/mrcar/province_mapping.xml:
--------------------------------------------------------------------------------
1 | zh_cuan 川
2 | zh_gan1 甘
3 | zh_hei 黑
4 | zh_jin 津
5 | zh_liao 辽
6 | zh_min 闽
7 | zh_qiong 琼
8 | zh_sx 晋
9 | zh_xin 新
10 | zh_yue 粤
11 | zh_zhe 浙
12 | zh_e 鄂
13 | zh_gui 贵
14 | zh_hu 沪
15 | zh_jing 京
16 | zh_lu 鲁
17 | zh_ning 宁
18 | zh_shan 陕
19 | zh_wan 皖
20 | zh_yu 豫
21 | zh_yun 云
22 | zh_gan 赣
23 | zh_gui1 桂
24 | zh_ji 冀
25 | zh_jl 吉
26 | zh_meng 蒙
27 | zh_qing 青
28 | zh_su 苏
29 | zh_xiang 湘
30 | zh_yu1 渝
31 | zh_zang 藏
--------------------------------------------------------------------------------
/app/src/main/assets/mrcar/simhei.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imistyrain/EasyPR4Android/0ad380e2de45b15a09873337e72b3afac46a53a8/app/src/main/assets/mrcar/simhei.ttf
--------------------------------------------------------------------------------
/app/src/main/java/yanyu/com/mrcar/MRCar.java:
--------------------------------------------------------------------------------
1 | package yanyu.com.mrcar;
2 |
3 | /**
4 | * Created by yanyu on 2016/8/19.
5 | */
6 | public class MRCar {
7 | //初始化,modeldir为SD卡上模型路径
8 | public static native boolean init(String modeldir);
9 | //车牌检测
10 | public static native MRPlate[] plateRecognition(long matImg,long matResult);
11 | public static native MRPlate[] plateLive(long matImg);
12 | public static native MRPlate[] plateNV21(byte[]img, int height, int width);
13 | //释放库
14 | public static native int release();
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/yanyu/com/mrcar/MRPlate.java:
--------------------------------------------------------------------------------
1 | package yanyu.com.mrcar;
2 |
3 | import android.graphics.Rect;
4 |
5 | public class MRPlate {
6 | public String lic;
7 | public Rect rect;
8 | //public float score;
9 | public MRPlate(){}
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/CvText.h:
--------------------------------------------------------------------------------
1 | #ifndef CV_TEXT_H
2 | #define CV_TEXT_H
3 |
4 | #include
5 | #include
6 | #include FT_FREETYPE_H
7 |
8 | class CvText {
9 | public:
10 |
11 | /**
12 | * 构造函数,初始化一个字体
13 | * @param fontName 字体名称
14 | */
15 | explicit CvText(const char *fontName);
16 |
17 | virtual ~CvText();
18 |
19 | /**
20 | * 设置字体属性,属性为空时保持默认值
21 | * @param type 类型
22 | * @param size 大小
23 | * @param underline 下划线
24 | * @param diaphaneity 透明度
25 | */
26 | void setFont(int *type, cv::Scalar *size = nullptr,
27 | bool *underline = nullptr, float *diaphaneity = nullptr);
28 |
29 | /**
30 | * 恢复默认字体设置
31 | */
32 | void restoreFont();
33 |
34 | /**
35 | * 将text的内容放到frame的指定位置(pos),默认文本颜色为黑色。遇到不能输出的字符将停止。
36 | * @param frame 输出的影象
37 | * @param text 文本内容
38 | * @param pos 文本位置
39 | * @param color 文本颜色
40 | * @return 返回成功输出的字符长度,失败返回-1。
41 | */
42 | int putText(cv::Mat &frame, std::string text, cv::Point pos,
43 | cv::Scalar color = cv::Scalar(0, 0, 0));
44 |
45 | /**
46 | * 将text的内容放到frame的指定位置(pos),默认颜色为黑色。遇到不能输出的字符将停止。
47 | * @param frame 输出的影象
48 | * @param text 文本内容
49 | * @param pos 文本位置
50 | * @param color 文本颜色
51 | * @return 返回成功输出的字符长度,失败返回-1。
52 | */
53 | int putText(cv::Mat &frame, const char *text, cv::Point pos,
54 | cv::Scalar color = cv::Scalar(0, 0, 0));
55 |
56 | //私有函数区
57 | private:
58 | /**
59 | * 输出wc到frame的pos位置
60 | * @param frame 输出Mat
61 | * @param wc 字符
62 | * @param pos 位置
63 | * @param color 颜色
64 | */
65 | void putWChar(cv::Mat &frame, wchar_t wc, cv::Point &pos, cv::Scalar color);
66 |
67 | /**
68 | * 将char字符数组转换为wchar_t字符数组
69 | * @param src char字符数组
70 | * @param dst wchar_t字符数组
71 | * @param locale 语言环境,mbstowcs函数依赖此值来判断src的编码方式
72 | * @return 运行成功返回0,否则返回-1
73 | */
74 | int char2Wchar(const char *&src, wchar_t *&dst, const char *locale = "zh_CN.utf8");
75 |
76 | //私有变量区
77 | private:
78 | FT_Library m_library; // 字库
79 | FT_Face m_face; // 字体
80 |
81 | // 默认的字体输出参数
82 | int m_fontType;
83 | cv::Scalar m_fontSize;
84 | bool m_fontUnderline;
85 | float m_fontDiaphaneity;
86 | };
87 |
88 | #endif // CV_TEXT_H
89 |
90 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_EASYPR_H
2 | #define EASYPR_EASYPR_H
3 |
4 | #include "easypr/core/plate_recognize.h"
5 | #include "easypr/train/svm_train.h"
6 | #include "easypr/train/ann_train.h"
7 | #include "easypr/train/annCh_train.h"
8 | #include "easypr/util/util.h"
9 | #include "easypr/util/program_options.h"
10 | #include "easypr/api.hpp"
11 | #include "easypr/config.h"
12 |
13 | #endif //EASYPR_EASYPR_H
14 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/api.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file provides some of the most commonly used application interfaces.
3 | */
4 | #ifndef EASYPR_API_HPP
5 | #define EASYPR_API_HPP
6 |
7 | #include
8 | #include
9 | #include "opencv2/opencv.hpp"
10 | #include "easypr/config.h"
11 |
12 | namespace easypr {
13 |
14 | namespace api {
15 |
16 | static bool plate_judge(const char* image, const char* model) {
17 | cv::Mat src = cv::imread(image);
18 | assert(!src.empty());
19 |
20 | int result;
21 | result = PlateJudge::instance()->plateJudge(src);
22 |
23 | return result == 0;
24 | }
25 |
26 | static void plate_locate(const char* image, const bool life_mode = true) {
27 | cv::Mat src = cv::imread(image);
28 |
29 | assert(!src.empty());
30 |
31 | CPlateLocate plate;
32 | plate.setDebug(1);
33 | plate.setLifemode(life_mode);
34 |
35 | std::vector results;
36 | plate.plateLocate(src, results);
37 | }
38 |
39 | static std::vector plate_recognize(const char* image,
40 | const char* model_svm,
41 | const char* model_ann,
42 | const bool life_mode = true) {
43 | cv::Mat img = cv::imread(image);
44 | assert(!img.empty());
45 |
46 | CPlateRecognize pr;
47 | pr.setResultShow(false);
48 | pr.setLifemode(true);
49 | pr.setMaxPlates(1);
50 | pr.setDetectType(PR_DETECT_CMSER | PR_DETECT_COLOR);
51 |
52 | std::vector results;
53 | std::vector plates;
54 | pr.plateRecognize(img, plates, 0);
55 |
56 | for (auto plate : plates) {
57 | results.push_back(plate.getPlateStr());
58 |
59 | }
60 |
61 | if (plates.size() == 1) {
62 | if (1) {
63 | std::stringstream ss(std::stringstream::in | std::stringstream::out);
64 | ss << "result.jpg";
65 | imwrite(ss.str(), plates.at(0).getPlateMat());
66 | }
67 | }
68 |
69 | return std::move(results);
70 | }
71 |
72 | static Color get_plate_color(const char* image) {
73 | cv::Mat img = cv::imread(image);
74 |
75 | assert(!img.empty());
76 |
77 | return getPlateType(img, true);
78 | }
79 | }
80 | }
81 |
82 | #endif // EASYPR_API_HPP
83 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/core/chars_identify.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_CORE_CHARSIDENTIFY_H_
2 | #define EASYPR_CORE_CHARSIDENTIFY_H_
3 |
4 | #include
5 | #include "opencv2/opencv.hpp"
6 |
7 | #include "easypr/util/kv.h"
8 | #include "easypr/core/character.hpp"
9 | #include "easypr/core/feature.h"
10 |
11 | namespace easypr {
12 |
13 | class CharsIdentify {
14 | public:
15 | static CharsIdentify* instance();
16 |
17 | int classify(cv::Mat f, float& maxVal, bool isChinses = false, bool isAlphabet = false);
18 | void classify(cv::Mat featureRows, std::vector& out_maxIndexs,
19 | std::vector& out_maxVals, std::vector isChineseVec);
20 | void classify(std::vector& charVec);
21 |
22 | void classifyChinese(std::vector& charVec);
23 | void classifyChineseGray(std::vector& charVec);
24 |
25 | std::pair identify(cv::Mat input, bool isChinese = false, bool isAlphabet = false);
26 | int identify(std::vector inputs, std::vector>& outputs,
27 | std::vector isChineseVec);
28 |
29 | std::pair identifyChinese(cv::Mat input, float& result, bool& isChinese);
30 | std::pair identifyChineseGray(cv::Mat input, float& result, bool& isChinese);
31 |
32 | bool isCharacter(cv::Mat input, std::string& label, float& maxVal, bool isChinese = false);
33 |
34 | void LoadModel(std::string path);
35 | void LoadChineseModel(std::string path);
36 | void LoadGrayChANN(std::string path);
37 | void LoadChineseMapping(std::string path);
38 |
39 | private:
40 | CharsIdentify();
41 | annCallback extractFeature;
42 | static CharsIdentify* instance_;
43 |
44 | // binary character classifer
45 | cv::Ptr ann_;
46 |
47 | // binary character classifer, only for chinese
48 | cv::Ptr annChinese_;
49 |
50 | // gray classifer, only for chinese
51 | cv::Ptr annGray_;
52 |
53 | // used for chinese mapping
54 | std::shared_ptr kv_;
55 | };
56 | }
57 |
58 | #endif // EASYPR_CORE_CHARSIDENTIFY_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/core/feature.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_CORE_FEATURE_H_
2 | #define EASYPR_CORE_FEATURE_H_
3 |
4 | #include "opencv2/opencv.hpp"
5 |
6 | using namespace cv;
7 |
8 | namespace easypr {
9 |
10 | //! 获得车牌的特征数
11 | cv::Mat getHistogram(cv::Mat in);
12 |
13 | //! EasyPR的getFeatures回调函数
14 | //! 用于从车牌的image生成svm的训练特征features
15 | typedef void (*svmCallback)(const cv::Mat& image, cv::Mat& features);
16 |
17 | //! EasyPR的getFeatures回调函数
18 | //! convert from images to features used by gray char ann
19 | typedef void (*annCallback)(const cv::Mat& image, cv::Mat& features);
20 |
21 | //! gray and project feature
22 | void getGrayPlusProject(const cv::Mat& grayChar, cv::Mat& features);
23 |
24 | //! EasyPR的getFeatures回调函数
25 | //! 本函数是获取垂直和水平的直方图图值
26 | void getHistogramFeatures(const cv::Mat& image, cv::Mat& features);
27 |
28 | //! 本函数是获取SIFT特征子
29 | void getSIFTFeatures(const cv::Mat& image, cv::Mat& features);
30 |
31 | //! 本函数是获取HOG特征子
32 | void getHOGFeatures(const cv::Mat& image, cv::Mat& features);
33 |
34 | //! 本函数是获取HSV空间量化的直方图特征子
35 | void getHSVHistFeatures(const cv::Mat& image, cv::Mat& features);
36 |
37 | //! LBP feature
38 | void getLBPFeatures(const cv::Mat& image, cv::Mat& features);
39 |
40 | //! color feature
41 | void getColorFeatures(const cv::Mat& src, cv::Mat& features);
42 |
43 | //! color feature and histom
44 | void getHistomPlusColoFeatures(const cv::Mat& image, cv::Mat& features);
45 |
46 | //! get character feature
47 | cv::Mat charFeatures(cv::Mat in, int sizeData);
48 | cv::Mat charFeatures2(cv::Mat in, int sizeData);
49 |
50 | //! LBP feature + Histom feature
51 | void getLBPplusHistFeatures(const cv::Mat& image, cv::Mat& features);
52 |
53 | //! grayChar feauter
54 | void getGrayCharFeatures(const cv::Mat& grayChar, cv::Mat& features);
55 |
56 | void getGrayPlusLBP(const Mat& grayChar, Mat& features);
57 | } /*! \namespace easypr*/
58 |
59 | #endif // EASYPR_CORE_FEATURE_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/core/plate_judge.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_CORE_PLATEJUDGE_H_
2 | #define EASYPR_CORE_PLATEJUDGE_H_
3 |
4 | #include "easypr/core/plate.hpp"
5 | #include "easypr/core/feature.h"
6 |
7 | namespace easypr {
8 |
9 | class PlateJudge {
10 | public:
11 | static PlateJudge* instance();
12 | void LoadModel(std::string path);
13 |
14 | int plateJudgeUsingNMS(const std::vector&, std::vector&, int maxPlates = 5);
15 | int plateSetScore(CPlate& plate);
16 |
17 | int plateJudge(const Mat& plateMat);
18 | int plateJudge(const std::vector &inVec,
19 | std::vector &resultVec);
20 | int plateJudge(const std::vector &inVec,
21 | std::vector &resultVec);
22 |
23 | private:
24 | // singleton
25 | PlateJudge();
26 |
27 | static PlateJudge* instance_;
28 |
29 | svmCallback extractFeature;
30 |
31 | cv::Ptr svm_;
32 |
33 | };
34 | }
35 |
36 | #endif // EASYPR_CORE_PLATEJUDGE_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/core/plate_recognize.h:
--------------------------------------------------------------------------------
1 | //////////////////////////////////////////////////////////////////////////
2 | // Name: plate_recognize Header
3 | // Version: 1.0
4 | // Date: 2014-09-28
5 | // Author: liuruoze
6 | // Copyright: liuruoze
7 | // Reference: Mastering OpenCV with Practical Computer Vision Projects
8 | // Reference: CSDN Bloger taotao1233
9 | // Desciption:
10 | // Defines CPlateRecognize
11 | //////////////////////////////////////////////////////////////////////////
12 | #ifndef EASYPR_CORE_PLATERECOGNIZE_H_
13 | #define EASYPR_CORE_PLATERECOGNIZE_H_
14 |
15 | #include "easypr/core/plate_detect.h"
16 | #include "easypr/core/chars_recognise.h"
17 |
18 | /*! \namespace easypr
19 | Namespace where all the C++ EasyPR functionality resides
20 | */
21 | namespace easypr {
22 |
23 | class CPlateRecognize : public CPlateDetect, public CCharsRecognise {
24 | public:
25 | CPlateRecognize();
26 |
27 | int plateRecognize(const Mat& src, std::vector &plateVec, int img_index = 0);
28 | int plateRecognize(const Mat& src, std::vector &licenseVec);
29 |
30 | inline void setLifemode(bool param) { CPlateDetect::setPDLifemode(param); }
31 | inline void setDetectType(int param) { CPlateDetect::setDetectType(param); }
32 |
33 | inline void setResultShow(bool param) { m_showResult = param; }
34 | inline bool getResultShow() const { return m_showResult; }
35 | inline void setDetectShow(bool param) { CPlateDetect::setDetectShow(param); }
36 | inline void setDebug(bool param) { setResultShow(param); }
37 |
38 | void LoadSVM(std::string path);
39 | void LoadANN(std::string path);
40 | void LoadChineseANN(std::string path);
41 |
42 | //v1.6 added
43 | void LoadGrayChANN(std::string path);
44 | void LoadChineseMapping(std::string path);
45 |
46 | private:
47 | // show the detect and recognition result image
48 | bool m_showResult;
49 | DISABLE_ASSIGN_AND_COPY(CPlateRecognize);
50 | };
51 |
52 | } /* \namespace easypr */
53 |
54 | #endif // EASYPR_CORE_PLATERECOGNIZE_H_
55 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/train/annCh_train.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_TRAIN_ANNCHTRAIN_H_
2 | #define EASYPR_TRAIN_ANNCHTRAIN_H_
3 |
4 | #include "easypr/train/train.h"
5 | #include "easypr/util/kv.h"
6 | #include "easypr/core/feature.h"
7 | #include
8 |
9 | namespace easypr {
10 |
11 | class AnnChTrain : public ITrain {
12 | public:
13 | explicit AnnChTrain(const char* chars_folder, const char* xml);
14 |
15 | virtual void train();
16 |
17 | virtual void test();
18 |
19 | std::pair identifyGrayChinese(cv::Mat input);
20 |
21 | inline void setNumberForCount(int n) {
22 | m_number_for_count = n;
23 | }
24 |
25 | private:
26 | virtual cv::Ptr tdata();
27 |
28 | void trainVal(size_t number_for_count = 100);
29 |
30 | cv::Ptr ann_;
31 | const char* ann_xml_;
32 | const char* chars_folder_;
33 |
34 | std::shared_ptr kv_;
35 | int type;
36 |
37 | int m_number_for_count;
38 |
39 | annCallback extractFeature;
40 | };
41 | }
42 |
43 | #endif // EASYPR_TRAIN_ANNCHTRAIN_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/train/ann_train.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_TRAIN_ANNTRAIN_H_
2 | #define EASYPR_TRAIN_ANNTRAIN_H_
3 |
4 | #include "easypr/train/train.h"
5 | #include "easypr/util/kv.h"
6 | #include
7 |
8 | namespace easypr {
9 |
10 | class AnnTrain : public ITrain {
11 | public:
12 | explicit AnnTrain(const char* chars_folder, const char* xml);
13 |
14 | virtual void train();
15 |
16 | virtual void test();
17 |
18 | std::pair identifyChinese(cv::Mat input);
19 | std::pair identify(cv::Mat input);
20 |
21 | private:
22 | virtual cv::Ptr tdata();
23 |
24 | cv::Ptr sdata(size_t number_for_count = 100);
25 |
26 | cv::Ptr ann_;
27 | const char* ann_xml_;
28 | const char* chars_folder_;
29 |
30 | std::shared_ptr kv_;
31 | int type;
32 | };
33 | }
34 |
35 | #endif // EASYPR_TRAIN_ANNTRAIN_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/train/create_data.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_CREATE_DATA_H_
2 | #define EASYPR_CREATE_DATA_H_
3 |
4 | #include "opencv2/opencv.hpp"
5 | #include "easypr/config.h"
6 |
7 | using namespace cv;
8 | using namespace std;
9 |
10 | /*! \namespace easypr
11 | Namespace where all the C++ EasyPR functionality resides
12 | */
13 | namespace easypr {
14 |
15 | // shift an image
16 | Mat translateImg(Mat img, int offsetx, int offsety, int bk = 0);
17 | // rotate an image
18 | Mat rotateImg(Mat source, float angle, int bk = 0);
19 |
20 | // crop the image
21 | Mat cropImg(Mat src, int x, int y, int shift, int bk = 0);
22 |
23 | Mat generateSyntheticImage(const Mat& image, int use_swap = 1);
24 |
25 | } /*! \namespace easypr*/
26 |
27 | #endif // EASYPR_CREATE_DATA_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/train/svm_train.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_TRAIN_SVMTRAIN_H_
2 | #define EASYPR_TRAIN_SVMTRAIN_H_
3 |
4 | #include "easypr/train/train.h"
5 | #include
6 | #include "easypr/config.h"
7 | #include "easypr/core/feature.h"
8 |
9 | namespace easypr {
10 |
11 | //int svmTrain(bool dividePrepared, bool trainPrepared);
12 |
13 | class SvmTrain : public ITrain {
14 | public:
15 | typedef struct {
16 | std::string file;
17 | SvmLabel label;
18 | } TrainItem;
19 |
20 | SvmTrain(const char* plates_folder, const char* xml);
21 |
22 | virtual void train();
23 |
24 | virtual void test();
25 |
26 | private:
27 | void prepare();
28 |
29 | virtual cv::Ptr tdata();
30 |
31 | cv::Ptr svm_;
32 | const char* plates_folder_;
33 | const char* svm_xml_;
34 | std::vector train_file_list_;
35 | std::vector test_file_list_;
36 |
37 | svmCallback extractFeature;
38 | bool isPrepared = true;
39 | };
40 | }
41 |
42 | #endif // EASYPR_TRAIN_SVMTRAIN_H_
43 |
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/train/train.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_TRAIN_TRAIN_H_
2 | #define EASYPR_TRAIN_TRAIN_H_
3 |
4 | #include
5 |
6 | namespace easypr {
7 |
8 | class ITrain {
9 | public:
10 | ITrain();
11 |
12 | virtual ~ITrain();
13 |
14 | virtual void train() = 0;
15 |
16 | virtual void test() = 0;
17 |
18 | private:
19 | virtual cv::Ptr tdata() = 0;
20 | };
21 | }
22 |
23 | #endif // EASYPR_TRAIN_TRAIN_H_
--------------------------------------------------------------------------------
/app/src/main/jni/include/easypr/util/kv.h:
--------------------------------------------------------------------------------
1 | #ifndef EASYPR_UTIL_KV_H_
2 | #define EASYPR_UTIL_KV_H_
3 |
4 | #include