The following issues were found
samples/java/tutorial_code/ImgTrans/Filter2D/Filter2D_Demo.java
20 issues
Line: 33
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image!");
System.out.println("Program Arguments: [image_name -- default ../data/lena.jpg] \n");
System.exit(-1);
}
//! [load]
Reported by PMD.
Line: 34
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image!");
System.out.println("Program Arguments: [image_name -- default ../data/lena.jpg] \n");
System.exit(-1);
}
//! [load]
//! [init_arguments]
Reported by PMD.
Line: 32
src = Imgcodecs.imread(imageName, Imgcodecs.IMREAD_COLOR);
// Check if image is loaded fine
if( src.empty() ) {
System.out.println("Error opening image!");
System.out.println("Program Arguments: [image_name -- default ../data/lena.jpg] \n");
System.exit(-1);
}
//! [load]
Reported by PMD.
Line: 35
if( src.empty() ) {
System.out.println("Error opening image!");
System.out.println("Program Arguments: [image_name -- default ../data/lena.jpg] \n");
System.exit(-1);
}
//! [load]
//! [init_arguments]
// Initialize arguments for the filter
Reported by PMD.
Line: 54
// Update kernel size for a normalized box filter
kernel_size = 3 + 2*( ind%5 );
Mat ones = Mat.ones( kernel_size, kernel_size, CvType.CV_32F );
Core.multiply(ones, new Scalar(1/(double)(kernel_size*kernel_size)), kernel);
//! [update_kernel]
//! [apply_filter]
// Apply filter
Imgproc.filter2D(src, dst, ddepth , kernel, anchor, delta, Core.BORDER_DEFAULT );
Reported by PMD.
Line: 65
int c = HighGui.waitKey(500);
// Press 'ESC' to exit the program
if( c == 27 )
{ break; }
ind++;
}
Reported by PMD.
Line: 71
ind++;
}
System.exit(0);
}
}
public class Filter2D_Demo {
public static void main(String[] args) {
Reported by PMD.
Line: 75
}
}
public class Filter2D_Demo {
public static void main(String[] args) {
// Load the native library.
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
new Filter2D_DemoRun().run(args);
}
Reported by PMD.
Line: 6
* @brief Sample code that shows how to implement your own linear filters by using filter2D function
*/
import org.opencv.core.*;
import org.opencv.core.Point;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
Reported by PMD.
Line: 14
class Filter2D_DemoRun {
public void run(String[] args) {
// Declare variables
Mat src, dst = new Mat();
Mat kernel = new Mat();
Point anchor;
Reported by PMD.
modules/ts/misc/run_long.py
20 issues
Line: 75
Column: 26
]
def longTestFilter(data, module=None):
res = ['*', '-'] + [v for m, v, _time in data if module is None or m == module]
return '--gtest_filter={}'.format(':'.join(res))
# Parse one xml file, filter out tests which took less than 'timeLimit' seconds
Reported by Pylint.
Line: 76
Column: 5
def longTestFilter(data, module=None):
res = ['*', '-'] + [v for m, v, _time in data if module is None or m == module]
return '--gtest_filter={}'.format(':'.join(res))
# Parse one xml file, filter out tests which took less than 'timeLimit' seconds
# Returns tuple: ( <module_name>, [ (<module_name>, <test_name>, <test_time>), ... ] )
Reported by Pylint.
Line: 83
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b313-b320-xml-bad-elementtree
# Parse one xml file, filter out tests which took less than 'timeLimit' seconds
# Returns tuple: ( <module_name>, [ (<module_name>, <test_name>, <test_time>), ... ] )
def parseOneFile(filename, timeLimit):
tree = ET.parse(filename)
root = tree.getroot()
def guess(s, delims):
for delim in delims:
tmp = s.partition(delim)
Reported by Bandit.
Line: 92
Column: 5
if len(tmp[1]) != 0:
return tmp[0]
return None
module = guess(filename, ['_posix_', '_nt_', '__']) or root.get('cv_module_name')
if not module:
return (None, None)
res = []
for elem in root.findall('.//testcase'):
key = '{}.{}'.format(elem.get('classname'), elem.get('name'))
Reported by Pylint.
Line: 95
Column: 5
module = guess(filename, ['_posix_', '_nt_', '__']) or root.get('cv_module_name')
if not module:
return (None, None)
res = []
for elem in root.findall('.//testcase'):
key = '{}.{}'.format(elem.get('classname'), elem.get('name'))
val = elem.get('time')
if float(val) >= timeLimit:
res.append((module, key, float(val)))
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
from __future__ import print_function
import xml.etree.ElementTree as ET
from glob import glob
from pprint import PrettyPrinter as PP
LONG_TESTS_DEBUG_VALGRIND = [
('calib3d', 'Calib3d_InitUndistortRectifyMap.accuracy', 2017.22),
('dnn', 'Reproducibility*', 1000), # large DNN models
Reported by Pylint.
Line: 3
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b405-import-xml-etree
#!/usr/bin/env python
from __future__ import print_function
import xml.etree.ElementTree as ET
from glob import glob
from pprint import PrettyPrinter as PP
LONG_TESTS_DEBUG_VALGRIND = [
('calib3d', 'Calib3d_InitUndistortRectifyMap.accuracy', 2017.22),
('dnn', 'Reproducibility*', 1000), # large DNN models
Reported by Bandit.
Line: 21
Column: 1
('dnn', '*eccv16*', 1000), # very large DNN models
('dnn', '*OpenPose*', 1000), # very large DNN models
('dnn', '*SSD/*', 1000), # very large DNN models
('gapi', 'Fluid.MemoryConsumptionDoesNotGrowOnReshape', 1000000), # test doesn't work properly under valgrind
('face', 'CV_Face_FacemarkLBF.test_workflow', 10000.0), # >40min on i7
('features2d', 'Features2d/DescriptorImage.no_crash/3', 1000),
('features2d', 'Features2d/DescriptorImage.no_crash/4', 1000),
('features2d', 'Features2d/DescriptorImage.no_crash/5', 1000),
('features2d', 'Features2d/DescriptorImage.no_crash/6', 1000),
Reported by Pylint.
Line: 49
Column: 1
('tracking', '*DistanceAndOverlap*/2', 1000.0), # faceocc2
('videoio', 'videoio/videoio_ffmpeg.write_big*', 1000),
('videoio', 'videoio_ffmpeg.parallel', 1000),
('videoio', '*videocapture_acceleration*', 1000), # valgrind can't track HW buffers: Conditional jump or move depends on uninitialised value(s)
('videoio', '*videowriter_acceleration*', 1000), # valgrind crash: set_mempolicy: Operation not permitted
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_BoostDesc_LBGM.regression', 1124.51),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG120.regression', 2198.1),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG48.regression', 1958.52),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG64.regression', 2113.12),
Reported by Pylint.
Line: 50
Column: 1
('videoio', 'videoio/videoio_ffmpeg.write_big*', 1000),
('videoio', 'videoio_ffmpeg.parallel', 1000),
('videoio', '*videocapture_acceleration*', 1000), # valgrind can't track HW buffers: Conditional jump or move depends on uninitialised value(s)
('videoio', '*videowriter_acceleration*', 1000), # valgrind crash: set_mempolicy: Operation not permitted
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_BoostDesc_LBGM.regression', 1124.51),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG120.regression', 2198.1),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG48.regression', 1958.52),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG64.regression', 2113.12),
('xfeatures2d', 'Features2d_RotationInvariance_Descriptor_VGG80.regression', 2167.16),
Reported by Pylint.
samples/python/facedetect.py
20 issues
Line: 14
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
# local modules
from video import create_capture
from common import clock, draw_str
Reported by Pylint.
Line: 13
Column: 1
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
# local modules
from video import create_capture
from common import clock, draw_str
Reported by Pylint.
Line: 39
Column: 5
args, video_src = getopt.getopt(sys.argv[1:], '', ['cascade=', 'nested-cascade='])
try:
video_src = video_src[0]
except:
video_src = 0
args = dict(args)
cascade_fn = args.get('--cascade', "data/haarcascades/haarcascade_frontalface_alt.xml")
nested_fn = args.get('--nested-cascade', "data/haarcascades/haarcascade_eye.xml")
Reported by Pylint.
Line: 21
Column: 1
from common import clock, draw_str
def detect(img, cascade):
rects = cascade.detectMultiScale(img, scaleFactor=1.3, minNeighbors=4, minSize=(30, 30),
flags=cv.CASCADE_SCALE_IMAGE)
if len(rects) == 0:
return []
rects[:,2:] += rects[:,:2]
Reported by Pylint.
Line: 29
Column: 1
rects[:,2:] += rects[:,:2]
return rects
def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
Reported by Pylint.
Line: 30
Column: 13
return rects
def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
Reported by Pylint.
Line: 30
Column: 17
return rects
def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
Reported by Pylint.
Line: 30
Column: 21
return rects
def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
Reported by Pylint.
Line: 30
Column: 9
return rects
def draw_rects(img, rects, color):
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
Reported by Pylint.
Line: 33
Column: 1
for x1, y1, x2, y2 in rects:
cv.rectangle(img, (x1, y1), (x2, y2), color, 2)
def main():
import sys, getopt
args, video_src = getopt.getopt(sys.argv[1:], '', ['cascade=', 'nested-cascade='])
try:
video_src = video_src[0]
Reported by Pylint.
samples/python/coherence.py
20 issues
Line: 21
Column: 1
xrange = range
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
h, w = img.shape[:2]
for i in xrange(iter_n):
Reported by Pylint.
Line: 50
Column: 5
def main():
import sys
try:
fn = sys.argv[1]
except:
fn = 'baboon.jpg'
Reported by Pylint.
Line: 50
Column: 5
def main():
import sys
try:
fn = sys.argv[1]
except:
fn = 'baboon.jpg'
Reported by Pylint.
Line: 53
Column: 5
import sys
try:
fn = sys.argv[1]
except:
fn = 'baboon.jpg'
src = cv.imread(cv.samples.findFile(fn))
def nothing(*argv):
Reported by Pylint.
Line: 58
Column: 1
src = cv.imread(cv.samples.findFile(fn))
def nothing(*argv):
pass
def update():
sigma = cv.getTrackbarPos('sigma', 'control')*2+1
str_sigma = cv.getTrackbarPos('str_sigma', 'control')*2+1
Reported by Pylint.
Line: 18
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
Reported by Pylint.
Line: 20
Column: 1
if PY3:
xrange = range
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
h, w = img.shape[:2]
Reported by Pylint.
Line: 21
Column: 1
xrange = range
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
h, w = img.shape[:2]
for i in xrange(iter_n):
Reported by Pylint.
Line: 23
Column: 1
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
h, w = img.shape[:2]
for i in xrange(iter_n):
print(i)
Reported by Pylint.
Line: 23
Column: 1
import numpy as np
import cv2 as cv
def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
h, w = img.shape[:2]
for i in xrange(iter_n):
print(i)
Reported by Pylint.
modules/python/test/test_grabcut.py
20 issues
Line: 12
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
from tests_common import NewOpenCVTests
class grabcut_test(NewOpenCVTests):
Reported by Pylint.
Line: 13
Column: 1
import numpy as np
import cv2 as cv
import sys
from tests_common import NewOpenCVTests
class grabcut_test(NewOpenCVTests):
Reported by Pylint.
Line: 39
Column: 13
exp_mask2 = self.get_sample("cv/grabcut/exp_mask2py.png", 0)
if img is None:
self.assertTrue(False, 'Missing test data')
rect = (24, 126, 459, 168)
mask = np.zeros(img.shape[:2], dtype = np.uint8)
bgdModel = np.zeros((1,65),np.float64)
fgdModel = np.zeros((1,65),np.float64)
Reported by Pylint.
Line: 13
Column: 1
import numpy as np
import cv2 as cv
import sys
from tests_common import NewOpenCVTests
class grabcut_test(NewOpenCVTests):
Reported by Pylint.
Line: 17
Column: 1
from tests_common import NewOpenCVTests
class grabcut_test(NewOpenCVTests):
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
Reported by Pylint.
Line: 17
Column: 1
from tests_common import NewOpenCVTests
class grabcut_test(NewOpenCVTests):
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
Reported by Pylint.
Line: 19
Column: 5
class grabcut_test(NewOpenCVTests):
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
nonIntersectArea = np.count_nonzero(mask != exp)
curRatio = float(nonIntersectArea) / expArea
Reported by Pylint.
Line: 19
Column: 5
class grabcut_test(NewOpenCVTests):
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
nonIntersectArea = np.count_nonzero(mask != exp)
curRatio = float(nonIntersectArea) / expArea
Reported by Pylint.
Line: 21
Column: 9
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
nonIntersectArea = np.count_nonzero(mask != exp)
curRatio = float(nonIntersectArea) / expArea
return curRatio < maxDiffRatio
Reported by Pylint.
Line: 22
Column: 9
def verify(self, mask, exp):
maxDiffRatio = 0.02
expArea = np.count_nonzero(exp)
nonIntersectArea = np.count_nonzero(mask != exp)
curRatio = float(nonIntersectArea) / expArea
return curRatio < maxDiffRatio
def scaleMask(self, mask):
Reported by Pylint.
samples/java/tutorial_code/features2D/Homography/PanoramaStitchingRotatingCamera.java
20 issues
Line: 58
Core.gemm(tmp, cameraMatrix.inv(), 1, new Mat(), 0, H);
Scalar s = new Scalar(H.get(2, 2)[0]);
Core.divide(H, s, H);
System.out.println(H.dump());
//! [compute-homography]
//! [stitch]
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Reported by PMD.
Line: 14
class PanoramaStitchingRotatingCameraRun {
void basicPanoramaStitching (String[] args) {
String img1path = args[0], img2path = args[1];
Mat img1 = new Mat(), img2 = new Mat();
img1 = Imgcodecs.imread(img1path);
img2 = Imgcodecs.imread(img2path);
//! [camera-pose-from-Blender-at-location-1]
Mat c1Mo = new Mat( 4, 4, CvType.CV_64FC1 );
Reported by PMD.
Line: 14
class PanoramaStitchingRotatingCameraRun {
void basicPanoramaStitching (String[] args) {
String img1path = args[0], img2path = args[1];
Mat img1 = new Mat(), img2 = new Mat();
img1 = Imgcodecs.imread(img1path);
img2 = Imgcodecs.imread(img2path);
//! [camera-pose-from-Blender-at-location-1]
Mat c1Mo = new Mat( 4, 4, CvType.CV_64FC1 );
Reported by PMD.
Line: 63
//! [stitch]
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Reported by PMD.
Line: 63
//! [stitch]
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Reported by PMD.
Line: 64
//! [stitch]
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Mat img_compare = new Mat();
Reported by PMD.
Line: 65
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Mat img_compare = new Mat();
Mat img_space = Mat.zeros(new Size(50, img1.rows()), CvType.CV_8UC3);
Reported by PMD.
Line: 65
Mat img_stitch = new Mat();
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Mat img_compare = new Mat();
Mat img_space = Mat.zeros(new Size(50, img1.rows()), CvType.CV_8UC3);
Reported by PMD.
Line: 66
Imgproc.warpPerspective(img2, img_stitch, H, new Size(img2.cols()*2, img2.rows()) );
Mat half = new Mat();
half = new Mat(img_stitch, new Rect(0, 0, img1.cols(), img1.rows()));
img1.copyTo(half);
//! [stitch]
Mat img_compare = new Mat();
Mat img_space = Mat.zeros(new Size(50, img1.rows()), CvType.CV_8UC3);
List<Mat>list = new ArrayList<>();
Reported by PMD.
Line: 70
//! [stitch]
Mat img_compare = new Mat();
Mat img_space = Mat.zeros(new Size(50, img1.rows()), CvType.CV_8UC3);
List<Mat>list = new ArrayList<>();
list.add(img1);
list.add(img_space);
list.add(img2);
Core.hconcat(list, img_compare);
Reported by PMD.
doc/tools/scan_tutorials.py
20 issues
Line: 18
Column: 34
self.children = [] # ordered titles
self.prev = None
self.next = None
with open(path, "rt") as f:
self.parse(f)
def parse(self, f):
rx_title = re.compile(r"\{#(\w+)\}")
rx_subpage = re.compile(r"@subpage\s+(\w+)")
Reported by Pylint.
Line: 21
Column: 21
with open(path, "rt") as f:
self.parse(f)
def parse(self, f):
rx_title = re.compile(r"\{#(\w+)\}")
rx_subpage = re.compile(r"@subpage\s+(\w+)")
rx_prev = re.compile(r"@prev_tutorial\{(\w+)\}")
rx_next = re.compile(r"@next_tutorial\{(\w+)\}")
for line in f:
Reported by Pylint.
Line: 48
Column: 9
continue
def verify_prev_next(self, storage):
res = True
if self.title is None:
print("[W] No title")
res = False
Reported by Pylint.
Line: 62
Column: 9
res = False
prev = c.title
next = None
for one in reversed(self.children):
c = storage[one]
if c.next is not None and c.next != next:
print("[W] Wrong next_tutorial: expected {} / actual {}".format(c.next, next))
res = False
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
from pathlib import Path
import re
# Tasks
# 1. Find all tutorials
# 2. Generate tree (@subpage)
# 3. Check prev/next nodes
Reported by Pylint.
Line: 11
Column: 1
# 2. Generate tree (@subpage)
# 3. Check prev/next nodes
class Tutorial(object):
def __init__(self, path):
self.path = path
self.title = None # doxygen title
self.children = [] # ordered titles
self.prev = None
Reported by Pylint.
Line: 11
Column: 1
# 2. Generate tree (@subpage)
# 3. Check prev/next nodes
class Tutorial(object):
def __init__(self, path):
self.path = path
self.title = None # doxygen title
self.children = [] # ordered titles
self.prev = None
Reported by Pylint.
Line: 18
Column: 34
self.children = [] # ordered titles
self.prev = None
self.next = None
with open(path, "rt") as f:
self.parse(f)
def parse(self, f):
rx_title = re.compile(r"\{#(\w+)\}")
rx_subpage = re.compile(r"@subpage\s+(\w+)")
Reported by Pylint.
Line: 21
Column: 5
with open(path, "rt") as f:
self.parse(f)
def parse(self, f):
rx_title = re.compile(r"\{#(\w+)\}")
rx_subpage = re.compile(r"@subpage\s+(\w+)")
rx_prev = re.compile(r"@prev_tutorial\{(\w+)\}")
rx_next = re.compile(r"@next_tutorial\{(\w+)\}")
for line in f:
Reported by Pylint.
Line: 21
Column: 5
with open(path, "rt") as f:
self.parse(f)
def parse(self, f):
rx_title = re.compile(r"\{#(\w+)\}")
rx_subpage = re.compile(r"@subpage\s+(\w+)")
rx_prev = re.compile(r"@prev_tutorial\{(\w+)\}")
rx_next = re.compile(r"@next_tutorial\{(\w+)\}")
for line in f:
Reported by Pylint.
samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java
20 issues
Line: 35
public class ColorBlobDetectionActivity extends CameraActivity implements OnTouchListener, CvCameraViewListener2 {
private static final String TAG = "OCVSample::Activity";
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
Reported by PMD.
Line: 35
public class ColorBlobDetectionActivity extends CameraActivity implements OnTouchListener, CvCameraViewListener2 {
private static final String TAG = "OCVSample::Activity";
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
Reported by PMD.
Line: 36
private static final String TAG = "OCVSample::Activity";
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
Reported by PMD.
Line: 37
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
Reported by PMD.
Line: 38
private boolean mIsColorSelected = false;
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
Reported by PMD.
Line: 39
private Mat mRgba;
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
Reported by PMD.
Line: 40
private Scalar mBlobColorRgba;
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
Reported by PMD.
Line: 41
private Scalar mBlobColorHsv;
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
Reported by PMD.
Line: 42
private ColorBlobDetector mDetector;
private Mat mSpectrum;
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
Reported by PMD.
Line: 44
private Size SPECTRUM_SIZE;
private Scalar CONTOUR_COLOR;
private CameraBridgeViewBase mOpenCvCameraView;
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
Reported by PMD.
samples/python/tutorial_code/features2D/Homography/perspective_correction.py
20 issues
Line: 8
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
def randomColor():
color = np.random.randint(0, 255,(1, 3))
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
Reported by Pylint.
Line: 9
Column: 1
import numpy as np
import cv2 as cv
import sys
def randomColor():
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
Reported by Pylint.
Line: 12
Column: 1
import sys
def randomColor():
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
Reported by Pylint.
Line: 12
Column: 1
import sys
def randomColor():
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
Reported by Pylint.
Line: 16
Column: 1
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
img2 = cv.imread(cv.samples.findFile(img2Path))
# [find-corners]
ret1, corners1 = cv.findChessboardCorners(img1, patternSize)
Reported by Pylint.
Line: 16
Column: 1
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
img2 = cv.imread(cv.samples.findFile(img2Path))
# [find-corners]
ret1, corners1 = cv.findChessboardCorners(img1, patternSize)
Reported by Pylint.
Line: 16
Column: 1
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
img2 = cv.imread(cv.samples.findFile(img2Path))
# [find-corners]
ret1, corners1 = cv.findChessboardCorners(img1, patternSize)
Reported by Pylint.
Line: 16
Column: 1
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
img2 = cv.imread(cv.samples.findFile(img2Path))
# [find-corners]
ret1, corners1 = cv.findChessboardCorners(img1, patternSize)
Reported by Pylint.
Line: 16
Column: 1
color = np.random.randint(0, 255,(1, 3))
return color[0].tolist()
def perspectiveCorrection(img1Path, img2Path ,patternSize ):
img1 = cv.imread(cv.samples.findFile(img1Path))
img2 = cv.imread(cv.samples.findFile(img2Path))
# [find-corners]
ret1, corners1 = cv.findChessboardCorners(img1, patternSize)
Reported by Pylint.
modules/gapi/misc/python/test/test_gapi_types.py
20 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: 47
Column: 9
def setUp(self):
self.skipTest('Skip tests: ' + message)
def test_skip():
pass
pass
Reported by Pylint.
Line: 3
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: 50
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.
Line: 7
Column: 1
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
try:
Reported by Pylint.