The following issues were found
modules/video/misc/python/test/test_tracking.py
17 issues
Line: 4
Column: 1
#!/usr/bin/env python
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
def test_createTracker(self):
t = cv.TrackerMIL_create()
Reported by Pylint.
Line: 2
Column: 1
#!/usr/bin/env python
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
Reported by Pylint.
Line: 3
Column: 1
#!/usr/bin/env python
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
def test_createTracker(self):
t = cv.TrackerMIL_create()
Reported by Pylint.
Line: 11
Column: 9
class tracking_test(NewOpenCVTests):
def test_createTracker(self):
t = cv.TrackerMIL_create()
try:
t = cv.TrackerGOTURN_create()
except cv.error as e:
pass # may fail due to missing DL model files
Reported by Pylint.
Line: 14
Column: 9
t = cv.TrackerMIL_create()
try:
t = cv.TrackerGOTURN_create()
except cv.error as e:
pass # may fail due to missing DL model files
if __name__ == '__main__':
NewOpenCVTests.bootstrap()
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
Reported by Pylint.
Line: 8
Column: 1
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
def test_createTracker(self):
t = cv.TrackerMIL_create()
try:
t = cv.TrackerGOTURN_create()
Reported by Pylint.
Line: 8
Column: 1
from tests_common import NewOpenCVTests, unittest
class tracking_test(NewOpenCVTests):
def test_createTracker(self):
t = cv.TrackerMIL_create()
try:
t = cv.TrackerGOTURN_create()
Reported by Pylint.
modules/calib3d/misc/python/test/test_calibration.py
17 issues
Line: 12
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class calibration_test(NewOpenCVTests):
Reported by Pylint.
Line: 14
Column: 1
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
for i in range(1, 15):
if i < 10:
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
for i in range(1, 15):
if i < 10:
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
for i in range(1, 15):
if i < 10:
Reported by Pylint.
Line: 18
Column: 5
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
for i in range(1, 15):
if i < 10:
img_names.append('samples/data/left0{}.jpg'.format(str(i)))
elif i != 10:
Reported by Pylint.
Line: 18
Column: 5
class calibration_test(NewOpenCVTests):
def test_calibration(self):
img_names = []
for i in range(1, 15):
if i < 10:
img_names.append('samples/data/left0{}.jpg'.format(str(i)))
elif i != 10:
Reported by Pylint.
Line: 34
Column: 12
obj_points = []
img_points = []
h, w = 0, 0
for fn in img_names:
img = self.get_sample(fn, 0)
if img is None:
continue
Reported by Pylint.
Line: 34
Column: 9
obj_points = []
img_points = []
h, w = 0, 0
for fn in img_names:
img = self.get_sample(fn, 0)
if img is None:
continue
Reported by Pylint.
Line: 35
Column: 13
obj_points = []
img_points = []
h, w = 0, 0
for fn in img_names:
img = self.get_sample(fn, 0)
if img is None:
continue
h, w = img.shape[:2]
Reported by Pylint.
modules/core/misc/java/test/KeyPointTest.java
17 issues
Line: 9
public class KeyPointTest extends OpenCVTestCase {
private float angle;
private int classId;
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
Reported by PMD.
Line: 10
public class KeyPointTest extends OpenCVTestCase {
private float angle;
private int classId;
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
private float x;
Reported by PMD.
Line: 11
private float angle;
private int classId;
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
private float x;
private float y;
Reported by PMD.
Line: 12
private float angle;
private int classId;
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
private float x;
private float y;
Reported by PMD.
Line: 13
private int classId;
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
private float x;
private float y;
@Override
Reported by PMD.
Line: 14
private KeyPoint keyPoint;
private int octave;
private float response;
private float size;
private float x;
private float y;
@Override
protected void setUp() throws Exception {
Reported by PMD.
Line: 15
private int octave;
private float response;
private float size;
private float x;
private float y;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 16
private float response;
private float size;
private float x;
private float y;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 18
private float x;
private float y;
@Override
protected void setUp() throws Exception {
super.setUp();
keyPoint = null;
x = 1.0f;
Reported by PMD.
Line: 22
protected void setUp() throws Exception {
super.setUp();
keyPoint = null;
x = 1.0f;
y = 2.0f;
size = 3.0f;
angle = 30.0f;
response = 2.0f;
Reported by PMD.
modules/core/misc/java/test/DMatchTest.java
17 issues
Line: 8
import junit.framework.TestCase;
public class DMatchTest extends TestCase {
public void testDMatch() {
new DMatch();
}
public void testDMatchIntIntFloat() {
DMatch dm1 = new DMatch(1, 4, 4.0f);
Reported by PMD.
Line: 8
import junit.framework.TestCase;
public class DMatchTest extends TestCase {
public void testDMatch() {
new DMatch();
}
public void testDMatchIntIntFloat() {
DMatch dm1 = new DMatch(1, 4, 4.0f);
Reported by PMD.
Line: 12
new DMatch();
}
public void testDMatchIntIntFloat() {
DMatch dm1 = new DMatch(1, 4, 4.0f);
assertEquals(1, dm1.queryIdx);
assertEquals(4, dm1.trainIdx);
assertEquals(4.0f, dm1.distance);
Reported by PMD.
Line: 12
new DMatch();
}
public void testDMatchIntIntFloat() {
DMatch dm1 = new DMatch(1, 4, 4.0f);
assertEquals(1, dm1.queryIdx);
assertEquals(4, dm1.trainIdx);
assertEquals(4.0f, dm1.distance);
Reported by PMD.
Line: 15
public void testDMatchIntIntFloat() {
DMatch dm1 = new DMatch(1, 4, 4.0f);
assertEquals(1, dm1.queryIdx);
assertEquals(4, dm1.trainIdx);
assertEquals(4.0f, dm1.distance);
}
public void testDMatchIntIntIntFloat() {
Reported by PMD.
Line: 16
DMatch dm1 = new DMatch(1, 4, 4.0f);
assertEquals(1, dm1.queryIdx);
assertEquals(4, dm1.trainIdx);
assertEquals(4.0f, dm1.distance);
}
public void testDMatchIntIntIntFloat() {
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
Reported by PMD.
Line: 17
assertEquals(1, dm1.queryIdx);
assertEquals(4, dm1.trainIdx);
assertEquals(4.0f, dm1.distance);
}
public void testDMatchIntIntIntFloat() {
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
Reported by PMD.
Line: 20
assertEquals(4.0f, dm1.distance);
}
public void testDMatchIntIntIntFloat() {
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
assertEquals(2, dm2.queryIdx);
assertEquals(6, dm2.trainIdx);
assertEquals(-1, dm2.imgIdx);
Reported by PMD.
Line: 20
assertEquals(4.0f, dm1.distance);
}
public void testDMatchIntIntIntFloat() {
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
assertEquals(2, dm2.queryIdx);
assertEquals(6, dm2.trainIdx);
assertEquals(-1, dm2.imgIdx);
Reported by PMD.
Line: 23
public void testDMatchIntIntIntFloat() {
DMatch dm2 = new DMatch(2, 6, -1, 8.0f);
assertEquals(2, dm2.queryIdx);
assertEquals(6, dm2.trainIdx);
assertEquals(-1, dm2.imgIdx);
assertEquals(8.0f, dm2.distance);
}
Reported by PMD.
samples/java/tutorial_code/features2D/feature_flann_matcher/SURFFLANNMatchingDemo.java
17 issues
Line: 24
Mat img1 = Imgcodecs.imread(filename1, Imgcodecs.IMREAD_GRAYSCALE);
Mat img2 = Imgcodecs.imread(filename2, Imgcodecs.IMREAD_GRAYSCALE);
if (img1.empty() || img2.empty()) {
System.err.println("Cannot read images!");
System.exit(0);
}
//-- Step 1: Detect the keypoints using SURF Detector, compute the descriptors
double hessianThreshold = 400;
Reported by PMD.
Line: 23
String filename2 = args.length > 1 ? args[1] : "../data/box_in_scene.png";
Mat img1 = Imgcodecs.imread(filename1, Imgcodecs.IMREAD_GRAYSCALE);
Mat img2 = Imgcodecs.imread(filename2, Imgcodecs.IMREAD_GRAYSCALE);
if (img1.empty() || img2.empty()) {
System.err.println("Cannot read images!");
System.exit(0);
}
//-- Step 1: Detect the keypoints using SURF Detector, compute the descriptors
Reported by PMD.
Line: 23
String filename2 = args.length > 1 ? args[1] : "../data/box_in_scene.png";
Mat img1 = Imgcodecs.imread(filename1, Imgcodecs.IMREAD_GRAYSCALE);
Mat img2 = Imgcodecs.imread(filename2, Imgcodecs.IMREAD_GRAYSCALE);
if (img1.empty() || img2.empty()) {
System.err.println("Cannot read images!");
System.exit(0);
}
//-- Step 1: Detect the keypoints using SURF Detector, compute the descriptors
Reported by PMD.
Line: 25
Mat img2 = Imgcodecs.imread(filename2, Imgcodecs.IMREAD_GRAYSCALE);
if (img1.empty() || img2.empty()) {
System.err.println("Cannot read images!");
System.exit(0);
}
//-- Step 1: Detect the keypoints using SURF Detector, compute the descriptors
double hessianThreshold = 400;
int nOctaves = 4, nOctaveLayers = 3;
Reported by PMD.
Line: 42
// Since SURF is a floating-point descriptor NORM_L2 is used
DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED);
List<MatOfDMatch> knnMatches = new ArrayList<>();
matcher.knnMatch(descriptors1, descriptors2, knnMatches, 2);
//-- Filter matches using the Lowe's ratio test
float ratioThresh = 0.7f;
List<DMatch> listOfGoodMatches = new ArrayList<>();
for (int i = 0; i < knnMatches.size(); i++) {
Reported by PMD.
Line: 47
//-- Filter matches using the Lowe's ratio test
float ratioThresh = 0.7f;
List<DMatch> listOfGoodMatches = new ArrayList<>();
for (int i = 0; i < knnMatches.size(); i++) {
if (knnMatches.get(i).rows() > 1) {
DMatch[] matches = knnMatches.get(i).toArray();
if (matches[0].distance < ratioThresh * matches[1].distance) {
listOfGoodMatches.add(matches[0]);
}
Reported by PMD.
Line: 48
float ratioThresh = 0.7f;
List<DMatch> listOfGoodMatches = new ArrayList<>();
for (int i = 0; i < knnMatches.size(); i++) {
if (knnMatches.get(i).rows() > 1) {
DMatch[] matches = knnMatches.get(i).toArray();
if (matches[0].distance < ratioThresh * matches[1].distance) {
listOfGoodMatches.add(matches[0]);
}
}
Reported by PMD.
Line: 48
float ratioThresh = 0.7f;
List<DMatch> listOfGoodMatches = new ArrayList<>();
for (int i = 0; i < knnMatches.size(); i++) {
if (knnMatches.get(i).rows() > 1) {
DMatch[] matches = knnMatches.get(i).toArray();
if (matches[0].distance < ratioThresh * matches[1].distance) {
listOfGoodMatches.add(matches[0]);
}
}
Reported by PMD.
Line: 49
List<DMatch> listOfGoodMatches = new ArrayList<>();
for (int i = 0; i < knnMatches.size(); i++) {
if (knnMatches.get(i).rows() > 1) {
DMatch[] matches = knnMatches.get(i).toArray();
if (matches[0].distance < ratioThresh * matches[1].distance) {
listOfGoodMatches.add(matches[0]);
}
}
}
Reported by PMD.
Line: 67
HighGui.imshow("Good Matches", imgMatches);
HighGui.waitKey(0);
System.exit(0);
}
}
public class SURFFLANNMatchingDemo {
public static void main(String[] args) {
Reported by PMD.
modules/python/test/test_cuda.py
17 issues
Line: 11
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import os
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
Reported by Pylint.
Line: 12
Column: 1
import numpy as np
import cv2 as cv
import os
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
def setUp(self):
Reported by Pylint.
Line: 14
Column: 1
import cv2 as cv
import os
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
def setUp(self):
super(cuda_test, self).setUp()
if not cv.cuda.getCudaEnabledDeviceCount():
Reported by Pylint.
Line: 12
Column: 1
import numpy as np
import cv2 as cv
import os
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
def setUp(self):
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
def setUp(self):
super(cuda_test, self).setUp()
if not cv.cuda.getCudaEnabledDeviceCount():
self.skipTest("No CUDA-capable device is detected")
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests, unittest
class cuda_test(NewOpenCVTests):
def setUp(self):
super(cuda_test, self).setUp()
if not cv.cuda.getCudaEnabledDeviceCount():
self.skipTest("No CUDA-capable device is detected")
Reported by Pylint.
Line: 18
Column: 9
class cuda_test(NewOpenCVTests):
def setUp(self):
super(cuda_test, self).setUp()
if not cv.cuda.getCudaEnabledDeviceCount():
self.skipTest("No CUDA-capable device is detected")
def test_cuda_upload_download(self):
npMat = (np.random.random((128, 128, 3)) * 255).astype(np.uint8)
Reported by Pylint.
Line: 22
Column: 5
if not cv.cuda.getCudaEnabledDeviceCount():
self.skipTest("No CUDA-capable device is detected")
def test_cuda_upload_download(self):
npMat = (np.random.random((128, 128, 3)) * 255).astype(np.uint8)
cuMat = cv.cuda_GpuMat()
cuMat.upload(npMat)
self.assertTrue(np.allclose(cuMat.download(), npMat))
Reported by Pylint.
Line: 23
Column: 9
self.skipTest("No CUDA-capable device is detected")
def test_cuda_upload_download(self):
npMat = (np.random.random((128, 128, 3)) * 255).astype(np.uint8)
cuMat = cv.cuda_GpuMat()
cuMat.upload(npMat)
self.assertTrue(np.allclose(cuMat.download(), npMat))
Reported by Pylint.
Line: 24
Column: 9
def test_cuda_upload_download(self):
npMat = (np.random.random((128, 128, 3)) * 255).astype(np.uint8)
cuMat = cv.cuda_GpuMat()
cuMat.upload(npMat)
self.assertTrue(np.allclose(cuMat.download(), npMat))
def test_cuda_upload_download_stream(self):
Reported by Pylint.
modules/python/test/test_dft.py
17 issues
Line: 10
Column: 1
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
import sys
from tests_common import NewOpenCVTests
Reported by Pylint.
Line: 12
Column: 1
import cv2 as cv
import numpy as np
import sys
from tests_common import NewOpenCVTests
class dft_test(NewOpenCVTests):
def test_dft(self):
Reported by Pylint.
Line: 12
Column: 1
import cv2 as cv
import numpy as np
import sys
from tests_common import NewOpenCVTests
class dft_test(NewOpenCVTests):
def test_dft(self):
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests
class dft_test(NewOpenCVTests):
def test_dft(self):
img = self.get_sample('samples/data/rubberwhale1.png', 0)
eps = 0.001
Reported by Pylint.
Line: 16
Column: 1
from tests_common import NewOpenCVTests
class dft_test(NewOpenCVTests):
def test_dft(self):
img = self.get_sample('samples/data/rubberwhale1.png', 0)
eps = 0.001
Reported by Pylint.
Line: 17
Column: 5
from tests_common import NewOpenCVTests
class dft_test(NewOpenCVTests):
def test_dft(self):
img = self.get_sample('samples/data/rubberwhale1.png', 0)
eps = 0.001
#test direct transform
Reported by Pylint.
Line: 23
Column: 9
eps = 0.001
#test direct transform
refDft = np.fft.fft2(img)
refDftShift = np.fft.fftshift(refDft)
refMagnitide = np.log(1.0 + np.abs(refDftShift))
testDft = cv.dft(np.float32(img),flags = cv.DFT_COMPLEX_OUTPUT)
testDftShift = np.fft.fftshift(testDft)
Reported by Pylint.
Line: 24
Column: 9
#test direct transform
refDft = np.fft.fft2(img)
refDftShift = np.fft.fftshift(refDft)
refMagnitide = np.log(1.0 + np.abs(refDftShift))
testDft = cv.dft(np.float32(img),flags = cv.DFT_COMPLEX_OUTPUT)
testDftShift = np.fft.fftshift(testDft)
testMagnitude = np.log(1.0 + cv.magnitude(testDftShift[:,:,0], testDftShift[:,:,1]))
Reported by Pylint.
Line: 25
Column: 9
#test direct transform
refDft = np.fft.fft2(img)
refDftShift = np.fft.fftshift(refDft)
refMagnitide = np.log(1.0 + np.abs(refDftShift))
testDft = cv.dft(np.float32(img),flags = cv.DFT_COMPLEX_OUTPUT)
testDftShift = np.fft.fftshift(testDft)
testMagnitude = np.log(1.0 + cv.magnitude(testDftShift[:,:,0], testDftShift[:,:,1]))
Reported by Pylint.
Line: 27
Column: 9
refDftShift = np.fft.fftshift(refDft)
refMagnitide = np.log(1.0 + np.abs(refDftShift))
testDft = cv.dft(np.float32(img),flags = cv.DFT_COMPLEX_OUTPUT)
testDftShift = np.fft.fftshift(testDft)
testMagnitude = np.log(1.0 + cv.magnitude(testDftShift[:,:,0], testDftShift[:,:,1]))
refMagnitide = cv.normalize(refMagnitide, 0.0, 1.0, cv.NORM_MINMAX)
testMagnitude = cv.normalize(testMagnitude, 0.0, 1.0, cv.NORM_MINMAX)
Reported by Pylint.
samples/java/tutorial_code/ImgProc/morph_lines_detection/Morphology_3.java
17 issues
Line: 18
//! [load_image]
// Check number of arguments
if (args.length == 0){
System.out.println("Not enough parameters!");
System.out.println("Program Arguments: [image_path]");
System.exit(-1);
}
// Load the image
Reported by PMD.
Line: 19
// Check number of arguments
if (args.length == 0){
System.out.println("Not enough parameters!");
System.out.println("Program Arguments: [image_path]");
System.exit(-1);
}
// Load the image
Mat src = Imgcodecs.imread(args[0]);
Reported by PMD.
Line: 28
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image: " + args[0]);
System.exit(-1);
}
// Show source image
HighGui.imshow("src", src);
Reported by PMD.
Line: 13
class Morphology_3Run {
public void run(String[] args) {
//! [load_image]
// Check number of arguments
if (args.length == 0){
System.out.println("Not enough parameters!");
Reported by PMD.
Line: 20
if (args.length == 0){
System.out.println("Not enough parameters!");
System.out.println("Program Arguments: [image_path]");
System.exit(-1);
}
// Load the image
Mat src = Imgcodecs.imread(args[0]);
Reported by PMD.
Line: 27
Mat src = Imgcodecs.imread(args[0]);
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image: " + args[0]);
System.exit(-1);
}
// Show source image
Reported by PMD.
Line: 29
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image: " + args[0]);
System.exit(-1);
}
// Show source image
HighGui.imshow("src", src);
//! [load_image]
Reported by PMD.
Line: 40
// Transform source image to gray if it is not already
Mat gray = new Mat();
if (src.channels() == 3)
{
Imgproc.cvtColor(src, gray, Imgproc.COLOR_BGR2GRAY);
}
else
{
Reported by PMD.
Line: 40
// Transform source image to gray if it is not already
Mat gray = new Mat();
if (src.channels() == 3)
{
Imgproc.cvtColor(src, gray, Imgproc.COLOR_BGR2GRAY);
}
else
{
Reported by PMD.
Line: 71
//! [horiz]
// Specify size on horizontal axis
int horizontal_size = horizontal.cols() / 30;
// Create structure element for extracting horizontal lines through morphology operations
Mat horizontalStructure = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(horizontal_size,1));
// Apply morphology operations
Reported by PMD.
samples/java/tutorial_code/ImgTrans/canny_detector/CannyDetectorDemo.java
17 issues
Line: 40
String imagePath = args.length > 0 ? args[0] : "../data/fruits.jpg";
src = Imgcodecs.imread(imagePath);
if (src.empty()) {
System.out.println("Empty image: " + imagePath);
System.exit(0);
}
// Create and set up the window.
frame = new JFrame("Edge Map (Canny detector demo)");
Reported by PMD.
Line: 28
private static final int RATIO = 3;
private static final int KERNEL_SIZE = 3;
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
Reported by PMD.
Line: 28
private static final int RATIO = 3;
private static final int KERNEL_SIZE = 3;
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
Reported by PMD.
Line: 29
private static final int KERNEL_SIZE = 3;
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 29
private static final int KERNEL_SIZE = 3;
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 30
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 30
private static final Size BLUR_SIZE = new Size(3,3);
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
Reported by PMD.
Line: 31
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
public CannyDetectorDemo(String[] args) {
Reported by PMD.
Line: 31
private int lowThresh = 0;
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
public CannyDetectorDemo(String[] args) {
Reported by PMD.
Line: 32
private Mat src;
private Mat srcBlur = new Mat();
private Mat detectedEdges = new Mat();
private Mat dst = new Mat();
private JFrame frame;
private JLabel imgLabel;
public CannyDetectorDemo(String[] args) {
String imagePath = args.length > 0 ? args[0] : "../data/fruits.jpg";
Reported by PMD.
samples/python/squares.py
17 issues
Line: 18
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: 31
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: 15
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
Reported by Pylint.
Line: 17
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: 18
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: 21
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: 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: 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: 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: 22
Column: 9
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.