LoginSignup
10
6

More than 5 years have passed since last update.

M5Cameraからの画像をRasberryPIで受信する

Last updated at Posted at 2018-11-25

目的

M5CameraからRasberryPIでカメラ画像を受信する。

準備

RasberryPIとM5Cameraとを、Wifiで接続する。
M5CameraのIPアドレス直下のjpgに、カメラの画像ファイルが生成されている。
今回は、pythonでM5Cameraの画像を取得して保存する。

実装例

import io
import numpy as np
import requests
import cv2
import time

from matplotlib import pyplot as plt
time.sleep(2)
res = requests.get('http://192.168.4.1/jpg')//M5Camera IP Adress
bin_data = io.BytesIO(res.content)
file_bytes = np.asarray(bytearray(bin_data.read()), dtype=np.uint8)
img = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
cv2.imwrite("m5camera.jpg",img)
10
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
6