The following issues were found
modules/core/misc/java/test/MatOfByteTest.java
27 issues
Line: 16
public class MatOfByteTest extends OpenCVTestCase {
public void testMatOfSubByteArray() {
byte[] inputBytes = { 1,2,3,4,5 };
MatOfByte m0 = new MatOfByte(inputBytes);
MatOfByte m1 = new MatOfByte(0, inputBytes.length, inputBytes);
MatOfByte m2 = new MatOfByte(1, inputBytes.length - 2, inputBytes);
Reported by PMD.
Line: 16
public class MatOfByteTest extends OpenCVTestCase {
public void testMatOfSubByteArray() {
byte[] inputBytes = { 1,2,3,4,5 };
MatOfByte m0 = new MatOfByte(inputBytes);
MatOfByte m1 = new MatOfByte(0, inputBytes.length, inputBytes);
MatOfByte m2 = new MatOfByte(1, inputBytes.length - 2, inputBytes);
Reported by PMD.
Line: 23
MatOfByte m1 = new MatOfByte(0, inputBytes.length, inputBytes);
MatOfByte m2 = new MatOfByte(1, inputBytes.length - 2, inputBytes);
assertEquals(5.0, m0.size().height);
assertEquals(1.0, m0.size().width);
assertEquals(m0.get(0, 0)[0], m1.get(0, 0)[0]);
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
Reported by PMD.
Line: 24
MatOfByte m2 = new MatOfByte(1, inputBytes.length - 2, inputBytes);
assertEquals(5.0, m0.size().height);
assertEquals(1.0, m0.size().width);
assertEquals(m0.get(0, 0)[0], m1.get(0, 0)[0]);
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
assertEquals(3.0, m2.size().height);
Reported by PMD.
Line: 27
assertEquals(1.0, m0.size().width);
assertEquals(m0.get(0, 0)[0], m1.get(0, 0)[0]);
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
assertEquals(3.0, m2.size().height);
assertEquals(1.0, m2.size().width);
assertEquals(2.0, m2.get(0, 0)[0]);
Reported by PMD.
Line: 27
assertEquals(1.0, m0.size().width);
assertEquals(m0.get(0, 0)[0], m1.get(0, 0)[0]);
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
assertEquals(3.0, m2.size().height);
assertEquals(1.0, m2.size().width);
assertEquals(2.0, m2.get(0, 0)[0]);
Reported by PMD.
Line: 29
assertEquals(m0.get(0, 0)[0], m1.get(0, 0)[0]);
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
assertEquals(3.0, m2.size().height);
assertEquals(1.0, m2.size().width);
assertEquals(2.0, m2.get(0, 0)[0]);
assertEquals(3.0, m2.get(1, 0)[0]);
assertEquals(4.0, m2.get(2, 0)[0]);
Reported by PMD.
Line: 30
assertEquals(m0.get((int) m0.size().height - 1, 0)[0], m1.get((int) m1.size().height - 1, 0)[0]);
assertEquals(3.0, m2.size().height);
assertEquals(1.0, m2.size().width);
assertEquals(2.0, m2.get(0, 0)[0]);
assertEquals(3.0, m2.get(1, 0)[0]);
assertEquals(4.0, m2.get(2, 0)[0]);
}
Reported by PMD.
Line: 38
}
public void testMatOfSubByteArray_BadArg() {
byte[] inputBytes = { 1,2,3,4,5 };
try {
MatOfByte m1 = new MatOfByte(-1, inputBytes.length, inputBytes);
fail("Missing check: offset < 0");
Reported by PMD.
Line: 42
byte[] inputBytes = { 1,2,3,4,5 };
try {
MatOfByte m1 = new MatOfByte(-1, inputBytes.length, inputBytes);
fail("Missing check: offset < 0");
} catch (IllegalArgumentException e) {
// pass
}
Reported by PMD.
samples/java/tutorial_code/ShapeDescriptors/moments/MomentsDemo.java
27 issues
Line: 45
String filename = args.length > 0 ? args[0] : "../data/stuff.jpg";
Mat src = Imgcodecs.imread(filename);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
/// Convert image to gray and blur it
Imgproc.cvtColor(src, srcGray, Imgproc.COLOR_BGR2GRAY);
Reported by PMD.
Line: 155
//! [showDrawings]
/// Calculate the area with the moments 00 and compare with the result of the OpenCV function
System.out.println("\t Info: Area and Contour Length \n");
for (int i = 0; i < contours.size(); i++) {
System.out.format(" * Contour[%d] - Area (M_00) = %.2f - Area OpenCV: %.2f - Length: %.2f\n", i,
mu.get(i).m00, Imgproc.contourArea(contours.get(i)),
Imgproc.arcLength(new MatOfPoint2f(contours.get(i).toArray()), true));
}
Reported by PMD.
Line: 31
import org.opencv.imgproc.Moments;
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
Reported by PMD.
Line: 31
import org.opencv.imgproc.Moments;
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
Reported by PMD.
Line: 32
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
Reported by PMD.
Line: 32
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
Reported by PMD.
Line: 33
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
Reported by PMD.
Line: 33
class MomentsClass {
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
Reported by PMD.
Line: 34
private Mat srcGray = new Mat();
private JFrame frame;
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
public MomentsClass(String[] args) {
Reported by PMD.
Line: 36
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
public MomentsClass(String[] args) {
//! [setup]
/// Load source image
Reported by PMD.
samples/java/tutorial_code/ImgProc/tutorial_template_matching/MatchTemplateDemo.java
27 issues
Line: 36
public void run(String[] args) {
if (args.length < 2) {
System.out.println("Not enough parameters");
System.out.println("Program arguments:\n<image_name> <template_name> [<mask_name>]");
System.exit(-1);
}
//! [load_image]
Reported by PMD.
Line: 37
public void run(String[] args) {
if (args.length < 2) {
System.out.println("Not enough parameters");
System.out.println("Program arguments:\n<image_name> <template_name> [<mask_name>]");
System.exit(-1);
}
//! [load_image]
/// Load image and template
Reported by PMD.
Line: 53
}
if (img.empty() || templ.empty() || (use_mask && mask.empty())) {
System.out.println("Can't read one of the images");
System.exit(-1);
}
matchingMethod();
createJFrame();
Reported by PMD.
Line: 155
// Customizing the labels
Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
labelTable.put(new Integer(0), new JLabel("0 - SQDIFF"));
labelTable.put(new Integer(1), new JLabel("1 - SQDIFF NORMED"));
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
Reported by PMD.
Line: 156
// Customizing the labels
Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
labelTable.put(new Integer(0), new JLabel("0 - SQDIFF"));
labelTable.put(new Integer(1), new JLabel("1 - SQDIFF NORMED"));
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
slider.setLabelTable(labelTable);
Reported by PMD.
Line: 157
Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
labelTable.put(new Integer(0), new JLabel("0 - SQDIFF"));
labelTable.put(new Integer(1), new JLabel("1 - SQDIFF NORMED"));
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
slider.setLabelTable(labelTable);
Reported by PMD.
Line: 158
labelTable.put(new Integer(0), new JLabel("0 - SQDIFF"));
labelTable.put(new Integer(1), new JLabel("1 - SQDIFF NORMED"));
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
slider.setLabelTable(labelTable);
slider.addChangeListener(this);
Reported by PMD.
Line: 159
labelTable.put(new Integer(1), new JLabel("1 - SQDIFF NORMED"));
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
slider.setLabelTable(labelTable);
slider.addChangeListener(this);
Reported by PMD.
Line: 160
labelTable.put(new Integer(2), new JLabel("2 - TM CCORR"));
labelTable.put(new Integer(3), new JLabel("3 - TM CCORR NORMED"));
labelTable.put(new Integer(4), new JLabel("4 - TM COEFF"));
labelTable.put(new Integer(5), new JLabel("5 - TM COEFF NORMED : (Method)"));
slider.setLabelTable(labelTable);
slider.addChangeListener(this);
frame.add(slider);
Reported by PMD.
Line: 25
//! [declare]
/// Global Variables
Boolean use_mask = false;
Mat img = new Mat(), templ = new Mat();
Mat mask = new Mat();
int match_method;
Reported by PMD.
modules/python/test/test_squares.py
27 issues
Line: 17
Column: 1
xrange = range
import numpy as np
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
Reported by Pylint.
Line: 30
Column: 17
for gray in cv.split(img):
for thrs in xrange(0, 255, 26):
if thrs == 0:
bin = cv.Canny(gray, 0, 50, apertureSize=5)
bin = cv.dilate(bin, None)
else:
_retval, bin = cv.threshold(gray, thrs, 255, cv.THRESH_BINARY)
contours, _hierarchy = cv.findContours(bin, cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE)
for cnt in contours:
Reported by Pylint.
Line: 14
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
Reported by Pylint.
Line: 16
Column: 1
if PY3:
xrange = range
import numpy as np
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
Reported by Pylint.
Line: 17
Column: 1
xrange = range
import numpy as np
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
Reported by Pylint.
Line: 20
Column: 1
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
def find_squares(img):
img = cv.GaussianBlur(img, (5, 5), 0)
Reported by Pylint.
Line: 20
Column: 1
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
def find_squares(img):
img = cv.GaussianBlur(img, (5, 5), 0)
Reported by Pylint.
Line: 20
Column: 1
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
def find_squares(img):
img = cv.GaussianBlur(img, (5, 5), 0)
Reported by Pylint.
Line: 20
Column: 1
import cv2 as cv
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
def find_squares(img):
img = cv.GaussianBlur(img, (5, 5), 0)
Reported by Pylint.
Line: 21
Column: 5
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).astype('float'), (p2-p1).astype('float')
return abs( np.dot(d1, d2) / np.sqrt( np.dot(d1, d1)*np.dot(d2, d2) ) )
def find_squares(img):
img = cv.GaussianBlur(img, (5, 5), 0)
squares = []
Reported by Pylint.
modules/gapi/misc/python/test/test_gapi_imgproc.py
27 issues
Line: 4
Column: 1
#!/usr/bin/env python
import numpy as np
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
Reported by Pylint.
Line: 9
Column: 1
import sys
import unittest
from tests_common import NewOpenCVTests
try:
if sys.version_info[:2] < (3, 0):
Reported by Pylint.
Line: 120
Column: 9
def setUp(self):
self.skipTest('Skip tests: ' + message)
def test_skip():
pass
pass
Reported by Pylint.
Line: 29
Column: 3
class gapi_imgproc_test(NewOpenCVTests):
def test_good_features_to_track(self):
# TODO: Extend to use any type and size here
img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')])
in1 = cv.cvtColor(cv.imread(img_path), cv.COLOR_RGB2GRAY)
# NB: goodFeaturesToTrack configuration
max_corners = 50
Reported by Pylint.
Line: 67
Column: 3
def test_rgb2gray(self):
# TODO: Extend to use any type and size here
img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')])
in1 = cv.imread(img_path)
# OpenCV
expected = cv.cvtColor(in1, cv.COLOR_RGB2GRAY)
Reported by Pylint.
Line: 88
Column: 13
def test_bounding_rect(self):
sz = 1280
fscale = 256
def sample_value(fscale):
return np.random.uniform(0, 255 * fscale) / fscale
Reported by Pylint.
Line: 123
Column: 5
def test_skip():
pass
pass
if __name__ == '__main__':
NewOpenCVTests.bootstrap()
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
import numpy as np
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
Reported by Pylint.
Line: 5
Column: 1
import numpy as np
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
Reported by Pylint.
samples/dnn/common.py
27 issues
Line: 3
Column: 1
import sys
import os
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
Reported by Pylint.
Line: 6
Column: 73
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 6
Column: 37
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 1
Column: 1
import sys
import os
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
Reported by Pylint.
Line: 6
Column: 1
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 6
Column: 1
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 6
Column: 1
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 6
Column: 1
import cv2 as cv
def add_argument(zoo, parser, name, help, required=False, default=None, type=None, action=None, nargs=None):
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
Reported by Pylint.
Line: 10
Column: 5
if len(sys.argv) <= 1:
return
modelName = sys.argv[1]
if os.path.isfile(zoo):
fs = cv.FileStorage(zoo, cv.FILE_STORAGE_READ)
node = fs.getNode(modelName)
if not node.empty():
Reported by Pylint.
Line: 12
Column: 5
modelName = sys.argv[1]
if os.path.isfile(zoo):
fs = cv.FileStorage(zoo, cv.FILE_STORAGE_READ)
node = fs.getNode(modelName)
if not node.empty():
value = node.getNode(name)
if not value.empty():
Reported by Pylint.
samples/python/essential_mat_reconstr.py
27 issues
Line: 1
Column: 1
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
Line: 97
Column: 19
best_cam_idx = np.array([len(obj_pts_per_cam[0]),len(obj_pts_per_cam[1]),
len(obj_pts_per_cam[2]),len(obj_pts_per_cam[3])]).argmax()
max_pts = len(obj_pts_per_cam[best_cam_idx])
print('Number of object points', max_pts)
# filter object points to have reasonable depth
MAX_DEPTH = 6.
obj_pts = []
Reported by Pylint.
Line: 103
Column: 15
# filter object points to have reasonable depth
MAX_DEPTH = 6.
obj_pts = []
for pt in obj_pts_per_cam[best_cam_idx]:
if pt[2] < MAX_DEPTH:
obj_pts.append(pt)
obj_pts = np.array(obj_pts).reshape(len(obj_pts), 3)
# visualize image points
Reported by Pylint.
Line: 2
Column: 1
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
Line: 2
Column: 1
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
Line: 4
Column: 39
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
Line: 5
Column: 5
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
return np.median((np.abs(np.sum(pts1 * lines1, axis=0)) / np.sqrt(lines1[0,:]**2 + lines1[1,:]**2) +
Reported by Pylint.
Line: 6
Column: 5
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
return np.median((np.abs(np.sum(pts1 * lines1, axis=0)) / np.sqrt(lines1[0,:]**2 + lines1[1,:]**2) +
np.abs(np.sum(pts2 * lines2, axis=0)) / np.sqrt(lines2[0,:]**2 + lines2[1,:]**2))/2)
Reported by Pylint.
Line: 1
Column: 1
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
Line: 1
Column: 1
import numpy as np, cv2 as cv, matplotlib.pyplot as plt, time, sys, os
from mpl_toolkits.mplot3d import axes3d, Axes3D
def getEpipolarError(F, pts1_, pts2_, inliers):
pts1 = np.concatenate((pts1_.T, np.ones((1, pts1_.shape[0]))))[:,inliers]
pts2 = np.concatenate((pts2_.T, np.ones((1, pts2_.shape[0]))))[:,inliers]
lines2 = np.dot(F , pts1)
lines1 = np.dot(F.T, pts2)
Reported by Pylint.
modules/imgproc/misc/java/test/Subdiv2DTest.java
26 issues
Line: 9
import org.opencv.imgproc.Subdiv2D;
import org.opencv.test.OpenCVTestCase;
public class Subdiv2DTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
}
Reported by PMD.
Line: 11
public class Subdiv2DTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
}
public void testEdgeDstInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 11
public class Subdiv2DTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
}
public void testEdgeDstInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 11
public class Subdiv2DTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
}
public void testEdgeDstInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 15
super.setUp();
}
public void testEdgeDstInt() {
fail("Not yet implemented");
}
public void testEdgeDstIntPoint() {
fail("Not yet implemented");
Reported by PMD.
Line: 16
}
public void testEdgeDstInt() {
fail("Not yet implemented");
}
public void testEdgeDstIntPoint() {
fail("Not yet implemented");
}
Reported by PMD.
Line: 19
fail("Not yet implemented");
}
public void testEdgeDstIntPoint() {
fail("Not yet implemented");
}
public void testEdgeOrgInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 23
fail("Not yet implemented");
}
public void testEdgeOrgInt() {
fail("Not yet implemented");
}
public void testEdgeOrgIntPoint() {
fail("Not yet implemented");
Reported by PMD.
Line: 27
fail("Not yet implemented");
}
public void testEdgeOrgIntPoint() {
fail("Not yet implemented");
}
public void testFindNearestPoint() {
fail("Not yet implemented");
Reported by PMD.
Line: 31
fail("Not yet implemented");
}
public void testFindNearestPoint() {
fail("Not yet implemented");
}
public void testFindNearestPointPoint() {
fail("Not yet implemented");
Reported by PMD.
modules/gapi/scripts/measure_privacy_masking.py
26 issues
Line: 74
Column: 69
, ("--noshow=%s" % fmt_bool(u[1])) # UI mode (show/no show)
]
out = str(subprocess.check_output(cmd))
match = re.search('Processed [0-9]+ frames \(([0-9]+\.[0-9]+) FPS\)', out)
fps = float(match.group(1))
print(cmd, fps, "FPS")
table[m[0],u[0],f,p] = fps
# Write the performance summary
Reported by Pylint.
Line: 74
Column: 60
, ("--noshow=%s" % fmt_bool(u[1])) # UI mode (show/no show)
]
out = str(subprocess.check_output(cmd))
match = re.search('Processed [0-9]+ frames \(([0-9]+\.[0-9]+) FPS\)', out)
fps = float(match.group(1))
print(cmd, fps, "FPS")
table[m[0],u[0],f,p] = fps
# Write the performance summary
Reported by Pylint.
Line: 74
Column: 82
, ("--noshow=%s" % fmt_bool(u[1])) # UI mode (show/no show)
]
out = str(subprocess.check_output(cmd))
match = re.search('Processed [0-9]+ frames \(([0-9]+\.[0-9]+) FPS\)', out)
fps = float(match.group(1))
print(cmd, fps, "FPS")
table[m[0],u[0],f,p] = fps
# Write the performance summary
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python3
import sys
import subprocess
import re
from enum import Enum
## Helper functions ##################################################
##
Reported by Pylint.
Line: 4
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
#!/usr/bin/env python3
import sys
import subprocess
import re
from enum import Enum
## Helper functions ##################################################
##
Reported by Bandit.
Line: 10
Column: 1
## Helper functions ##################################################
##
def fmt_bool(x):
return ("true" if x else "false")
def fmt_bin(base, prec, model):
return "%s/%s/%s/%s.xml" % (base, model, prec, model)
Reported by Pylint.
Line: 10
Column: 1
## Helper functions ##################################################
##
def fmt_bool(x):
return ("true" if x else "false")
def fmt_bin(base, prec, model):
return "%s/%s/%s/%s.xml" % (base, model, prec, model)
Reported by Pylint.
Line: 11
Column: 1
## Helper functions ##################################################
##
def fmt_bool(x):
return ("true" if x else "false")
def fmt_bin(base, prec, model):
return "%s/%s/%s/%s.xml" % (base, model, prec, model)
## The script itself #################################################
Reported by Pylint.
Line: 13
Column: 1
def fmt_bool(x):
return ("true" if x else "false")
def fmt_bin(base, prec, model):
return "%s/%s/%s/%s.xml" % (base, model, prec, model)
## The script itself #################################################
##
if len(sys.argv) != 3:
Reported by Pylint.
Line: 20
Column: 5
##
if len(sys.argv) != 3:
print("Usage: %s /path/to/input/video /path/to/models" % sys.argv[0])
exit(1)
input_file_path = sys.argv[1]
intel_models_path = sys.argv[2]
app = "bin/example_gapi_privacy_masking_camera"
Reported by Pylint.
samples/python/calibrate.py
26 issues
Line: 20
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
# local modules
from common import splitfn
# built-in modules
Reported by Pylint.
Line: 56
Column: 3
obj_points = []
img_points = []
h, w = cv.imread(img_names[0], cv.IMREAD_GRAYSCALE).shape[:2] # TODO: use imquery call to retrieve results
def processImage(fn):
print('processing %s... ' % fn)
img = cv.imread(fn, 0)
if img is None:
Reported by Pylint.
Line: 26
Column: 1
from common import splitfn
# built-in modules
import os
def main():
import sys
import getopt
from glob import glob
Reported by Pylint.
Line: 28
Column: 1
# built-in modules
import os
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
Reported by Pylint.
Line: 28
Column: 1
# built-in modules
import os
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
Reported by Pylint.
Line: 28
Column: 1
# built-in modules
import os
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
Reported by Pylint.
Line: 29
Column: 5
import os
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
args = dict(args)
Reported by Pylint.
Line: 30
Column: 5
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
args = dict(args)
args.setdefault('--debug', './output/')
Reported by Pylint.
Line: 31
Column: 5
def main():
import sys
import getopt
from glob import glob
args, img_mask = getopt.getopt(sys.argv[1:], '', ['debug=', 'square_size=', 'threads='])
args = dict(args)
args.setdefault('--debug', './output/')
args.setdefault('--square_size', 1.0)
Reported by Pylint.
Line: 56
Column: 1
obj_points = []
img_points = []
h, w = cv.imread(img_names[0], cv.IMREAD_GRAYSCALE).shape[:2] # TODO: use imquery call to retrieve results
def processImage(fn):
print('processing %s... ' % fn)
img = cv.imread(fn, 0)
if img is None:
Reported by Pylint.