Skip to content

Commit

Permalink
Merge pull request #846 from danforthcenter/update-opencv4
Browse files Browse the repository at this point in the history
Update dependency OpenCV to v4
  • Loading branch information
nfahlgren committed Dec 13, 2021
2 parents d06922d + 4a3fd7b commit aec9924
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@main
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY . /tmp
RUN cd /tmp && sed -i'' -e 's/opencv.*//g' requirements.txt

# Install PlantCV
RUN cd /tmp && conda install --quiet --yes -c conda-forge --file requirements.txt 'opencv<4' && conda clean --all -f -y
RUN cd /tmp && conda install --quiet --yes -c conda-forge --file requirements.txt 'opencv' && conda clean --all -f -y

# Install PlantCV Python prerequisites and PlantCV
RUN cd /tmp && python setup.py install
Expand Down
6 changes: 4 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# optionally, change channel name with -n {plantcv-dev}
name: plantcv
dependencies:
- python=3.7
- python=3.9
- matplotlib>=1.5
- numpy>=1.11
- pandas
Expand All @@ -14,8 +14,10 @@ dependencies:
- dask
- dask-jobqueue
- nb_conda
- opencv<4, >=3.4
- opencv
- statsmodels
- mkdocs
- pytest
channels:
- conda-forge
- defaults
3 changes: 1 addition & 2 deletions plantcv/plantcv/roi/roi_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def multi(img, coord, radius, spacing=None, nrows=None, ncols=None):
circle_img = cv2.circle(bin_img, (x, y), radius, 255, -1)
overlap_img = overlap_img + circle_img
# Make a list of contours and hierarchies
_, rc, rh = cv2.findContours(circle_img, cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_NONE)
rc, rh = cv2.findContours(circle_img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)[-2:]
roi_contour.append(rc)
roi_hierarchy.append(rh)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ scikit-learn
plotnine
dask
dask-jobqueue
opencv-python<4, >=3.4
opencv-python
statsmodels

0 comments on commit aec9924

Please sign in to comment.