The following issues were found
platforms/osx/run_tests.py
21 issues
Line: 7
Column: 1
"""
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
Reported by Pylint.
Line: 7
Column: 1
"""
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
Reported by Pylint.
Line: 11
Column: 1
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
MACOSX_DEPLOYMENT_TARGET='10.12' # default, can be changed via command line options or environment variable
class OSXTestRunner(TestRunner):
Reported by Pylint.
Line: 21
Column: 9
return None
def getCMakeArgs(self):
args = TestRunner.getCMakeArgs(self)
args = args + [
'-DMACOSX_DEPLOYMENT_TARGET=%s' % os.environ['MACOSX_DEPLOYMENT_TARGET']
]
return args
Reported by Pylint.
Line: 7
Column: 1
"""
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
Reported by Pylint.
Line: 11
Column: 1
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
MACOSX_DEPLOYMENT_TARGET='10.12' # default, can be changed via command line options or environment variable
class OSXTestRunner(TestRunner):
Reported by Pylint.
Line: 13
Column: 1
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from run_tests import TestRunner
MACOSX_DEPLOYMENT_TARGET='10.12' # default, can be changed via command line options or environment variable
class OSXTestRunner(TestRunner):
def getToolchain(self):
return None
Reported by Pylint.
Line: 15
Column: 1
MACOSX_DEPLOYMENT_TARGET='10.12' # default, can be changed via command line options or environment variable
class OSXTestRunner(TestRunner):
def getToolchain(self):
return None
def getCMakeArgs(self):
Reported by Pylint.
Line: 17
Column: 5
class OSXTestRunner(TestRunner):
def getToolchain(self):
return None
def getCMakeArgs(self):
args = TestRunner.getCMakeArgs(self)
args = args + [
Reported by Pylint.
Line: 17
Column: 5
class OSXTestRunner(TestRunner):
def getToolchain(self):
return None
def getCMakeArgs(self):
args = TestRunner.getCMakeArgs(self)
args = args + [
Reported by Pylint.
samples/python/tutorial_code/imgProc/opening_closing_hats/morphology_2.py
21 issues
Line: 2
Column: 1
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
Reported by Pylint.
Line: 3
Column: 1
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
Reported by Pylint.
Line: 16
Column: 27
title_window = 'Morphology Transformations Demo'
morph_op_dic = {0: cv.MORPH_OPEN, 1: cv.MORPH_CLOSE, 2: cv.MORPH_GRADIENT, 3: cv.MORPH_TOPHAT, 4: cv.MORPH_BLACKHAT}
def morphology_operations(val):
morph_operator = cv.getTrackbarPos(title_trackbar_operator_type, title_window)
morph_size = cv.getTrackbarPos(title_trackbar_kernel_size, title_window)
morph_elem = 0
val_type = cv.getTrackbarPos(title_trackbar_element_type, title_window)
if val_type == 0:
Reported by Pylint.
Line: 18
Column: 5
def morphology_operations(val):
morph_operator = cv.getTrackbarPos(title_trackbar_operator_type, title_window)
morph_size = cv.getTrackbarPos(title_trackbar_kernel_size, title_window)
morph_elem = 0
val_type = cv.getTrackbarPos(title_trackbar_element_type, title_window)
if val_type == 0:
morph_elem = cv.MORPH_RECT
elif val_type == 1:
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
Reported by Pylint.
Line: 4
Column: 1
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
title_trackbar_operator_type = 'Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat'
title_trackbar_element_type = 'Element:\n 0: Rect - 1: Cross - 2: Ellipse'
Reported by Pylint.
Line: 7
Column: 1
import argparse
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
title_trackbar_operator_type = 'Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat'
title_trackbar_element_type = 'Element:\n 0: Rect - 1: Cross - 2: Ellipse'
title_trackbar_kernel_size = 'Kernel size:\n 2n + 1'
Reported by Pylint.
Line: 8
Column: 1
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
title_trackbar_operator_type = 'Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat'
title_trackbar_element_type = 'Element:\n 0: Rect - 1: Cross - 2: Ellipse'
title_trackbar_kernel_size = 'Kernel size:\n 2n + 1'
title_window = 'Morphology Transformations Demo'
Reported by Pylint.
Line: 9
Column: 1
morph_size = 0
max_operator = 4
max_elem = 2
max_kernel_size = 21
title_trackbar_operator_type = 'Operator:\n 0: Opening - 1: Closing \n 2: Gradient - 3: Top Hat \n 4: Black Hat'
title_trackbar_element_type = 'Element:\n 0: Rect - 1: Cross - 2: Ellipse'
title_trackbar_kernel_size = 'Kernel size:\n 2n + 1'
title_window = 'Morphology Transformations Demo'
morph_op_dic = {0: cv.MORPH_OPEN, 1: cv.MORPH_CLOSE, 2: cv.MORPH_GRADIENT, 3: cv.MORPH_TOPHAT, 4: cv.MORPH_BLACKHAT}
Reported by Pylint.
modules/core/misc/java/test/Point3Test.java
21 issues
Line: 7
import org.opencv.core.Point3;
import org.opencv.test.OpenCVTestCase;
public class Point3Test extends OpenCVTestCase {
private Point3 p1;
private Point3 p2;
@Override
Reported by PMD.
Line: 9
public class Point3Test extends OpenCVTestCase {
private Point3 p1;
private Point3 p2;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 10
public class Point3Test extends OpenCVTestCase {
private Point3 p1;
private Point3 p2;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 12
private Point3 p1;
private Point3 p2;
@Override
protected void setUp() throws Exception {
super.setUp();
p1 = new Point3(2, 2, 2);
p2 = new Point3(1, 1, 1);
Reported by PMD.
Line: 20
p2 = new Point3(1, 1, 1);
}
public void testClone() {
Point3 truth = new Point3(1, 1, 1);
p1 = truth.clone();
assertEquals(truth, p1);
}
Reported by PMD.
Line: 26
assertEquals(truth, p1);
}
public void testCross() {
Point3 dstPoint = p1.cross(p2);
Point3 truth = new Point3(0, 0, 0);
assertEquals(truth, dstPoint);
}
Reported by PMD.
Line: 32
assertEquals(truth, dstPoint);
}
public void testDot() {
double result = p1.dot(p2);
assertEquals(6.0, result);
}
public void testEqualsObject() {
Reported by PMD.
Line: 37
assertEquals(6.0, result);
}
public void testEqualsObject() {
boolean flag = p1.equals(p1);
assertTrue(flag);
flag = p1.equals(p2);
assertFalse(flag);
Reported by PMD.
Line: 37
assertEquals(6.0, result);
}
public void testEqualsObject() {
boolean flag = p1.equals(p1);
assertTrue(flag);
flag = p1.equals(p2);
assertFalse(flag);
Reported by PMD.
Line: 45
assertFalse(flag);
}
public void testHashCode() {
assertEquals(p1.hashCode(), p1.hashCode());
}
public void testPoint3() {
p1 = new Point3();
Reported by PMD.
modules/ml/misc/python/test/test_goodfeatures.py
21 issues
Line: 6
Column: 1
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
Reported by Pylint.
Line: 9
Column: 1
import cv2 as cv
import numpy as np
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
Reported by Pylint.
Line: 7
Column: 1
from __future__ import print_function
import cv2 as cv
import numpy as np
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
Reported by Pylint.
Line: 26
Column: 17
results2 = dict([(t, cv.goodFeaturesToTrack(arr, numPoints, t, 2, useHarrisDetector=True)) for t in threshes])
for t in threshes:
self.assertTrue(len(results2[t]) == len(results[t]))
for i in range(len(results[t])):
self.assertTrue(cv.norm(results[t][i][0] - results2[t][i][0]) == 0)
for t0,t1 in zip(threshes, threshes[1:]):
r0 = results[t0]
r1 = results[t1]
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
from tests_common import NewOpenCVTests
Reported by Pylint.
Line: 11
Column: 1
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
Reported by Pylint.
Line: 11
Column: 1
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
Reported by Pylint.
Line: 11
Column: 1
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
Reported by Pylint.
Line: 12
Column: 5
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
Reported by Pylint.
Line: 12
Column: 5
from tests_common import NewOpenCVTests
class TestGoodFeaturesToTrack_test(NewOpenCVTests):
def test_goodFeaturesToTrack(self):
arr = self.get_sample('samples/data/lena.jpg', 0)
original = arr.copy()
threshes = [ x / 100. for x in range(1,10) ]
numPoints = 20000
Reported by Pylint.
samples/java/tutorial_code/ImgProc/opening_closing_hats/MorphologyDemo2.java
21 issues
Line: 43
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
matImgSrc = Imgcodecs.imread(imagePath);
if (matImgSrc.empty()) {
System.out.println("Empty image: " + imagePath);
System.exit(0);
}
// Create and set up the window.
frame = new JFrame("Morphology Transformations demo");
Reported by PMD.
Line: 31
Imgproc.MORPH_GRADIENT, Imgproc.MORPH_TOPHAT, Imgproc.MORPH_BLACKHAT };
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
Reported by PMD.
Line: 31
Imgproc.MORPH_GRADIENT, Imgproc.MORPH_TOPHAT, Imgproc.MORPH_BLACKHAT };
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
Reported by PMD.
Line: 32
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 32
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 33
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 34
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
public MorphologyDemo2(String[] args) {
Reported by PMD.
Line: 35
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
public MorphologyDemo2(String[] args) {
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
Reported by PMD.
Line: 35
private Mat matImgDst = new Mat();
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
public MorphologyDemo2(String[] args) {
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
Reported by PMD.
Line: 36
private int morphOpType = Imgproc.MORPH_OPEN;
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private JFrame frame;
private JLabel imgLabel;
public MorphologyDemo2(String[] args) {
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
matImgSrc = Imgcodecs.imread(imagePath);
Reported by PMD.
samples/dnn/dnn_model_runner/dnn_conversion/common/test/model_test_pipeline.py
21 issues
Line: 5
Column: 1
import numpy as np
from .configs.test_config import CommonConfig
from ..utils import create_parser, plot_acc
class ModelTestPipeline:
def __init__(
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
from .configs.test_config import CommonConfig
from ..utils import create_parser, plot_acc
class ModelTestPipeline:
def __init__(
self,
Reported by Pylint.
Line: 46
Column: 50
self._test_module_config.model = self._net_model.model_path["full_path"]
if cmd_args.default_img_preprocess:
self._test_module_config.scale = self._default_input_blob_preproc["scale"]
self._test_module_config.mean = self._default_input_blob_preproc["mean"]
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
Reported by Pylint.
Line: 47
Column: 49
if cmd_args.default_img_preprocess:
self._test_module_config.scale = self._default_input_blob_preproc["scale"]
self._test_module_config.mean = self._default_input_blob_preproc["mean"]
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
Reported by Pylint.
Line: 48
Column: 48
if cmd_args.default_img_preprocess:
self._test_module_config.scale = self._default_input_blob_preproc["scale"]
self._test_module_config.mean = self._default_input_blob_preproc["mean"]
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
Reported by Pylint.
Line: 49
Column: 49
self._test_module_config.scale = self._default_input_blob_preproc["scale"]
self._test_module_config.mean = self._default_input_blob_preproc["mean"]
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
Reported by Pylint.
Line: 51
Column: 36
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
self._test_module_param_list = [
'--model', self._test_module_config.model,
Reported by Pylint.
Line: 51
Column: 88
self._test_module_config.std = self._default_input_blob_preproc["std"]
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
self._test_module_param_list = [
'--model', self._test_module_config.model,
Reported by Pylint.
Line: 52
Column: 59
self._test_module_config.crop = self._default_input_blob_preproc["crop"]
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
self._test_module_param_list = [
'--model', self._test_module_config.model,
'--input', self._test_module_config.input_img,
Reported by Pylint.
Line: 53
Column: 58
if "rsz_height" in self._default_input_blob_preproc and "rsz_width" in self._default_input_blob_preproc:
self._test_module_config.rsz_height = self._default_input_blob_preproc["rsz_height"]
self._test_module_config.rsz_width = self._default_input_blob_preproc["rsz_width"]
self._test_module_param_list = [
'--model', self._test_module_config.model,
'--input', self._test_module_config.input_img,
'--width', self._test_module_config.frame_width,
Reported by Pylint.
samples/java/tutorial_code/TrackingMotion/harris_detector/CornerHarrisDemo.java
21 issues
Line: 39
String filename = args.length > 0 ? args[0] : "../data/building.jpg";
Mat src = Imgcodecs.imread(filename);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
Imgproc.cvtColor(src, srcGray, Imgproc.COLOR_BGR2GRAY);
Reported by PMD.
Line: 24
import org.opencv.imgproc.Imgproc;
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 24
import org.opencv.imgproc.Imgproc;
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 25
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
Reported by PMD.
Line: 25
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
Reported by PMD.
Line: 26
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
private static final int MAX_THRESHOLD = 255;
Reported by PMD.
Line: 26
class CornerHarris {
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
private static final int MAX_THRESHOLD = 255;
Reported by PMD.
Line: 27
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 200;
Reported by PMD.
Line: 27
private Mat srcGray = new Mat();
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 200;
Reported by PMD.
Line: 28
private Mat dst = new Mat();
private Mat dstNorm = new Mat();
private Mat dstNormScaled = new Mat();
private JFrame frame;
private JLabel imgLabel;
private JLabel cornerLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 200;
Reported by PMD.
samples/java/tutorial_code/ImgProc/erosion_dilatation/MorphologyDemo1.java
21 issues
Line: 42
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
matImgSrc = Imgcodecs.imread(imagePath);
if (matImgSrc.empty()) {
System.out.println("Empty image: " + imagePath);
System.exit(0);
}
// Create and set up the window.
frame = new JFrame("Erosion and dilatation demo");
Reported by PMD.
Line: 29
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final String[] MORPH_OP = { "Erosion", "Dilatation" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
Reported by PMD.
Line: 29
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final String[] MORPH_OP = { "Erosion", "Dilatation" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
Reported by PMD.
Line: 30
private static final String[] MORPH_OP = { "Erosion", "Dilatation" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 30
private static final String[] MORPH_OP = { "Erosion", "Dilatation" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 31
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 32
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
//! [constructor]
Reported by PMD.
Line: 32
private Mat matImgSrc;
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
//! [constructor]
Reported by PMD.
Line: 33
private Mat matImgDst = new Mat();
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
//! [constructor]
public MorphologyDemo1(String[] args) {
Reported by PMD.
Line: 34
private int elementType = Imgproc.CV_SHAPE_RECT;
private int kernelSize = 0;
private boolean doErosion = true;
private JFrame frame;
private JLabel imgLabel;
//! [constructor]
public MorphologyDemo1(String[] args) {
String imagePath = args.length > 0 ? args[0] : "../data/LinuxLogo.jpg";
Reported by PMD.
samples/java/tutorial_code/core/AddingImages/AddingImages.java
21 issues
Line: 14
Mat src1, src2, dst = new Mat();
System.out.println(" Simple Linear Blender ");
System.out.println("-----------------------");
System.out.println("* Enter alpha [0.0-1.0]: ");
Scanner scan = new Scanner( System.in ).useLocale(Locale.US);
input = scan.nextDouble();
Reported by PMD.
Line: 15
Mat src1, src2, dst = new Mat();
System.out.println(" Simple Linear Blender ");
System.out.println("-----------------------");
System.out.println("* Enter alpha [0.0-1.0]: ");
Scanner scan = new Scanner( System.in ).useLocale(Locale.US);
input = scan.nextDouble();
if( input >= 0.0 && input <= 1.0 )
Reported by PMD.
Line: 16
System.out.println(" Simple Linear Blender ");
System.out.println("-----------------------");
System.out.println("* Enter alpha [0.0-1.0]: ");
Scanner scan = new Scanner( System.in ).useLocale(Locale.US);
input = scan.nextDouble();
if( input >= 0.0 && input <= 1.0 )
alpha = input;
Reported by PMD.
Line: 28
src2 = Imgcodecs.imread("../../images/WindowsLogo.jpg");
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
Reported by PMD.
Line: 29
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
//! [blend_images]
Reported by PMD.
Line: 17
System.out.println(" Simple Linear Blender ");
System.out.println("-----------------------");
System.out.println("* Enter alpha [0.0-1.0]: ");
Scanner scan = new Scanner( System.in ).useLocale(Locale.US);
input = scan.nextDouble();
if( input >= 0.0 && input <= 1.0 )
alpha = input;
Reported by PMD.
Line: 28
src2 = Imgcodecs.imread("../../images/WindowsLogo.jpg");
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
Reported by PMD.
Line: 28
src2 = Imgcodecs.imread("../../images/WindowsLogo.jpg");
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
Reported by PMD.
Line: 29
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
//! [blend_images]
Reported by PMD.
Line: 29
//! [load]
if( src1.empty() == true ){ System.out.println("Error loading src1"); return;}
if( src2.empty() == true ){ System.out.println("Error loading src2"); return;}
//! [blend_images]
beta = ( 1.0 - alpha );
Core.addWeighted( src1, alpha, src2, beta, 0.0, dst);
//! [blend_images]
Reported by PMD.
samples/dnn/person_reid.py
21 issues
Line: 19
Column: 1
import argparse
import os.path
import numpy as np
import cv2 as cv
backends = (cv.dnn.DNN_BACKEND_DEFAULT,
cv.dnn.DNN_BACKEND_INFERENCE_ENGINE,
cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM,
Reported by Pylint.
Line: 54
Column: 5
images = np.array(img_list)
images = (images / 255.0 - MEAN) / STD
input = cv.dnn.blobFromImages(images.astype(np.float32), ddepth = cv.CV_32F)
return input
def extract_feature(img_dir, model_path, batch_size = 32, resize_h = 384, resize_w = 128, backend=cv.dnn.DNN_BACKEND_OPENCV, target=cv.dnn.DNN_TARGET_CPU):
"""
Extract features from images in a target directory
Reported by Pylint.
Line: 139
Column: 36
dist = np.matmul(array1, array2.T)
return dist
def topk(query_feat, gallery_feat, topk = 5):
"""
Return the index of top K gallery images most similar to the query images
:param query_feat: array of feature vectors of query images
:param gallery_feat: array of feature vectors of gallery images
:param topk: number of gallery images to return
Reported by Pylint.
Line: 139
Column: 10
dist = np.matmul(array1, array2.T)
return dist
def topk(query_feat, gallery_feat, topk = 5):
"""
Return the index of top K gallery images most similar to the query images
:param query_feat: array of feature vectors of query images
:param gallery_feat: array of feature vectors of gallery images
:param topk: number of gallery images to return
Reported by Pylint.
Line: 139
Column: 22
dist = np.matmul(array1, array2.T)
return dist
def topk(query_feat, gallery_feat, topk = 5):
"""
Return the index of top K gallery images most similar to the query images
:param query_feat: array of feature vectors of query images
:param gallery_feat: array of feature vectors of gallery images
:param topk: number of gallery images to return
Reported by Pylint.
Line: 185
Column: 42
return ret
def visualization(topk_idx, query_names, gallery_names, output_dir = 'vis'):
"""
Visualize the retrieval results with the person ReID model
:param topk_idx: the index of ranked gallery images for each query image
:param query_names: the list of paths of query images
:param gallery_names: the list of paths of gallery images
Reported by Pylint.
Line: 185
Column: 29
return ret
def visualization(topk_idx, query_names, gallery_names, output_dir = 'vis'):
"""
Visualize the retrieval results with the person ReID model
:param topk_idx: the index of ranked gallery images for each query image
:param query_names: the list of paths of query images
:param gallery_names: the list of paths of gallery images
Reported by Pylint.
Line: 185
Column: 19
return ret
def visualization(topk_idx, query_names, gallery_names, output_dir = 'vis'):
"""
Visualize the retrieval results with the person ReID model
:param topk_idx: the index of ranked gallery images for each query image
:param query_names: the list of paths of query images
:param gallery_names: the list of paths of gallery images
Reported by Pylint.
Line: 57
Column: 1
input = cv.dnn.blobFromImages(images.astype(np.float32), ddepth = cv.CV_32F)
return input
def extract_feature(img_dir, model_path, batch_size = 32, resize_h = 384, resize_w = 128, backend=cv.dnn.DNN_BACKEND_OPENCV, target=cv.dnn.DNN_TARGET_CPU):
"""
Extract features from images in a target directory
:param img_dir: the input image directory
:param model_path: path to ReID model
:param batch_size: the batch size for each network inference iteration
Reported by Pylint.
Line: 57
Column: 1
input = cv.dnn.blobFromImages(images.astype(np.float32), ddepth = cv.CV_32F)
return input
def extract_feature(img_dir, model_path, batch_size = 32, resize_h = 384, resize_w = 128, backend=cv.dnn.DNN_BACKEND_OPENCV, target=cv.dnn.DNN_TARGET_CPU):
"""
Extract features from images in a target directory
:param img_dir: the input image directory
:param model_path: path to ReID model
:param batch_size: the batch size for each network inference iteration
Reported by Pylint.