# OpenMV-NumberRecognition **Repository Path**: urmsm/openmv-number-recognition ## Basic Information - **Project Name**: OpenMV-NumberRecognition - **Description**: 基于 OpenMV 的数字识别程序 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-28 - **Last Updated**: 2025-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenMV 数字识别 本项目使用 [OpenMV](https://openmv.io/) 开发板结合 TensorFlow Lite 实现数字识别与数字颜色功能 ## 功能概述 - **模型训练**: 使用 Keras 在 MNIST 数据集上训练了一个 CNN 分类模型。 - **模型转换**: 将训练好的 Keras 模型转换为 TensorFlow Lite 格式,并量化以适应 OpenMV 的运行需求。 - **OpenMV 推理**: 部署模型到 OpenMV 设备,实现摄像头实时数字识别和串口输出结果。 ## 使用方法 ### 1. 模型训练与转换 请使用 `mnist_model/openmv_mnist.ipynb` 文件训练并导出 `trained.tflite` 模型文件。 ### 2. 部署到 OpenMV 1. 将 `trained.tflite` 拷贝到 OpenMV Cam 的存储根目录。 2. 将 `main.py` 上传至 OpenMV 设备。 3. 使用 OpenMV IDE 运行代码,并通过串口查看识别结果。 ## 主要代码模块说明 - **num_color**: 用于判断数字的颜色。 - **num_calc_center**: 计算图像中数字的中心坐标。 - **num_classify**: 调用 `trained.tflite` 模型进行数字分类。 - **loop**: 主循环处理图像捕获、预处理、识别及结果发送。 ## 参考资料 - [OpenMV Tensorflow训练脚本仓库](https://github.com/SingTown/openmv_tensorflow_training_scripts) - [TensorFlow Lite 转换官方文档](https://www.tensorflow.org/lite/guide/get_started) - [OpenMV 官方论坛](https://forums.openmv.io/) ## 许可证 The MIT License (MIT) Copyright © 2025 MrSuM Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.