{"id":18402238,"url":"https://github.com/iotsharp/vlpr","last_synced_at":"2025-04-14T12:12:19.466Z","repository":{"id":191289480,"uuid":"684425069","full_name":"IoTSharp/VLPR","owner":"IoTSharp","description":"车牌识别统一接口库","archived":false,"fork":false,"pushed_at":"2024-08-05T08:41:51.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T12:12:13.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IoTSharp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T05:16:05.000Z","updated_at":"2024-08-28T10:26:51.000Z","dependencies_parsed_at":"2024-08-01T08:54:16.365Z","dependency_job_id":null,"html_url":"https://github.com/IoTSharp/VLPR","commit_stats":null,"previous_names":["iotsharp/vlpr"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FVLPR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FVLPR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FVLPR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FVLPR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IoTSharp","download_url":"https://codeload.github.com/IoTSharp/VLPR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877959,"owners_count":21176244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T02:41:57.543Z","updated_at":"2025-04-14T12:12:19.442Z","avatar_url":"https://github.com/IoTSharp.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IoTSharp.VLPR\n这是一个用于.Net 的车牌识别对接框架库， 如果你要在项目里面对接车牌识别， 可以按项目提供的标准提供给厂家， 让厂家按照接口对接， 然后你只需要拷贝对应动态库到程序目录加载即可使用。 在我们内部， 已经有数家厂家进行了对接。\n\n\n\n##  使用\n\n`dotnet add package IoTSharp.VLPR  `\n\n\n\n## 配置\n\n再appsettings.json中加入下面内容：\n\n```json\n \"VLPROptions\": {\n    \"Interval\": 300,\n    \"EasyVLPR\": false,\n    \"VLPRConfigs\": [\n      {\n        \"Name\": \"1\",\n        \"Provider\": \"libvpr_xlw.so.1.0.0.3\",\n        \"Port\": 5001,\n        \"IPAddress\": \"10.13.97.91\",\n        \"Password\": \"admin\",\n        \"UserName\": \"admin\"\n      }\n    ]\n  },\n```\n\n## 示例:\n\n```\nnamespace Console1\n{\n    public class Startup\n    {\n        public Startup(IConfiguration configuration)\n        {\n            Configuration = configuration;\n        }\n\n        public IConfiguration Configuration { get; }\n\n        // This method gets called by the runtime. Use this method to add services to the container.\n        public void ConfigureServices(IServiceCollection services)\n        {\n            System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);\n      \n            services.AddVPRService();\n          \n            services.AddHealthChecks()\n                    .AddVLPR(\"VLPR\");\n\n        }\n\n        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n\n        }\n    }\n}\n```\n\n\n\n## 接口对接\n\n### 1.1  车牌识别库要求\n\n\u003e\t\t交付内容， 提供的车牌识别库 命名格式为libVpr_\u003c厂家缩写和型号缩写\u003e.so 有完全测试通过的demo 的代码，包括Makefile 文件。   \n\n### 1.2  Linux共享库（SO）接口定义 ##\n\n#### 1.2.1车牌识别接口识别车牌的基本原理    ###   \n\n#### 1.2.2接口函数说明  ###             \t\t\t\t\t                    \n\n ** VPR_InitEx   ** \n\n- \tlong VPR_InitEx(char* capIpAddress,char* username, char* password ,int uPort)`\n\n\u003e \t\t函数说明           \t\t\t\t\t\t\t\t\t\t\t\t\t \n\u003e \t\t用于初始化系统中的车牌照识别器。  \n\u003e \t\t参数\t\t\t 说明      \t\t                                    \n\u003e \t\tuPort         用户自定义端口，当接口库接收到车牌照识别器的识别结果时，向这个端口发送数据包。  \n\u003e \t\tusername     用户名   \n\u003e \t\tpassword      密码   \n\u003e \t\tcapIpAddress  车牌识别IP地址   \n\u003e \t\t返回值\t\t\t说明       \t\t\t\t\t\t\t\t\t\t\t\t      \n\u003e \t\t\u003c=0       \t  错误，0、网络错误 -1， 登录失败、-2、其他错误\n\u003e \t\t\u003e0          句柄\n\n- `BOOL VPR_Quit(long Handle)`\n\n\u003e \t\t函数说明             \t\t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\t用于关闭系统中的车牌照识别器。\n\u003e \t\t参数\t\t\t说明    \t\t\t\t\t\t\t\t\t\t\t\t      \n\u003e \t\t无\n\u003e \t\t返回值\t\t\t说明    \t\t\t\t\t\t\t\t\t\t\t\t      \n\u003e \t\tTRUE    \t  关闭牌照识别器成功\n\u003e \t\tFALSE\t\t  关闭牌照识别器失败   \n\n\n\n- `int VPR_GetVehicleInfoEx (long Handle, char *pchPlate, unsigned char *iPlateColor,int *piByteBinImagLen,BYTE *pByteBinImage,int *piJpegImageLen,unsigned char* pByteJpegImage, int* laneId, int* index);`   \n\n\u003e \t\t函数说明：           \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\t获取车牌号、车牌二值图、车辆JPEG图像。\n\u003e \t\t接口与调用说明: DLL_VPR_SetEventCallBackFunc \n\n\n\u003e | 参数             | 说明                                             |\n\u003e | ---------------- | ------------------------------------------------ |\n\u003e | pchPlate         | 返回牌照号                                       |\n\u003e | iPlateColor      | 车牌颜色                                         |\n\u003e | piByteBinImagLen | 返回车辆二值图的大小                             |\n\u003e | pByteBinImage    | 返回车牌二值图                                   |\n\u003e | piJpegImageLen   | 返回车辆JPEG图像的大小                           |\n\u003e | pByteJpegImage   | 返回车辆的图片, 为JPEG格式                       |\n\u003e | laneId           | 输出参数,车道号,对应VPR_CaptureEx中传入的车道号, |\n\u003e | index            | 输出参数,抓拍ID,对应VPR_CaptureEx中传入的抓拍ID  |\n\u003e | 返回值           | 说明                                             |\n\u003e | ---              | ---                                              |\n\u003e | TRUE             | 返回车辆的图片, 为JPEG格式                       |\n\u003e | FALSE            | 获取信息失败                                     |\n\n\u003e | iPlateColor 值 | 对应颜色 |\n\u003e | -------------- | -------- |\n\u003e | 0              | 蓝       |\n\u003e | 1              | 黄       |\n\u003e | 2              | 黑       |\n\u003e | 3              | 白       |\n\u003e | 4              | 渐绿     |\n\u003e | 5              | 黄绿     |\n\u003e | 6              | 蓝白     |\n\u003e\n\u003e ##### VPR_GetVehicleInfoEx接口必读注意事项:  \n\u003e\n\u003e 1. 函数返回时，若没有识别结果，pchPlate将返回“无车牌”，iPlateColor 返回0，pchPlate至少申请30字节的空间。\n\u003e 2. pByteBinImage  最大为280字节的空间。\n\u003e 3. pByteJpegImage 最大为 1024  * 1024 * 2 字节的空间。\n\u003e 4. pchPlate   最大长度为 64字节。\n\u003e 5. 中文编码采用GB2312编码。\n\n\n- `int VPR_CaptureEx (long Handle,  int laneId, int index )`  \n\n\u003e 函数说明：当上位机调用该接口时，该接口作为指令触发方式，告知接口需要取一次车牌信息，车牌识别仪收到后进行抓拍。  \n\u003e \t参数\t\t\t说明    \t\t\t\t\t\t\t\t\t\t\t\t      \n\u003e \tHandle  \t\t相机句柄，由VPR_Init 或 VPR_InitEx 接口返回\n\u003e \tlaneId\t\t\t车道号，需与相机中配置的相对应\n\u003e \tindex\t\t\t抓拍ID，用于区分不同的抓拍结果\n\u003e \t返回值\t\t\t说明      \t\t\t\t\t\t\t\t\t\t\t\t      \n\u003e \tTRUE       \t  发送抓拍命令成功\n\u003e \tFALSE         发送抓拍命令失败\n\n-`    int VPR_CheckStatus(long Handle, char * chVprDevStatus)`  \n\n\u003e \t\t```c\n\u003e \t\t函数说明           \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\t检查牌照识别器状态。  \n\u003e \t\t参数\t\t\t     说明      \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\tchVprDevStatus\t   牌照识别器状态说明，返回值  最长 512字节，中文编码采用GB2312编码\n\u003e \t\t返回值\t\t\t     说明      \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\tTRUE               牌照识别器状态正常  \n\u003e \t\tFALSE              牌照识别器状态不正常  \n\u003e \t\t```\n\n-`    int VPR_SetEventCallBackFunc(long Handle, VPR_EventHandleEx cb)`  \n\n\u003e \t\t```c\n\u003e \t\t函数说明           \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\t设置次回调后， 如果收到车牌识别， 则调用 VPR_EventHandleEx  cb      \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\ttypedef void   (*VPR_EventHandleEx)(long Handle,  int laneId, int index);      \t\t\t\t\t\t\t\t\t\t\t\t\n\u003e \t\t```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotsharp%2Fvlpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotsharp%2Fvlpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotsharp%2Fvlpr/lists"}