Skip to content

Commit e502357

Browse files
committed
Remove non-OpenCV features
Refactor for #42 Also move submodules out of src directory
1 parent afdf23b commit e502357

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+134
-4666
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitmodules

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
[submodule "src/opencv/opencv"]
2-
path = src/opencv/opencv
1+
[submodule "opencv"]
2+
path = opencv
33
url = https://github.com/opencv/opencv.git
4-
[submodule "src/ulab"]
5-
path = src/ulab
4+
[submodule "ulab"]
5+
path = ulab
66
url = https://github.com/v923z/micropython-ulab.git
7-
[submodule "micropython"]
8-
path = micropython
9-
url = https://github.com/sparkfun/micropython.git

Makefile

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
1-
# Set Pico SDK flags to create our own malloc wrapper and enable exceptions
2-
CMAKE_ARGS += -DSKIP_PICO_MALLOC=1 -DPICO_CXX_ENABLE_EXCEPTIONS=1
1+
ifndef PLATFORM
2+
$(error PLATFORM not specified. Use 'make PLATFORM=rp2350' or similar.)
3+
endif
34

4-
# Get current directory
5-
CURRENT_DIR = $(shell pwd)
5+
TOOLCHAIN_FILE = platforms/${PLATFORM}.toolchain.cmake
66

7-
# Set the MicroPython user C module path to the OpenCV module
8-
MAKE_ARGS = USER_C_MODULES="$(CURRENT_DIR)/src/opencv_upy.cmake"
7+
# TODO: For some reason, specifying this in the toolchain file doesn't work
8+
CMAKE_ARGS += -DBUILD_LIST=core,imgproc,imgcodecs
99

10-
# Ensure we're building the OpenCV board variant
11-
MAKE_ARGS += BOARD_VARIANT=LARGE_BINARY
12-
13-
# Use the OpenCV driver manifest
14-
MAKE_ARGS += FROZEN_MANIFEST="$(CURRENT_DIR)/manifest.py"
15-
16-
# Build MicroPython with the OpenCV module
10+
# Generic build
1711
all:
18-
@cd micropython/ports/rp2 && export CMAKE_ARGS="$(CMAKE_ARGS)" && make -f Makefile $(MAKEFLAGS) $(MAKE_ARGS)
12+
cd opencv && mkdir -p build && cmake -S . -B build -DPICO_BUILD_DOCS=0 -DCMAKE_TOOLCHAIN_FILE=../${TOOLCHAIN_FILE} ${CMAKE_ARGS} && make -C build -f Makefile $(MAKEFLAGS) $(MAKE_ARGS)
1913

20-
# Clean the MicroPython build
14+
# Clean the OpenCV build
2115
clean:
22-
@cd micropython/ports/rp2 && make -f Makefile $(MAKEFLAGS) $(MAKE_ARGS) clean
23-
24-
# Load the MicroPython submodules
25-
submodules:
26-
@cd micropython/ports/rp2 && make -f Makefile $(MAKEFLAGS) $(MAKE_ARGS) submodules
16+
cd opencv && rm -rf build

README.md

Lines changed: 85 additions & 112 deletions
Large diffs are not rendered by default.

build.sh

Lines changed: 0 additions & 181 deletions
This file was deleted.

cv2_drivers/__init__.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

cv2_drivers/cameras/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

cv2_drivers/cameras/cv2_camera.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)