Giter Club home page Giter Club logo

m5camera_openmv-'s Introduction

M5Camera_OpenMV

このリポジトリは、M5Camera+OpenMVのMicroPython環境です。 以下リポジトリのソースコードをベースとして環境を構築しています。

This repository is a MicroPython for M5Camera and OpenMV. It is built based on the source code of the repository below.

How to use

firmwareフォルダにビルド済みのbinファイルをおいています。以下コマンドで書き込んでください

I have a pre-built bin file in the firmware folder. Please write with the following command.

pip install esptool
esptool.py --port /dev/ttyUSB0 write_flash 0x8000 firmware/partition-table.bin 0x1000 firmware/bootloader.bin 0x10000 firmware/micropython.bin

How to build

micropython、OpenMVのビルドを実行するには、ESP-IDFのインストールが必要です。 以下手順でインストールしてください。

ESP-IDF must be installed to execute the build of micropython and OpenMV. Follow the steps below to install.

$ git clone -b v4.2 --recursive https://github.com/espressif/esp-idf.git
$ cd esp-idf
$ ./install.sh
$ source export.sh
$ cd components
$ git clone https://github.com/espressif/esp32-camera.git

ESP-IDF のインストール後、本リポジトリをクローンしてください

Clone this repository after installing ESP-IDF

git clone --recursive https://github.com/tenpa1105/M5Camera_OpenMV.git

クローン後、srcディレクトリに移動し、以下コマンドを入力してください ビルドが実行されます

Move to src directory and enter the following command

cd src
make BOARD=GENERIC_CAM 

How to flash

M5Camera にファームウェアを書き込む場合は以下コマンドを入力して下さい

Enter the following command to flash.

make BOARD=GENERIC_CAM deploy

Sample script

グレイスケールで取得したQVGAサイズの画像を2値化、JPEGにエンコードし、UARTで送信するサンプルスクリプト

A sample script that binarizes a grayscle image, encodes it to JPEG, and sends it via UART.

import image,camera,time
from machine import UART
import machine

camera.init(0, format=2)
pin = machine.Pin(14, machine.Pin.OUT)
pin.off()

uart = UART(1, 921600, tx=13, rx=4)
threshold =  [200, 255]
while True:
    img = camera.capture()
    img.binary([threshold])
    img.compress(50)
    size = img.size()

    img_size1 = (size& 0xFF0000)>>16
    img_size2 = (size& 0x00FF00)>>8
    img_size3 = (size& 0x0000FF)>>0
    data_packet = bytearray([0xFF,0xD8,0xEA,0x01,img_size1,img_size2,img_size3,0x00,0x00,0x00])

    uart.write(data_packet)
    uart.write(img.to_bytes())
    print(time.ticks_ms())

sample

m5camera_openmv-'s People

Contributors

tenpa1105 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.