Skip to main content

my_mu3

A small project to grab and parse images from the MU3 Vision Sensor in a seperate process (to free up CPU).

Installation

pip install my-mu3

API Usage

Note the below relies on the camera being connected to the same WLAN (WIFI) network as the computer. Also note that it also relies on the ip address being known. See the section Connecting WLAN for help. It also relies on the camera being configured into image transmission mode, where both switches on the camera are in the up position. In this mode, the camera will show it is connected to a wifi network (and not broadcasting one) if both front lights are off. however, by default in this mode the camera will broadcast a network, this could be used though I haven't tested it.

One point to note is that the below relies on cv2.waitKey(1) to exit, so if you are running headless it won't exit cleanly. Sorry.

import time

import cv2

from my_mu3.mu3_image_grabber import Mu3ImageGrabber

IP_ADDRESS = "192.168.1.183"

def main():

    my_mu3 = Mu3ImageGrabber(ip_address=IP_ADDRESS)

    exit_flag = False
    my_mu3.start()

    while not exit_flag:

        image = my_mu3.get_image()
        if image is not None:
            cv2.imshow('mu3 camera', image)

        if cv2.waitKey(1) == ord("q"):
            exit_flag = True
        time.sleep(0.01)

    my_mu3.stop()

if __name__ == "__main__":
    main()

Connecting WLAN

The library relies on being connected to the same WLAN as the camera. To do so, AT commands can be sent to the camera via UDP or via Serial. A convenience script is included in this repository that sends AT commands to connect the camera to a WLAN network, that relies on having a serial port connected. One example of a repo that provides a "soft" serial port for the raspberry pi, ie you can use non-serial pins at a much lower speed, is here. I used this with 9600 baud rate, the default for the camera.

setup-wlan MY_WIFI_NAME MY_PASSWORD /dev/ttyS0

Using AT Commands/Chatting with the Camera

You can also use AT commands yourself. The camera will print AT commands if you send the below via serial. Note the space after the command, this is vital (or a combo of carriage return and new line).

AT+HELP 

The output of this AT_HELP is included in this repo as the 'output_at_help.txt' file. Additionally, a program to chat via serial with the camera is included where it will let you type and send input in examples/serial_chat.py.

Metadata

Release files for my-mu3 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for my-mu3 0.0.3
File Size Uploaded
my-mu3-0.0.3.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for my-mu3 0.0.3
File Interpreter ABI Platform
my_mu3-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / my-mu3-0.0.3.tar.gz

Download URL my-mu3-0.0.3.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb17bde736583d0a10207f11abd7ac986b71965809daaec2d56e5c04b900c279
BLAKE2b-256 checksum
How to use checksums
065e39c2cd37f241bd4013b5947e0e22f17e224b6e2d2520216795fcf29e37cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / my_mu3-0.0.3-py3-none-any.whl

Download URL my_mu3-0.0.3-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76ca6b70b4170debf41c450f5c16811bf48570484cd0d6371e4937f99b8d9686
BLAKE2b-256 checksum
How to use checksums
cdaf263ff5cf021fc20cc7747745f3cd43520c453f75e1bfd60b504c49c7857d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page