The following issues were found
samples/java/tutorial_code/ImgTrans/remap/RemapDemo.java
16 issues
Line: 62
//! [Load]
Mat src = Imgcodecs.imread(filename, Imgcodecs.IMREAD_COLOR);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load]
//! [Create]
Reported by PMD.
Line: 9
import org.opencv.imgproc.Imgproc;
class Remap {
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
Reported by PMD.
Line: 10
class Remap {
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
private void updateMap() {
Reported by PMD.
Line: 11
class Remap {
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
private void updateMap() {
float buffX[] = new float[(int) (mapX.total() * mapX.channels())];
Reported by PMD.
Line: 11
class Remap {
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
private void updateMap() {
float buffX[] = new float[(int) (mapX.total() * mapX.channels())];
Reported by PMD.
Line: 12
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
private void updateMap() {
float buffX[] = new float[(int) (mapX.total() * mapX.channels())];
mapX.get(0, 0, buffX);
Reported by PMD.
Line: 12
private Mat mapX = new Mat();
private Mat mapY = new Mat();
private Mat dst = new Mat();
private int ind = 0;
//! [Update]
private void updateMap() {
float buffX[] = new float[(int) (mapX.total() * mapX.channels())];
mapX.get(0, 0, buffX);
Reported by PMD.
Line: 15
private int ind = 0;
//! [Update]
private void updateMap() {
float buffX[] = new float[(int) (mapX.total() * mapX.channels())];
mapX.get(0, 0, buffX);
float buffY[] = new float[(int) (mapY.total() * mapY.channels())];
mapY.get(0, 0, buffY);
Reported by PMD.
Line: 61
String filename = args.length > 0 ? args[0] : "../data/chicky_512.png";
//! [Load]
Mat src = Imgcodecs.imread(filename, Imgcodecs.IMREAD_COLOR);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load]
Reported by PMD.
Line: 63
Mat src = Imgcodecs.imread(filename, Imgcodecs.IMREAD_COLOR);
if (src.empty()) {
System.err.println("Cannot read image: " + filename);
System.exit(0);
}
//! [Load]
//! [Create]
mapX = new Mat(src.size(), CvType.CV_32F);
Reported by PMD.
doc/tools/doxygen_scan.py
16 issues
Line: 1
Column: 1
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 4
Column: 32
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 1
Column: 1
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 3
Column: 1
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 3
Column: 1
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 3
Column: 1
import traceback
class Symbol(object):
def __init__(self, anchor, type, cppname):
self.anchor = anchor
self.type = type
self.cppname = cppname
#if anchor == 'ga586ebfb0a7fb604b35a23d85391329be':
# print(repr(self))
Reported by Pylint.
Line: 15
Column: 1
def __repr__(self):
return '%s:%s@%s' % (self.type, self.cppname, self.anchor)
def add_to_file(files_dict, file, anchor):
anchors = files_dict.setdefault(file, [])
anchors.append(anchor)
def scan_namespace_constants(ns, ns_name, files_dict):
Reported by Pylint.
Line: 20
Column: 1
anchors.append(anchor)
def scan_namespace_constants(ns, ns_name, files_dict):
constants = ns.findall("./member[@kind='enumvalue']")
for c in constants:
c_name = c.find("./name").text
name = ns_name + '::' + c_name
file = c.find("./anchorfile").text
Reported by Pylint.
Line: 20
Column: 1
anchors.append(anchor)
def scan_namespace_constants(ns, ns_name, files_dict):
constants = ns.findall("./member[@kind='enumvalue']")
for c in constants:
c_name = c.find("./name").text
name = ns_name + '::' + c_name
file = c.find("./anchorfile").text
Reported by Pylint.
Line: 22
Column: 9
def scan_namespace_constants(ns, ns_name, files_dict):
constants = ns.findall("./member[@kind='enumvalue']")
for c in constants:
c_name = c.find("./name").text
name = ns_name + '::' + c_name
file = c.find("./anchorfile").text
anchor = c.find("./anchor").text
#print(' CONST: {} => {}#{}'.format(name, file, anchor))
Reported by Pylint.
samples/java/tutorial_code/video/meanshift/MeanshiftDemo.java
15 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;
// take the first frame of the video
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
capture.read(frame);
Reported by PMD.
Line: 41
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: 41
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: 53
Video.meanShift(dst, track_window, term_crit);
// Draw it on image
Imgproc.rectangle(frame, track_window, new Scalar(255, 0, 0), 2);
HighGui.imshow("img2", frame);
int keyboard = HighGui.waitKey(30);
if (keyboard == 'q' || keyboard == 27) {
break;
Reported by PMD.
Line: 61
break;
}
}
System.exit(0);
}
}
public class MeanshiftDemo {
public static void main(String[] args) {
Reported by PMD.
Line: 65
}
}
public class MeanshiftDemo {
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
new Meanshift().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 Meanshift {
Reported by PMD.
Line: 10
class Meanshift {
public void run(String[] args) {
String filename = args[0];
VideoCapture capture = new VideoCapture(filename);
if (!capture.isOpened()) {
System.out.println("Unable to open file!");
System.exit(-1);
Reported by PMD.
Line: 17
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
capture.read(frame);
//setup initial location of window
Reported by PMD.
modules/features2d/misc/java/test/SURFFeatureDetectorTest.java
15 issues
Line: 22
public class SURFFeatureDetectorTest extends OpenCVTestCase {
Feature2D detector;
int matSize;
KeyPoint[] truth;
private Mat getMaskImg() {
Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Reported by PMD.
Line: 23
public class SURFFeatureDetectorTest extends OpenCVTestCase {
Feature2D detector;
int matSize;
KeyPoint[] truth;
private Mat getMaskImg() {
Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Mat right = mask.submat(0, matSize, matSize / 2, matSize);
Reported by PMD.
Line: 24
Feature2D detector;
int matSize;
KeyPoint[] truth;
private Mat getMaskImg() {
Mat mask = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
Mat right = mask.submat(0, matSize, matSize / 2, matSize);
right.setTo(new Scalar(0));
Reported by PMD.
Line: 53
});
}
@Override
protected void setUp() throws Exception {
super.setUp();
detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
matSize = 100;
truth = new KeyPoint[] {
Reported by PMD.
Line: 66
};
}
public void testCreate() {
assertNotNull(detector);
}
public void testDetectListOfMatListOfListOfKeyPoint() {
Reported by PMD.
Line: 70
assertNotNull(detector);
}
public void testDetectListOfMatListOfListOfKeyPoint() {
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
Reported by PMD.
Line: 70
assertNotNull(detector);
}
public void testDetectListOfMatListOfListOfKeyPoint() {
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
Reported by PMD.
Line: 73
public void testDetectListOfMatListOfListOfKeyPoint() {
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
List<MatOfKeyPoint> keypoints = new ArrayList<MatOfKeyPoint>();
Mat cross = getTestImg();
Reported by PMD.
Line: 95
}
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
Reported by PMD.
Line: 99
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
Reported by PMD.
samples/python/tutorial_code/Histograms_Matching/back_projection/calcBackProject_Demo1.py
15 issues
Line: 3
Column: 1
from __future__ import print_function
from __future__ import division
import cv2 as cv
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
Reported by Pylint.
Line: 9
Column: 5
def Hist_and_Backproj(val):
## [initialize]
bins = val
histSize = max(bins, 2)
ranges = [0, 180] # hue_range
## [initialize]
## [Get the Histogram and normalize it]
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
from __future__ import division
import cv2 as cv
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
from __future__ import division
import cv2 as cv
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
Reported by Pylint.
Line: 5
Column: 1
from __future__ import division
import cv2 as cv
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
histSize = max(bins, 2)
Reported by Pylint.
Line: 7
Column: 1
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
histSize = max(bins, 2)
ranges = [0, 180] # hue_range
## [initialize]
Reported by Pylint.
Line: 7
Column: 1
import numpy as np
import argparse
def Hist_and_Backproj(val):
## [initialize]
bins = val
histSize = max(bins, 2)
ranges = [0, 180] # hue_range
## [initialize]
Reported by Pylint.
Line: 10
Column: 5
def Hist_and_Backproj(val):
## [initialize]
bins = val
histSize = max(bins, 2)
ranges = [0, 180] # hue_range
## [initialize]
## [Get the Histogram and normalize it]
hist = cv.calcHist([hue], [0], None, [histSize], ranges, accumulate=False)
Reported by Pylint.
Line: 28
Column: 5
## [Draw the backproj]
## [Draw the histogram]
w = 400
h = 400
bin_w = int(round(w / histSize))
histImg = np.zeros((h, w, 3), dtype=np.uint8)
for i in range(bins):
Reported by Pylint.
Line: 29
Column: 5
## [Draw the histogram]
w = 400
h = 400
bin_w = int(round(w / histSize))
histImg = np.zeros((h, w, 3), dtype=np.uint8)
for i in range(bins):
cv.rectangle(histImg, (i*bin_w, h), ( (i+1)*bin_w, h - int(np.round( hist[i]*h/255.0 )) ), (0, 0, 255), cv.FILLED)
Reported by Pylint.
samples/python/tutorial_code/dnn/dnn_conversion/pytorch/segmentation/py_to_py_fcn_resnet50.py
15 issues
Line: 1
Column: 1
from torchvision import models
from ..pytorch_model import (
PyTorchModelPreparer,
PyTorchModelProcessor,
PyTorchDnnModelProcessor
)
from ...common.utils import set_pytorch_env, create_parser
Reported by Pylint.
Line: 3
Column: 1
from torchvision import models
from ..pytorch_model import (
PyTorchModelPreparer,
PyTorchModelProcessor,
PyTorchDnnModelProcessor
)
from ...common.utils import set_pytorch_env, create_parser
Reported by Pylint.
Line: 8
Column: 1
PyTorchModelProcessor,
PyTorchDnnModelProcessor
)
from ...common.utils import set_pytorch_env, create_parser
class PyTorchFcnResNet50(PyTorchModelPreparer):
def __init__(self, model_name, original_model):
super(PyTorchFcnResNet50, self).__init__(model_name, original_model)
Reported by Pylint.
Line: 29
Column: 9
model_dict = resnets.get_prepared_models()
if cmd_args.is_evaluate:
from ...common.test_config import TestConfig
from ...common.accuracy_eval import PASCALDataFetch
from ...common.test.voc_segm_test import test_segm_models
eval_params = TestConfig()
Reported by Pylint.
Line: 30
Column: 9
if cmd_args.is_evaluate:
from ...common.test_config import TestConfig
from ...common.accuracy_eval import PASCALDataFetch
from ...common.test.voc_segm_test import test_segm_models
eval_params = TestConfig()
model_names = list(model_dict.keys())
Reported by Pylint.
Line: 31
Column: 9
if cmd_args.is_evaluate:
from ...common.test_config import TestConfig
from ...common.accuracy_eval import PASCALDataFetch
from ...common.test.voc_segm_test import test_segm_models
eval_params = TestConfig()
model_names = list(model_dict.keys())
original_model_name = model_names[0]
Reported by Pylint.
Line: 12
Column: 5
class PyTorchFcnResNet50(PyTorchModelPreparer):
def __init__(self, model_name, original_model):
super(PyTorchFcnResNet50, self).__init__(model_name, original_model)
def main():
parser = create_parser()
Reported by Pylint.
Line: 1
Column: 1
from torchvision import models
from ..pytorch_model import (
PyTorchModelPreparer,
PyTorchModelProcessor,
PyTorchDnnModelProcessor
)
from ...common.utils import set_pytorch_env, create_parser
Reported by Pylint.
Line: 11
Column: 1
from ...common.utils import set_pytorch_env, create_parser
class PyTorchFcnResNet50(PyTorchModelPreparer):
def __init__(self, model_name, original_model):
super(PyTorchFcnResNet50, self).__init__(model_name, original_model)
def main():
Reported by Pylint.
Line: 11
Column: 1
from ...common.utils import set_pytorch_env, create_parser
class PyTorchFcnResNet50(PyTorchModelPreparer):
def __init__(self, model_name, original_model):
super(PyTorchFcnResNet50, self).__init__(model_name, original_model)
def main():
Reported by Pylint.
samples/python/color_histogram.py
15 issues
Line: 15
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
# built-in modules
import sys
# local modules
Reported by Pylint.
Line: 26
Column: 9
class App():
def set_scale(self, val):
self.hist_scale = val
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
Reported by Pylint.
Line: 38
Column: 9
cv.imshow('hsv_map', hsv_map)
cv.namedWindow('hist', 0)
self.hist_scale = 10
cv.createTrackbar('scale', 'hist', self.hist_scale, 32, self.set_scale)
try:
fn = sys.argv[1]
Reported by Pylint.
Line: 44
Column: 9
try:
fn = sys.argv[1]
except:
fn = 0
cam = video.create_capture(fn, fallback='synth:bg=baboon.jpg:class=chess:noise=0.05')
while True:
_flag, frame = cam.read()
Reported by Pylint.
Line: 18
Column: 1
import cv2 as cv
# built-in modules
import sys
# local modules
import video
class App():
Reported by Pylint.
Line: 23
Column: 1
# local modules
import video
class App():
def set_scale(self, val):
self.hist_scale = val
def run(self):
Reported by Pylint.
Line: 25
Column: 5
class App():
def set_scale(self, val):
self.hist_scale = val
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
Reported by Pylint.
Line: 28
Column: 5
def set_scale(self, val):
self.hist_scale = val
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
hsv_map[:,:,1] = s
hsv_map[:,:,2] = 255
Reported by Pylint.
Line: 30
Column: 12
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
hsv_map[:,:,1] = s
hsv_map[:,:,2] = 255
hsv_map = cv.cvtColor(hsv_map, cv.COLOR_HSV2BGR)
cv.imshow('hsv_map', hsv_map)
Reported by Pylint.
Line: 30
Column: 9
def run(self):
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2])
hsv_map[:,:,0] = h
hsv_map[:,:,1] = s
hsv_map[:,:,2] = 255
hsv_map = cv.cvtColor(hsv_map, cv.COLOR_HSV2BGR)
cv.imshow('hsv_map', hsv_map)
Reported by Pylint.
samples/java/tutorial_code/core/discrete_fourier_transform/DiscreteFourierTransform.java
15 issues
Line: 10
class DiscreteFourierTransformRun{
private void help() {
System.out.println("" +
"This program demonstrated the use of the discrete Fourier transform (DFT). \n" +
"The dft of an image is taken and it's power spectrum is displayed.\n" +
"Usage:\n" +
"./DiscreteFourierTransform [image_name -- default ../data/lena.jpg]");
}
Reported by PMD.
Line: 25
Mat I = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
if( I.empty() ) {
System.out.println("Error opening image");
System.exit(-1);
}
//! [expand]
Mat padded = new Mat(); //expand input image to optimal size
Reported by PMD.
Line: 10
class DiscreteFourierTransformRun{
private void help() {
System.out.println("" +
"This program demonstrated the use of the discrete Fourier transform (DFT). \n" +
"The dft of an image is taken and it's power spectrum is displayed.\n" +
"Usage:\n" +
"./DiscreteFourierTransform [image_name -- default ../data/lena.jpg]");
}
Reported by PMD.
Line: 24
String filename = ((args.length > 0) ? args[0] : "../data/lena.jpg");
Mat I = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
if( I.empty() ) {
System.out.println("Error opening image");
System.exit(-1);
}
//! [expand]
Reported by PMD.
Line: 26
Mat I = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
if( I.empty() ) {
System.out.println("Error opening image");
System.exit(-1);
}
//! [expand]
Mat padded = new Mat(); //expand input image to optimal size
int m = Core.getOptimalDFTSize( I.rows() );
Reported by PMD.
Line: 31
//! [expand]
Mat padded = new Mat(); //expand input image to optimal size
int m = Core.getOptimalDFTSize( I.rows() );
int n = Core.getOptimalDFTSize( I.cols() ); // on the border add zero values
Core.copyMakeBorder(I, padded, 0, m - I.rows(), 0, n - I.cols(), Core.BORDER_CONSTANT, Scalar.all(0));
//! [expand]
//! [complex_and_real]
Reported by PMD.
Line: 32
//! [expand]
Mat padded = new Mat(); //expand input image to optimal size
int m = Core.getOptimalDFTSize( I.rows() );
int n = Core.getOptimalDFTSize( I.cols() ); // on the border add zero values
Core.copyMakeBorder(I, padded, 0, m - I.rows(), 0, n - I.cols(), Core.BORDER_CONSTANT, Scalar.all(0));
//! [expand]
//! [complex_and_real]
List<Mat> planes = new ArrayList<Mat>();
Reported by PMD.
Line: 33
Mat padded = new Mat(); //expand input image to optimal size
int m = Core.getOptimalDFTSize( I.rows() );
int n = Core.getOptimalDFTSize( I.cols() ); // on the border add zero values
Core.copyMakeBorder(I, padded, 0, m - I.rows(), 0, n - I.cols(), Core.BORDER_CONSTANT, Scalar.all(0));
//! [expand]
//! [complex_and_real]
List<Mat> planes = new ArrayList<Mat>();
padded.convertTo(padded, CvType.CV_32F);
Reported by PMD.
Line: 33
Mat padded = new Mat(); //expand input image to optimal size
int m = Core.getOptimalDFTSize( I.rows() );
int n = Core.getOptimalDFTSize( I.cols() ); // on the border add zero values
Core.copyMakeBorder(I, padded, 0, m - I.rows(), 0, n - I.cols(), Core.BORDER_CONSTANT, Scalar.all(0));
//! [expand]
//! [complex_and_real]
List<Mat> planes = new ArrayList<Mat>();
padded.convertTo(padded, CvType.CV_32F);
Reported by PMD.
Line: 59
//! [magnitude]
//! [log]
Mat matOfOnes = Mat.ones(magI.size(), magI.type());
Core.add(matOfOnes, magI, magI); // switch to logarithmic scale
Core.log(magI, magI);
//! [log]
//! [crop_rearrange]
Reported by PMD.
samples/python/dft.py
15 issues
Line: 15
Column: 1
from __future__ import print_function
import numpy as np
import cv2 as cv
import sys
def shift_dft(src, dst=None):
Reported by Pylint.
Line: 17
Column: 1
import numpy as np
import cv2 as cv
import sys
def shift_dft(src, dst=None):
'''
Rearrange the quadrants of Fourier image so that the origin is at
Reported by Pylint.
Line: 40
Column: 8
else:
ret = dst
h, w = src.shape[:2]
cx1 = cx2 = w // 2
cy1 = cy2 = h // 2
# if the size is odd, then adjust the bottom/right quadrants
Reported by Pylint.
Line: 40
Column: 5
else:
ret = dst
h, w = src.shape[:2]
cx1 = cx2 = w // 2
cy1 = cy2 = h // 2
# if the size is odd, then adjust the bottom/right quadrants
Reported by Pylint.
Line: 67
Column: 1
return dst
def main():
if len(sys.argv) > 1:
fname = sys.argv[1]
else:
fname = 'baboon.jpg'
print("usage : python dft.py <image_file>")
Reported by Pylint.
Line: 74
Column: 5
fname = 'baboon.jpg'
print("usage : python dft.py <image_file>")
im = cv.imread(cv.samples.findFile(fname))
# convert to grayscale
im = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
h, w = im.shape[:2]
Reported by Pylint.
Line: 77
Column: 5
im = cv.imread(cv.samples.findFile(fname))
# convert to grayscale
im = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
h, w = im.shape[:2]
realInput = im.astype(np.float64)
# perform an optimally sized dft
Reported by Pylint.
Line: 78
Column: 5
# convert to grayscale
im = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
h, w = im.shape[:2]
realInput = im.astype(np.float64)
# perform an optimally sized dft
dft_M = cv.getOptimalDFTSize(w)
Reported by Pylint.
Line: 78
Column: 8
# convert to grayscale
im = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
h, w = im.shape[:2]
realInput = im.astype(np.float64)
# perform an optimally sized dft
dft_M = cv.getOptimalDFTSize(w)
Reported by Pylint.
Line: 80
Column: 5
im = cv.cvtColor(im, cv.COLOR_BGR2GRAY)
h, w = im.shape[:2]
realInput = im.astype(np.float64)
# perform an optimally sized dft
dft_M = cv.getOptimalDFTSize(w)
dft_N = cv.getOptimalDFTSize(h)
Reported by Pylint.
modules/js/src/make_umd.py
15 issues
Line: 69
Column: 1
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
Reported by Pylint.
Line: 69
Column: 1
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
Reported by Pylint.
Line: 69
Column: 1
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
Reported by Pylint.
Line: 70
Column: 1
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
with open(opencvjs, 'r+b') as src:
Reported by Pylint.
Line: 70
Column: 1
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
with open(opencvjs, 'r+b') as src:
Reported by Pylint.
Line: 70
Column: 1
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
import os, sys, re, json, shutil
from subprocess import Popen, PIPE, STDOUT
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
with open(opencvjs, 'r+b') as src:
Reported by Pylint.
Line: 74
Column: 14
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
with open(opencvjs, 'r+b') as src:
content = src.read()
if PY3: # content is bytes
content = content.decode('utf-8')
with open(cvjs, 'w+b') as dst:
Reported by Pylint.
Line: 74
Column: 24
PY3 = sys.version_info >= (3, 0)
def make_umd(opencvjs, cvjs):
with open(opencvjs, 'r+b') as src:
content = src.read()
if PY3: # content is bytes
content = content.decode('utf-8')
with open(cvjs, 'w+b') as dst:
Reported by Pylint.
Line: 119
Column: 1
if not os.path.isfile(opencvjs):
print('opencv.js file not found! Have you compiled the opencv_js module?')
exit()
make_umd(opencvjs, cvjs);
Reported by Pylint.
Line: 1
Column: 1
###############################################################################
#
# IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
#
# By downloading, copying, installing or using the software you agree to this license.
# If you do not agree to this license, do not download, install,
# copy or use the software.
#
#
Reported by Pylint.