Skip to content

Commit 17bc4ae

Browse files
committed
Change examples to import specific things instead of *
1 parent d567cce commit 17bc4ae

9 files changed

+11
-11
lines changed

red_vision_examples/ex01_hello_opencv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# The examples import a module called `cv2_hardware_init`, which initializes the
2121
# drivers. You may need to edit the contents of the `cv2_hardware_init` module
2222
# based on your specific board and hardware configuration
23-
from rv_init import *
23+
from rv_init import display
2424

2525
# Import NumPy, almost like any other Python environment! The only difference is
2626
# the addition of `from ulab` since MicroPython does not have a full NumPy

red_vision_examples/ex02_camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Import OpenCV and hardware initialization module
1414
import cv2 as cv
15-
from rv_init import *
15+
from rv_init import display, camera
1616

1717
# Open a camera, similar to any other Python environment! In standard OpenCV,
1818
# you would use `cv.VideoCapture(0)` or similar, and OpenCV would leverage the

red_vision_examples/ex03_touch_screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Import OpenCV and hardware initialization module
1414
import cv2 as cv
15-
from rv_init import *
15+
from rv_init import display, touch_screen
1616

1717
# Import NumPy
1818
from ulab import numpy as np

red_vision_examples/ex04_imread_imwrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Import OpenCV and hardware initialization module
1515
import cv2 as cv
16-
from rv_init import *
16+
from rv_init import display
1717

1818
# Call `cv.imread()` to read an image from the MicroPython filesystem, just
1919
# like in any other Python environment! Make sure to copy the image to the

red_vision_examples/ex05_performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Import OpenCV and hardware initialization module
1818
import cv2 as cv
19-
from rv_init import *
19+
from rv_init import display, camera
2020

2121
# Import NumPy to create arrays
2222
from ulab import numpy as np

red_vision_examples/ex06_detect_sfe_logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# Import OpenCV and hardware initialization module
2323
import cv2 as cv
24-
from rv_init import *
24+
from rv_init import display, camera
2525

2626
# Import NumPy
2727
from ulab import numpy as np

red_vision_examples/ex07_animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Import OpenCV and hardware initialization module
1616
import cv2 as cv
17-
from rv_init import *
17+
from rv_init import display
1818

1919
# Load an animation sheet image that contains multiple frames of an animation
2020
animation_sheet = cv.imread("red_vision_examples/images/animation_sheet.png")

red_vision_examples/xrp_examples/ex01_touch_screen_drive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#-------------------------------------------------------------------------------
1313

1414
# Import XRPLib defaults
15-
from XRPLib.defaults import *
15+
from XRPLib.defaults import drivetrain
1616

1717
# Import OpenCV and hardware initialization module
1818
import cv2 as cv
19-
from rv_init import *
19+
from rv_init import display, touch_screen
2020

2121
# Import NumPy
2222
from ulab import numpy as np

red_vision_examples/xrp_examples/ex02_grab_orange_ring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
#-------------------------------------------------------------------------------
2525

2626
# Import XRPLib defaults
27-
from XRPLib.defaults import *
27+
from XRPLib.defaults import drivetrain, servo_one, board
2828

2929
# Import OpenCV and hardware initialization module
3030
import cv2 as cv
31-
from rv_init import *
31+
from rv_init import display, camera
3232

3333
# Import time for delays
3434
import time

0 commit comments

Comments
 (0)