The following issues were found
samples/java/tutorial_code/Histograms_Matching/histogram_calculation/CalcHistDemo.java
18 issues
Line: 21
String filename = args.length > 0 ? args[0] : "../data/lena.jpg";
Mat src = Imgcodecs.imread(filename);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load image]
//! [Separate the image in 3 places ( B, G and R )]
Reported by PMD.
Line: 20
//! [Load image]
String filename = args.length > 0 ? args[0] : "../data/lena.jpg";
Mat src = Imgcodecs.imread(filename);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load image]
Reported by PMD.
Line: 22
Mat src = Imgcodecs.imread(filename);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load image]
//! [Separate the image in 3 places ( B, G and R )]
List<Mat> bgrPlanes = new ArrayList<>();
Reported by PMD.
Line: 73
rHist.get(0, 0, rHistData);
for( int i = 1; i < histSize; i++ ) {
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
Reported by PMD.
Line: 74
for( int i = 1; i < histSize; i++ ) {
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
Reported by PMD.
Line: 74
for( int i = 1; i < histSize; i++ ) {
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
Reported by PMD.
Line: 75
for( int i = 1; i < histSize; i++ ) {
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
//! [Draw for each channel]
Reported by PMD.
Line: 76
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
//! [Draw for each channel]
Reported by PMD.
Line: 76
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(bHistData[i - 1])),
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
//! [Draw for each channel]
Reported by PMD.
Line: 77
new Point(binW * (i), histH - Math.round(bHistData[i])), new Scalar(255, 0, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(gHistData[i - 1])),
new Point(binW * (i), histH - Math.round(gHistData[i])), new Scalar(0, 255, 0), 2);
Imgproc.line(histImage, new Point(binW * (i - 1), histH - Math.round(rHistData[i - 1])),
new Point(binW * (i), histH - Math.round(rHistData[i])), new Scalar(0, 0, 255), 2);
}
//! [Draw for each channel]
//! [Display]
Reported by PMD.
modules/features2d/misc/java/test/SIFTDescriptorExtractorTest.java
17 issues
Line: 17
public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
Feature2D extractor;
KeyPoint keypoint;
int matSize;
Mat truth;
private Mat getTestImg() {
Reported by PMD.
Line: 18
public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
Feature2D extractor;
KeyPoint keypoint;
int matSize;
Mat truth;
private Mat getTestImg() {
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Reported by PMD.
Line: 19
Feature2D extractor;
KeyPoint keypoint;
int matSize;
Mat truth;
private Mat getTestImg() {
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
Reported by PMD.
Line: 20
Feature2D extractor;
KeyPoint keypoint;
int matSize;
Mat truth;
private Mat getTestImg() {
Mat cross = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Imgproc.line(cross, new Point(20, matSize / 2), new Point(matSize - 21, matSize / 2), new Scalar(100), 2);
Imgproc.line(cross, new Point(matSize / 2, 20), new Point(matSize / 2, matSize - 21), new Scalar(100), 2);
Reported by PMD.
Line: 30
return cross;
}
@Override
protected void setUp() throws Exception {
super.setUp();
extractor = SIFT.create();
keypoint = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1);
matSize = 100;
Reported by PMD.
Line: 37
keypoint = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1);
matSize = 100;
truth = new Mat(1, 128, CvType.CV_32FC1) {
{
put(0, 0,
0, 0, 0, 1, 3, 0, 0, 0, 15, 23, 22, 20, 24, 2, 0, 0, 7, 8, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 16, 13, 2, 0, 0, 117,
86, 79, 68, 117, 42, 5, 5, 79, 60, 117, 25, 9, 2, 28, 19, 11, 13,
20, 2, 0, 0, 5, 8, 0, 0, 76, 58, 34, 31, 97, 16, 95, 49, 117, 92,
Reported by PMD.
Line: 51
};
}
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
MatOfKeyPoint keypoints = new MatOfKeyPoint(keypoint);
Reported by PMD.
Line: 55
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
MatOfKeyPoint keypoints = new MatOfKeyPoint(keypoint);
Mat img = getTestImg();
Mat descriptors = new Mat();
extractor.compute(img, keypoints, descriptors);
Reported by PMD.
Line: 65
assertMatEqual(truth, descriptors, EPS);
}
public void testCreate() {
assertNotNull(extractor);
}
public void testDescriptorSize() {
assertEquals(128, extractor.descriptorSize());
Reported by PMD.
Line: 69
assertNotNull(extractor);
}
public void testDescriptorSize() {
assertEquals(128, extractor.descriptorSize());
}
public void testDescriptorType() {
assertEquals(CvType.CV_32F, extractor.descriptorType());
Reported by PMD.
samples/python/browse.py
17 issues
Line: 24
Column: 1
xrange = range
import numpy as np
import cv2 as cv
# built-in modules
import sys
def main():
Reported by Pylint.
Line: 27
Column: 1
import cv2 as cv
# built-in modules
import sys
def main():
if len(sys.argv) > 1:
fn = cv.samples.findFile(sys.argv[1])
print('loading %s ...' % fn)
Reported by Pylint.
Line: 51
Column: 37
for _i in xrange(3):
small = cv.pyrDown(small)
def onmouse(event, x, y, flags, param):
h, _w = img.shape[:2]
h1, _w1 = small.shape[:2]
x, y = 1.0*x*h/h1, 1.0*y*h/h1
zoom = cv.getRectSubPix(img, (800, 600), (x+0.5, y+0.5))
cv.imshow('zoom', zoom)
Reported by Pylint.
Line: 51
Column: 30
for _i in xrange(3):
small = cv.pyrDown(small)
def onmouse(event, x, y, flags, param):
h, _w = img.shape[:2]
h1, _w1 = small.shape[:2]
x, y = 1.0*x*h/h1, 1.0*y*h/h1
zoom = cv.getRectSubPix(img, (800, 600), (x+0.5, y+0.5))
cv.imshow('zoom', zoom)
Reported by Pylint.
Line: 51
Column: 17
for _i in xrange(3):
small = cv.pyrDown(small)
def onmouse(event, x, y, flags, param):
h, _w = img.shape[:2]
h1, _w1 = small.shape[:2]
x, y = 1.0*x*h/h1, 1.0*y*h/h1
zoom = cv.getRectSubPix(img, (800, 600), (x+0.5, y+0.5))
cv.imshow('zoom', zoom)
Reported by Pylint.
Line: 21
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
# built-in modules
Reported by Pylint.
Line: 23
Column: 1
if PY3:
xrange = range
import numpy as np
import cv2 as cv
# built-in modules
import sys
Reported by Pylint.
Line: 24
Column: 1
xrange = range
import numpy as np
import cv2 as cv
# built-in modules
import sys
def main():
Reported by Pylint.
Line: 27
Column: 1
import cv2 as cv
# built-in modules
import sys
def main():
if len(sys.argv) > 1:
fn = cv.samples.findFile(sys.argv[1])
print('loading %s ...' % fn)
Reported by Pylint.
Line: 27
Column: 1
import cv2 as cv
# built-in modules
import sys
def main():
if len(sys.argv) > 1:
fn = cv.samples.findFile(sys.argv[1])
print('loading %s ...' % fn)
Reported by Pylint.
samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java
17 issues
Line: 42
String filename = args.length > 0 ? args[0] : "../data/HappyFish.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: 29
import org.opencv.imgproc.Imgproc;
class FindContours {
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: 29
import org.opencv.imgproc.Imgproc;
class FindContours {
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: 30
class FindContours {
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: 30
class FindContours {
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: 31
class FindContours {
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: 31
class FindContours {
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
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 FindContours(String[] args) {
Reported by PMD.
Line: 34
private JLabel imgSrcLabel;
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
public FindContours(String[] args) {
/// Load source image
String filename = args.length > 0 ? args[0] : "../data/HappyFish.jpg";
Reported by PMD.
Line: 35
private JLabel imgContoursLabel;
private static final int MAX_THRESHOLD = 255;
private int threshold = 100;
private Random rng = new Random(12345);
public FindContours(String[] args) {
/// Load source image
String filename = args.length > 0 ? args[0] : "../data/HappyFish.jpg";
Mat src = Imgcodecs.imread(filename);
Reported by PMD.
modules/videoio/misc/java/test/VideoCaptureTest.java
17 issues
Line: 13
public class VideoCaptureTest extends OpenCVTestCase {
private VideoCapture capture;
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
Reported by PMD.
Line: 14
public class VideoCaptureTest extends OpenCVTestCase {
private VideoCapture capture;
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 14
public class VideoCaptureTest extends OpenCVTestCase {
private VideoCapture capture;
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 14
public class VideoCaptureTest extends OpenCVTestCase {
private VideoCapture capture;
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 15
private VideoCapture capture;
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 17
private boolean isOpened;
private boolean isSucceed;
@Override
protected void setUp() throws Exception {
super.setUp();
capture = null;
isTestCaseEnabled = false;
Reported by PMD.
Line: 21
protected void setUp() throws Exception {
super.setUp();
capture = null;
isTestCaseEnabled = false;
isSucceed = false;
isOpened = false;
}
Reported by PMD.
Line: 27
isOpened = false;
}
public void testGrab() {
capture = new VideoCapture();
isSucceed = capture.grab();
assertFalse(isSucceed);
}
Reported by PMD.
Line: 33
assertFalse(isSucceed);
}
public void testIsOpened() {
capture = new VideoCapture();
assertFalse(capture.isOpened());
}
public void testDefaultConstructor() {
Reported by PMD.
Line: 38
assertFalse(capture.isOpened());
}
public void testDefaultConstructor() {
capture = new VideoCapture();
assertNotNull(capture);
assertFalse(capture.isOpened());
}
Reported by PMD.
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.
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/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.
samples/java/tutorial_code/video/meanshift/CamshiftDemo.java
17 issues
Line: 14
String filename = args[0];
VideoCapture capture = new VideoCapture(filename);
if (!capture.isOpened()) {
System.out.println("Unable to open file!");
System.exit(-1);
}
Mat frame = new Mat(), hsv_roi = new Mat(), mask = new Mat(), roi;
Reported by PMD.
Line: 15
VideoCapture capture = new VideoCapture(filename);
if (!capture.isOpened()) {
System.out.println("Unable to open file!");
System.exit(-1);
}
Mat frame = new Mat(), hsv_roi = new Mat(), mask = new Mat(), roi;
// take the first frame of the video
Reported by PMD.
Line: 42
TermCriteria term_crit = new TermCriteria(TermCriteria.EPS | TermCriteria.COUNT, 10, 1);
while (true) {
Mat hsv = new Mat() , dst = new Mat();
capture.read(frame);
if (frame.empty()) {
break;
}
Imgproc.cvtColor(frame, hsv, Imgproc.COLOR_BGR2HSV);
Reported by PMD.
Line: 42
TermCriteria term_crit = new TermCriteria(TermCriteria.EPS | TermCriteria.COUNT, 10, 1);
while (true) {
Mat hsv = new Mat() , dst = new Mat();
capture.read(frame);
if (frame.empty()) {
break;
}
Imgproc.cvtColor(frame, hsv, Imgproc.COLOR_BGR2HSV);
Reported by PMD.
Line: 54
RotatedRect rot_rect = Video.CamShift(dst, track_window, term_crit);
// Draw it on image
Point[] points = new Point[4];
rot_rect.points(points);
for (int i = 0; i < 4 ;i++) {
Imgproc.line(frame, points[i], points[(i+1)%4], new Scalar(255, 0, 0),2);
}
Reported by PMD.
Line: 55
// Draw it on image
Point[] points = new Point[4];
rot_rect.points(points);
for (int i = 0; i < 4 ;i++) {
Imgproc.line(frame, points[i], points[(i+1)%4], new Scalar(255, 0, 0),2);
}
HighGui.imshow("img2", frame);
Reported by PMD.
Line: 57
Point[] points = new Point[4];
rot_rect.points(points);
for (int i = 0; i < 4 ;i++) {
Imgproc.line(frame, points[i], points[(i+1)%4], new Scalar(255, 0, 0),2);
}
HighGui.imshow("img2", frame);
int keyboard = HighGui.waitKey(30);
if (keyboard == 'q'|| keyboard == 27) {
Reported by PMD.
Line: 66
break;
}
}
System.exit(0);
}
}
public class CamshiftDemo {
public static void main(String[] args) {
Reported by PMD.
Line: 70
}
}
public class CamshiftDemo {
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
new Camshift().run(args);
}
}
Reported by PMD.
Line: 2
import java.util.Arrays;
import org.opencv.core.*;
import org.opencv.highgui.HighGui;
import org.opencv.imgproc.Imgproc;
import org.opencv.video.Video;
import org.opencv.videoio.VideoCapture;
class Camshift {
Reported by PMD.
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.