# 64-条码识别 **Repository Path**: openeuler2020/team-1862962163 ## Basic Information - **Project Name**: 64-条码识别 - **Description**: TOPIC_ID:64, TEAM_ID:1862962163, TEAM_NAME:条码识别. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-12-31 - **Last Updated**: 2023-03-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 64-条码识别 #### 介绍 TOPIC_ID:64, TEAM_ID:1862962163, TEAM_NAME:条码识别. 本项目代码贡献于[opencv_contrib](https://github.com/opencv/opencv_contrib/pull/2757)仓库,代码已被**merged**!![merge](./assets/merged_screenshot.png) ##### 决赛PPT传送门: [PDF](./assets/final_ppt.pdf) ##### 决赛demo传送门: demo是利用添加了我们实现的条码识别算法后编译生成的**OpenCV Android SDK**开发的安卓应用[APK](./assets/barcode-demo.apk),烦请评委们提前下载体验哦。 (目前由于分辨率的问题,检测框的矫正只支持了**横向分辨率为1080**的手机,如果是其他分辨率,检测框的显示可能会偏移,但不影响识别结果。) #### 算法细节 [中文版](./algorithm_detail.md) #### 测试结果 [测试结果](./test_results.md) #### 软件架构 ``` │ CMakeLists.txt │ README.md │ ├─doc │ barcode.bib │ ├─include │ └─opencv2 │ barcode.hpp │ ├─misc │ ├─java │ │ │ filelist_common │ │ │ gen_dict.json │ │ │ │ │ ├─src │ │ │ └─cpp │ │ │ barcode_converters.cpp │ │ │ barcode_converters.hpp │ │ │ │ │ └─test │ │ BarcodeDetectorTest.java │ │ │ └─python │ │ pyopencv_barcode.hpp │ │ │ └─test │ test_barcode_detector.py │ ├─samples │ barcode.cpp │ ├─src │ │ barcode.cpp │ │ precomp.hpp │ │ │ ├─decoder │ │ │ abs_decoder.cpp │ │ │ abs_decoder.hpp │ │ │ bardecode.cpp │ │ │ bardecode.hpp │ │ │ ean13_decoder.cpp │ │ │ ean13_decoder.hpp │ │ │ ean8_decoder.cpp │ │ │ ean8_decoder.hpp │ │ │ upcean_decoder.cpp │ │ │ upcean_decoder.hpp │ │ │ │ │ └─common │ │ hybrid_binarizer.cpp │ │ hybrid_binarizer.hpp │ │ super_scale.cpp │ │ super_scale.hpp │ │ utils.cpp │ │ utils.hpp │ │ │ └─detector │ bardetect.cpp │ bardetect.hpp │ ├─test │ test_barcode.cpp │ test_main.cpp │ test_precomp.hpp │ utils.hpp │ └─tutorials │ table_of_content_barcode.markdown │ └─barcode_detect_and_decode │ barcode_detect_and_decode.markdown │ └─images 4_barcodes.jpg result.jpg ``` 本项目结构参照opencv module结构: - 对外接口:`./include/opencv2/barcode.hpp` - python/java接口生成器:`./misc/*` - 样例代码:`./samples/barcode.cpp` - 功能代码:./src/ - 解码器:./src/decoder/ - 检测器:./src/detector/ - 测试代码:./test/ - 使用说明:./tutorials/ #### 安装教程 1. `$ git clone https://github.com/opencv/opencv.git` 2. `$ git clone https://github.com/opencv/opencv_contrib.git` 3. `$ git clone https://gitee.com/openeuler2020/team-1862962163.git` 4. `$ cp ./team-1862962163/barcode ./opencv_contrib/modules/ -r` 5. ``` $ cd $ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules -DBUILD_EXAMPLES=True $ make -j5 ``` 此处可参照opencv编译选项 #### 使用说明 ##### 运行sample 1. 找到编译生成的`./samples/barcode.cpp`的二进制文件 2. ``` $ ./barcode -h This program detects the 1D barcodes from camera or images using the OpenCV library. Usage: example_barcode_barcode.exe [params] -?, -h, --help (value:true) print help messages --detect (value:false) detect 1D barcode only (skip decoding) -i, --in input image path (also switches to image detection mode) -o, --out (value:bar_code.png) path to result file --sr_model super resolution model path --sr_prototxt super resolution prototxt path ``` ##### 调用API [教程](./barcode/tutorials/barcode_detect_and_decode/barcode_detect_and_decode.markdown) #### 参与贡献 1. Fork [GitHub仓库](https://github.com/Certseeds/opencv_contrib.git) 2. 切换到Barcode-Support分支 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request