The following issues were found
modules/python/test/test_legacy.py
32 issues
Line: 5
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class Hackathon244Tests(NewOpenCVTests):
Reported by Pylint.
Line: 30
Column: 41
objpt = np.float64([[1,2,3]])
imgpt0, jac0 = cv.projectPoints(objpt, np.zeros(3), np.zeros(3), np.eye(3), np.float64([]))
imgpt1, jac1 = cv.projectPoints(objpt, np.zeros(3), np.zeros(3), np.eye(3), None)
self.assertEqual(imgpt0.shape, (objpt.shape[0], 1, 2))
self.assertEqual(imgpt1.shape, imgpt0.shape)
self.assertEqual(jac0.shape, jac1.shape)
self.assertEqual(jac0.shape[0], 2*objpt.shape[0])
def test_estimateAffine3D(self):
Reported by Pylint.
Line: 33
Column: 43
self.assertEqual(imgpt0.shape, (objpt.shape[0], 1, 2))
self.assertEqual(imgpt1.shape, imgpt0.shape)
self.assertEqual(jac0.shape, jac1.shape)
self.assertEqual(jac0.shape[0], 2*objpt.shape[0])
def test_estimateAffine3D(self):
pattern_size = (11, 8)
pattern_points = np.zeros((np.prod(pattern_size), 3), np.float32)
pattern_points[:,:2] = np.indices(pattern_size).T.reshape(-1, 2)
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class Hackathon244Tests(NewOpenCVTests):
Reported by Pylint.
Line: 9
Column: 1
from tests_common import NewOpenCVTests
class Hackathon244Tests(NewOpenCVTests):
def test_int_array(self):
a = np.array([-1, 2, -3, 4, -5])
absa0 = np.abs(a)
self.assertTrue(cv.norm(a, cv.NORM_L1) == 15)
Reported by Pylint.
Line: 11
Column: 5
class Hackathon244Tests(NewOpenCVTests):
def test_int_array(self):
a = np.array([-1, 2, -3, 4, -5])
absa0 = np.abs(a)
self.assertTrue(cv.norm(a, cv.NORM_L1) == 15)
absa1 = cv.absdiff(a, 0)
self.assertEqual(cv.norm(absa1, absa0, cv.NORM_INF), 0)
Reported by Pylint.
Line: 12
Column: 9
class Hackathon244Tests(NewOpenCVTests):
def test_int_array(self):
a = np.array([-1, 2, -3, 4, -5])
absa0 = np.abs(a)
self.assertTrue(cv.norm(a, cv.NORM_L1) == 15)
absa1 = cv.absdiff(a, 0)
self.assertEqual(cv.norm(absa1, absa0, cv.NORM_INF), 0)
Reported by Pylint.
Line: 18
Column: 5
absa1 = cv.absdiff(a, 0)
self.assertEqual(cv.norm(absa1, absa0, cv.NORM_INF), 0)
def test_imencode(self):
a = np.zeros((480, 640), dtype=np.uint8)
flag, ajpg = cv.imencode("img_q90.jpg", a, [cv.IMWRITE_JPEG_QUALITY, 90])
self.assertEqual(flag, True)
self.assertEqual(ajpg.dtype, np.uint8)
self.assertGreater(ajpg.shape[0], 1)
Reported by Pylint.
Line: 19
Column: 9
self.assertEqual(cv.norm(absa1, absa0, cv.NORM_INF), 0)
def test_imencode(self):
a = np.zeros((480, 640), dtype=np.uint8)
flag, ajpg = cv.imencode("img_q90.jpg", a, [cv.IMWRITE_JPEG_QUALITY, 90])
self.assertEqual(flag, True)
self.assertEqual(ajpg.dtype, np.uint8)
self.assertGreater(ajpg.shape[0], 1)
self.assertEqual(ajpg.shape[1], 1)
Reported by Pylint.
Line: 26
Column: 5
self.assertGreater(ajpg.shape[0], 1)
self.assertEqual(ajpg.shape[1], 1)
def test_projectPoints(self):
objpt = np.float64([[1,2,3]])
imgpt0, jac0 = cv.projectPoints(objpt, np.zeros(3), np.zeros(3), np.eye(3), np.float64([]))
imgpt1, jac1 = cv.projectPoints(objpt, np.zeros(3), np.zeros(3), np.eye(3), None)
self.assertEqual(imgpt0.shape, (objpt.shape[0], 1, 2))
self.assertEqual(imgpt1.shape, imgpt0.shape)
Reported by Pylint.
samples/dnn/segmentation.py
32 issues
Line: 1
Column: 1
import cv2 as cv
import argparse
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
Reported by Pylint.
Line: 4
Column: 1
import cv2 as cv
import argparse
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
targets = (cv.dnn.DNN_TARGET_CPU, cv.dnn.DNN_TARGET_OPENCL, cv.dnn.DNN_TARGET_OPENCL_FP16, cv.dnn.DNN_TARGET_MYRIAD, cv.dnn.DNN_TARGET_HDDL,
cv.dnn.DNN_TARGET_VULKAN, cv.dnn.DNN_TARGET_CUDA, cv.dnn.DNN_TARGET_CUDA_FP16)
Reported by Pylint.
Line: 6
Column: 1
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
targets = (cv.dnn.DNN_TARGET_CPU, cv.dnn.DNN_TARGET_OPENCL, cv.dnn.DNN_TARGET_OPENCL_FP16, cv.dnn.DNN_TARGET_MYRIAD, cv.dnn.DNN_TARGET_HDDL,
cv.dnn.DNN_TARGET_VULKAN, cv.dnn.DNN_TARGET_CUDA, cv.dnn.DNN_TARGET_CUDA_FP16)
Reported by Pylint.
Line: 66
Column: 16
colors = [np.array(color.split(' '), np.uint8) for color in f.read().rstrip('\n').split('\n')]
legend = None
def showLegend(classes):
global legend
if not classes is None and legend is None:
blockHeight = 30
assert(len(classes) == len(colors))
Reported by Pylint.
Line: 67
Column: 5
legend = None
def showLegend(classes):
global legend
if not classes is None and legend is None:
blockHeight = 30
assert(len(classes) == len(colors))
legend = np.zeros((blockHeight * len(colors), 200, 3), np.uint8)
Reported by Pylint.
Line: 73
Column: 13
assert(len(classes) == len(colors))
legend = np.zeros((blockHeight * len(colors), 200, 3), np.uint8)
for i in range(len(classes)):
block = legend[i * blockHeight:(i + 1) * blockHeight]
block[:,:] = colors[i]
cv.putText(block, classes[i], (0, blockHeight//2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255))
cv.namedWindow('Legend', cv.WINDOW_NORMAL)
Reported by Pylint.
Line: 1
Column: 1
import cv2 as cv
import argparse
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
Reported by Pylint.
Line: 2
Column: 1
import cv2 as cv
import argparse
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
Reported by Pylint.
Line: 4
Column: 1
import cv2 as cv
import argparse
import numpy as np
import sys
from common import *
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, cv.dnn.DNN_BACKEND_OPENCV,
cv.dnn.DNN_BACKEND_VKCOM, cv.dnn.DNN_BACKEND_CUDA)
Reported by Pylint.
modules/java/test/android_test/src/org/opencv/test/android/UtilsTest.java
31 issues
Line: 20
public class UtilsTest extends OpenCVTestCase {
public void testBitmapToMat() {
BitmapFactory.Options opt16 = new BitmapFactory.Options();
opt16.inPreferredConfig = Bitmap.Config.RGB_565;
Bitmap bmp16 = BitmapFactory.decodeFile(OpenCVTestRunner.LENA_PATH, opt16);
Mat m16 = new Mat();
Utils.bitmapToMat(bmp16, m16);
Reported by PMD.
Line: 20
public class UtilsTest extends OpenCVTestCase {
public void testBitmapToMat() {
BitmapFactory.Options opt16 = new BitmapFactory.Options();
opt16.inPreferredConfig = Bitmap.Config.RGB_565;
Bitmap bmp16 = BitmapFactory.decodeFile(OpenCVTestRunner.LENA_PATH, opt16);
Mat m16 = new Mat();
Utils.bitmapToMat(bmp16, m16);
Reported by PMD.
Line: 43
assertTrue(maxDiff <= 8 /* 8 == 2^8 / 2^5 */);
}
public void testExportResourceContextInt() {
fail("Not yet implemented");
}
public void testExportResourceContextIntString() {
fail("Not yet implemented");
Reported by PMD.
Line: 44
}
public void testExportResourceContextInt() {
fail("Not yet implemented");
}
public void testExportResourceContextIntString() {
fail("Not yet implemented");
}
Reported by PMD.
Line: 47
fail("Not yet implemented");
}
public void testExportResourceContextIntString() {
fail("Not yet implemented");
}
public void testLoadResourceContextInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 51
fail("Not yet implemented");
}
public void testLoadResourceContextInt() {
fail("Not yet implemented");
}
public void testLoadResourceContextIntInt() {
fail("Not yet implemented");
Reported by PMD.
Line: 55
fail("Not yet implemented");
}
public void testLoadResourceContextIntInt() {
fail("Not yet implemented");
}
public void testMatToBitmap() {
Mat imgBGR = Imgcodecs.imread( OpenCVTestRunner.LENA_PATH );
Reported by PMD.
Line: 59
fail("Not yet implemented");
}
public void testMatToBitmap() {
Mat imgBGR = Imgcodecs.imread( OpenCVTestRunner.LENA_PATH );
assertTrue(imgBGR != null && !imgBGR.empty() && imgBGR.channels() == 3);
Mat m16 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Mat m32 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Reported by PMD.
Line: 59
fail("Not yet implemented");
}
public void testMatToBitmap() {
Mat imgBGR = Imgcodecs.imread( OpenCVTestRunner.LENA_PATH );
assertTrue(imgBGR != null && !imgBGR.empty() && imgBGR.channels() == 3);
Mat m16 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Mat m32 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Reported by PMD.
Line: 59
fail("Not yet implemented");
}
public void testMatToBitmap() {
Mat imgBGR = Imgcodecs.imread( OpenCVTestRunner.LENA_PATH );
assertTrue(imgBGR != null && !imgBGR.empty() && imgBGR.channels() == 3);
Mat m16 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Mat m32 = new Mat(imgBGR.rows(), imgBGR.cols(), CvType.CV_8UC4);
Reported by PMD.
platforms/android/service/engine/src/org/opencv/engine/OpenCVEngineService.java
31 issues
Line: 18
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
Reported by PMD.
Line: 18
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
Reported by PMD.
Line: 20
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
public String version;
public List<String> files;
Reported by PMD.
Line: 20
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
public String version;
public List<String> files;
Reported by PMD.
Line: 21
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
public String version;
public List<String> files;
Reported by PMD.
Line: 21
public class OpenCVEngineService extends Service {
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
public String version;
public List<String> files;
Reported by PMD.
Line: 24
private List<LibVariant> variants = new ArrayList<LibVariant>();
private class LibVariant {
public String version;
public List<String> files;
public void parseFile(XmlResourceParser p) {
try {
int eventType = p.getEventType();
Reported by PMD.
Line: 25
private class LibVariant {
public String version;
public List<String> files;
public void parseFile(XmlResourceParser p) {
try {
int eventType = p.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
Reported by PMD.
Line: 32
int eventType = p.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_TAG) {
if (p.getName().equals("library")) {
parseLibraryTag(p);
} else if (p.getName().equals("file")) {
parseFileTag(p);
}
}
Reported by PMD.
Line: 32
int eventType = p.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_TAG) {
if (p.getName().equals("library")) {
parseLibraryTag(p);
} else if (p.getName().equals("file")) {
parseFileTag(p);
}
}
Reported by PMD.
samples/java/tutorial_code/ImgProc/threshold_inRange/ThresholdInRange.java
31 issues
Line: 57
cap = new VideoCapture(cameraDevice);
//! [cap]
if (!cap.isOpened()) {
System.err.println("Cannot open camera: " + cameraDevice);
System.exit(0);
}
if (!cap.read(matFrame)) {
System.err.println("Cannot read camera stream.");
System.exit(0);
Reported by PMD.
Line: 61
System.exit(0);
}
if (!cap.read(matFrame)) {
System.err.println("Cannot read camera stream.");
System.exit(0);
}
//! [window]
// Create and set up the window.
Reported by PMD.
Line: 35
private static final String HIGH_H_NAME = "High H";
private static final String HIGH_S_NAME = "High S";
private static final String HIGH_V_NAME = "High V";
private JSlider sliderLowH;
private JSlider sliderHighH;
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
Reported by PMD.
Line: 36
private static final String HIGH_S_NAME = "High S";
private static final String HIGH_V_NAME = "High V";
private JSlider sliderLowH;
private JSlider sliderHighH;
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
Reported by PMD.
Line: 37
private static final String HIGH_V_NAME = "High V";
private JSlider sliderLowH;
private JSlider sliderHighH;
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
Reported by PMD.
Line: 38
private JSlider sliderLowH;
private JSlider sliderHighH;
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
private JFrame frame;
Reported by PMD.
Line: 39
private JSlider sliderHighH;
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
private JFrame frame;
private JLabel imgCaptureLabel;
Reported by PMD.
Line: 40
private JSlider sliderLowS;
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
private JFrame frame;
private JLabel imgCaptureLabel;
private JLabel imgDetectionLabel;
Reported by PMD.
Line: 41
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
private JFrame frame;
private JLabel imgCaptureLabel;
private JLabel imgDetectionLabel;
private CaptureTask captureTask;
Reported by PMD.
Line: 41
private JSlider sliderHighS;
private JSlider sliderLowV;
private JSlider sliderHighV;
private VideoCapture cap;
private Mat matFrame = new Mat();
private JFrame frame;
private JLabel imgCaptureLabel;
private JLabel imgDetectionLabel;
private CaptureTask captureTask;
Reported by PMD.
samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java
31 issues
Line: 23
public class CameraCalibrator {
private static final String TAG = "OCV::CameraCalibrator";
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
Reported by PMD.
Line: 24
private static final String TAG = "OCV::CameraCalibrator";
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
Reported by PMD.
Line: 25
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
Reported by PMD.
Line: 25
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
Reported by PMD.
Line: 26
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
Reported by PMD.
Line: 26
private final Size mPatternSize = new Size(4, 11);
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
Reported by PMD.
Line: 27
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
private int mFlags;
Reported by PMD.
Line: 27
private final int mCornersSize = (int)(mPatternSize.width * mPatternSize.height);
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
private int mFlags;
Reported by PMD.
Line: 28
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
private int mFlags;
private double mRms;
Reported by PMD.
Line: 28
private boolean mPatternWasFound = false;
private MatOfPoint2f mCorners = new MatOfPoint2f();
private List<Mat> mCornersBuffer = new ArrayList<>();
private boolean mIsCalibrated = false;
private Mat mCameraMatrix = new Mat();
private Mat mDistortionCoefficients = new Mat();
private int mFlags;
private double mRms;
Reported by PMD.
samples/python/turing.py
31 issues
Line: 19
Column: 1
xrange = range
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
Reported by Pylint.
Line: 21
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
Line: 16
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
Reported by Pylint.
Line: 18
Column: 1
if PY3:
xrange = range
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
Reported by Pylint.
Line: 19
Column: 1
xrange = range
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
Reported by Pylint.
Line: 20
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
Line: 21
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
Line: 21
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
Line: 21
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
Line: 21
Column: 1
import numpy as np
import cv2 as cv
from common import draw_str
import getopt, sys
from itertools import count
help_message = '''
USAGE: turing.py [-o <output.avi>]
Reported by Pylint.
samples/python/fitline.py
31 issues
Line: 31
Column: 1
PY3 = sys.version_info[0] == 3
import numpy as np
import cv2 as cv
# built-in modules
import itertools as it
# local modules
Reported by Pylint.
Line: 55
Column: 21
if PY3:
cur_func_name = next(dist_func_names)
else:
cur_func_name = dist_func_names.next()
def update(_=None):
noise = cv.getTrackbarPos('noise', 'fit line')
n = cv.getTrackbarPos('point n', 'fit line')
r = cv.getTrackbarPos('outlier %', 'fit line') / 100.0
Reported by Pylint.
Line: 95
Column: 33
if PY3:
cur_func_name = next(dist_func_names)
else:
cur_func_name = dist_func_names.next()
if ch == 27:
break
print('Done')
Reported by Pylint.
Line: 91
Column: 13
update()
ch = cv.waitKey(0)
if ch == ord('f'):
global cur_func_name
if PY3:
cur_func_name = next(dist_func_names)
else:
cur_func_name = dist_func_names.next()
if ch == 27:
Reported by Pylint.
Line: 30
Column: 1
import sys
PY3 = sys.version_info[0] == 3
import numpy as np
import cv2 as cv
# built-in modules
import itertools as it
Reported by Pylint.
Line: 31
Column: 1
PY3 = sys.version_info[0] == 3
import numpy as np
import cv2 as cv
# built-in modules
import itertools as it
# local modules
Reported by Pylint.
Line: 34
Column: 1
import cv2 as cv
# built-in modules
import itertools as it
# local modules
from common import draw_str
Reported by Pylint.
Line: 34
Column: 1
import cv2 as cv
# built-in modules
import itertools as it
# local modules
from common import draw_str
Reported by Pylint.
Line: 37
Column: 1
import itertools as it
# local modules
from common import draw_str
w, h = 512, 256
def toint(p):
Reported by Pylint.
Line: 42
Column: 1
w, h = 512, 256
def toint(p):
return tuple(map(int, p))
def sample_line(p1, p2, n, noise=0.0):
p1 = np.float32(p1)
t = np.random.rand(n,1)
Reported by Pylint.
samples/python/tutorial_code/core/file_input_output/file_input_output.py
31 issues
Line: 4
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
def help(filename):
print (
'''
Reported by Pylint.
Line: 7
Column: 1
import cv2 as cv
import sys
def help(filename):
print (
'''
{0} shows the usage of the OpenCV serialization functionality. \n\n
usage:\n
python3 {0} outputfile.yml.gz\n\n
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
def help(filename):
print (
'''
Reported by Pylint.
Line: 5
Column: 1
import numpy as np
import cv2 as cv
import sys
def help(filename):
print (
'''
{0} shows the usage of the OpenCV serialization functionality. \n\n
Reported by Pylint.
Line: 7
Column: 1
import cv2 as cv
import sys
def help(filename):
print (
'''
{0} shows the usage of the OpenCV serialization functionality. \n\n
usage:\n
python3 {0} outputfile.yml.gz\n\n
Reported by Pylint.
Line: 21
Column: 1
'''.format(filename)
)
class MyData:
A = 97
X = np.pi
name = 'mydata1234'
def __repr__(self):
Reported by Pylint.
Line: 27
Column: 9
name = 'mydata1234'
def __repr__(self):
s = '{ name = ' + self.name + ', X = ' + str(self.X)
s = s + ', A = ' + str(self.A) + '}'
return s
## [inside]
def write(self, fs, name):
Reported by Pylint.
Line: 28
Column: 9
def __repr__(self):
s = '{ name = ' + self.name + ', X = ' + str(self.X)
s = s + ', A = ' + str(self.A) + '}'
return s
## [inside]
def write(self, fs, name):
fs.startWriteStruct(name, cv.FileNode_MAP|cv.FileNode_FLOW)
Reported by Pylint.
Line: 32
Column: 5
return s
## [inside]
def write(self, fs, name):
fs.startWriteStruct(name, cv.FileNode_MAP|cv.FileNode_FLOW)
fs.write('A', self.A)
fs.write('X', self.X)
fs.write('name', self.name)
fs.endWriteStruct()
Reported by Pylint.
Line: 32
Column: 5
return s
## [inside]
def write(self, fs, name):
fs.startWriteStruct(name, cv.FileNode_MAP|cv.FileNode_FLOW)
fs.write('A', self.A)
fs.write('X', self.X)
fs.write('name', self.name)
fs.endWriteStruct()
Reported by Pylint.
samples/python/camshift.py
30 issues
Line: 34
Column: 1
xrange = range
import numpy as np
import cv2 as cv
# local module
import video
from video import presets
Reported by Pylint.
Line: 42
Column: 24
class App(object):
def __init__(self, video_src):
self.cam = video.create_capture(video_src, presets['cube'])
_ret, self.frame = self.cam.read()
cv.namedWindow('camshift')
cv.setMouseCallback('camshift', self.onmouse)
Reported by Pylint.
Line: 53
Column: 36
self.show_backproj = False
self.track_window = None
def onmouse(self, event, x, y, flags, param):
if event == cv.EVENT_LBUTTONDOWN:
self.drag_start = (x, y)
self.track_window = None
if self.drag_start:
xmin = min(x, self.drag_start[0])
Reported by Pylint.
Line: 53
Column: 43
self.show_backproj = False
self.track_window = None
def onmouse(self, event, x, y, flags, param):
if event == cv.EVENT_LBUTTONDOWN:
self.drag_start = (x, y)
self.track_window = None
if self.drag_start:
xmin = min(x, self.drag_start[0])
Reported by Pylint.
Line: 90
Column: 17
mask_roi = mask[y0:y1, x0:x1]
hist = cv.calcHist( [hsv_roi], [0], mask_roi, [16], [0, 180] )
cv.normalize(hist, hist, 0, 255, cv.NORM_MINMAX)
self.hist = hist.reshape(-1)
self.show_hist()
vis_roi = vis[y0:y1, x0:x1]
cv.bitwise_not(vis_roi, vis_roi)
vis[mask == 0] = 0
Reported by Pylint.
Line: 108
Column: 17
vis[:] = prob[...,np.newaxis]
try:
cv.ellipse(vis, track_box, (0, 0, 255), 2)
except:
print(track_box)
cv.imshow('camshift', vis)
ch = cv.waitKey(5)
Reported by Pylint.
Line: 123
Column: 5
if __name__ == '__main__':
print(__doc__)
import sys
try:
video_src = sys.argv[1]
except:
video_src = 0
App(video_src).run()
Reported by Pylint.
Line: 126
Column: 5
import sys
try:
video_src = sys.argv[1]
except:
video_src = 0
App(video_src).run()
Reported by Pylint.
Line: 31
Column: 5
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2 as cv
# local module
Reported by Pylint.
Line: 33
Column: 1
if PY3:
xrange = range
import numpy as np
import cv2 as cv
# local module
import video
from video import presets
Reported by Pylint.