From 6ec687aaa33a49945f0df067e2f0f9398bdb8a4f Mon Sep 17 00:00:00 2001 From: Nova Date: Tue, 23 Jun 2020 03:08:26 +0530 Subject: [PATCH] Compatible to all opencv-python version from 3.3 to latest --- docs/getting_started.rst | 2 +- docs/logging.rst | 2 +- pyproject.toml | 20 ++++++++++---------- tests/test_log.py | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 026f091..49687fa 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -67,7 +67,7 @@ It generates CSV ot HTML report which can be used to for accuracy analysis. By combining the log and test reporting, we can generate an interaractive html to debug and analyse the issue offline. .. todo:: - HTML reporting is in milestone and it will be added in 1.4.0 version. + HTML reporting is in milestone and it will be added in 1.6.0 version. .. code-block:: python diff --git a/docs/logging.rst b/docs/logging.rst index a814b18..b465a52 100644 --- a/docs/logging.rst +++ b/docs/logging.rst @@ -113,7 +113,7 @@ Contour gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(gray, 127, 255, 0) - image, contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) # log or show the image by drawing the all contour log.contours(log.Level.ERROR, contours, img) diff --git a/pyproject.toml b/pyproject.toml index f5d339f..29da0f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "opencv-log" -version = "1.3.0" +version = "1.4.0" description = "OpenCV based visual logger for debugging,logging and testing image processing code" authors = ["Navarasu "] readme = 'README.rst' @@ -16,17 +16,17 @@ packages = [ { include = "cvlog" }] [tool.poetry.dependencies] python = "^3.5" -opencv-python = "^3.4" +opencv-python = ">=3.3" [tool.poetry.dev-dependencies] -pytest = "^3.0" -flake8 ="^3.7" -coverage="^4.5" -coveralls="^1.8" -beautifulsoup4="4.8.2" -sphinx="2.4.4" -sphinx-rtd-theme="0.4.3" -sphinx-copybutton="^0.2.10" +pytest = ">=3.0" +flake8 =">=3.7" +coverage=">=4.5" +coveralls=">=1.8" +beautifulsoup4=">=4.8.2" +sphinx=">=2.4.4" +sphinx-rtd-theme=">=0.4.3" +sphinx-copybutton=">=0.2.10" [build-system] requires = ["poetry>=0.12"] diff --git a/tests/test_log.py b/tests/test_log.py index bd91371..aaade7c 100644 --- a/tests/test_log.py +++ b/tests/test_log.py @@ -66,7 +66,7 @@ def test_contours(): log.set_mode(log.Mode.LOG) imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(imgray, 127, 255, 0) - image, contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) log.contours(log.Level.ERROR, contours, img) logitem = get_html('log/cvlog.html').select('.log-list .log-item') assert logitem[0].select('.log-type')[0].text == 'contours' @@ -91,7 +91,7 @@ def test_message(): log.set_mode(log.Mode.LOG) imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(imgray, 127, 255, 0) - image, contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) + contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) message = 'Lorem ipsum dolor sit amet, ne persius reprehendunt mei. Ea summo elitr munere his, et consul offendit recteque sea, quis elit nam ut.' log.image(log.Level.ERROR, img) log.contours(log.Level.ERROR, contours, img, msg=message)