Skip to content

Commit

Permalink
Use the Dummy opencv to return an error if opencv not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustín Castro committed Feb 26, 2024
1 parent bed08ed commit ed273fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion norfair/drawing/fixed_camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from typing import Union

import cv2
try:
import cv2
except ImportError:
from norfair.utils import DummyOpenCVImport

cv2 = DummyOpenCVImport()
import numpy as np

from norfair.camera_motion import HomographyTransformation, TranslationTransformation
Expand Down
7 changes: 6 additions & 1 deletion norfair/drawing/path.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from collections import defaultdict
from typing import Callable, Optional, Sequence, Tuple

import cv2
try:
import cv2
except ImportError:
from norfair.utils import DummyOpenCVImport

cv2 = DummyOpenCVImport()
import numpy as np

from norfair.camera_motion import HomographyTransformation, TranslationTransformation
Expand Down

0 comments on commit ed273fd

Please sign in to comment.