diff --git a/coreplugins/changedetection/compare.py b/coreplugins/changedetection/compare.py index f17b23c9..6f30b7e1 100644 --- a/coreplugins/changedetection/compare.py +++ b/coreplugins/changedetection/compare.py @@ -1,11 +1,17 @@ import rasterio as rio from rasterio import warp, transform import numpy as np -import cv2 import json +import sys +import os from geojson import Feature, FeatureCollection, dumps, Polygon from rasteralign import align, align_altitudes +from webodm import settings + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", settings.MEDIA_ROOT, "plugins", "elevationmap", "site-packages")) +import cv2 + KERNEL_10_10 = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (10, 10)) KERNEL_20_20 = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (20, 20)) @@ -112,6 +118,7 @@ def calculate_heatmap(diff, mask, dem, epsg, min_height): xs = pixels[:, 0] ys = pixels[:, 1] + # Map pixels to coordinates coords_xs, coords_ys = map_pixels_to_coordinates(dem, epsg, xs, ys) diff --git a/coreplugins/changedetection/requirements.txt b/coreplugins/changedetection/requirements.txt index 6a5e1083..7197cf6f 100644 --- a/coreplugins/changedetection/requirements.txt +++ b/coreplugins/changedetection/requirements.txt @@ -1,3 +1,3 @@ geojson==2.4.1 -opencv-python==4.4.0.44 -scipy==1.2.1 +opencv-python-headless==4.4.0.46 + diff --git a/coreplugins/elevationmap/elevationmap.py b/coreplugins/elevationmap/elevationmap.py index 79b4e24e..806a1bbf 100755 --- a/coreplugins/elevationmap/elevationmap.py +++ b/coreplugins/elevationmap/elevationmap.py @@ -45,7 +45,7 @@ #%end -import cv2, math, argparse +import math, argparse import numpy as np import rasterio as rio from rasterio import warp, transform @@ -56,6 +56,10 @@ import glob import shutil import sys import grass.script as grass +from webodm import settings + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", settings.MEDIA_ROOT, "plugins", "elevationmap", "site-packages")) +import cv2 def main(): ext = "" diff --git a/coreplugins/elevationmap/requirements.txt b/coreplugins/elevationmap/requirements.txt index c5f0c0ea..b24a8f23 100644 --- a/coreplugins/elevationmap/requirements.txt +++ b/coreplugins/elevationmap/requirements.txt @@ -1,2 +1,2 @@ geojson==2.4.1 -opencv-python==4.4.0.44 +opencv-python-headless==4.4.0.46