fix pylint warnings

pylint 1.8.3
This commit is contained in:
Alexander Alekhin
2019-10-16 18:49:33 +03:00
parent d154fa4b4c
commit 0e40c8a031
26 changed files with 40 additions and 39 deletions

View File

@@ -25,13 +25,13 @@ def access_pixel():
y = 0
x = 0
## [Pixel access 1]
intensity = img[y,x]
_intensity = img[y,x]
## [Pixel access 1]
## [Pixel access 3]
blue = img[y,x,0]
green = img[y,x,1]
red = img[y,x,2]
_blue = img[y,x,0]
_green = img[y,x,1]
_red = img[y,x,2]
## [Pixel access 3]
## [Pixel access 5]
@@ -42,12 +42,12 @@ def reference_counting():
# Memory management and reference counting
## [Reference counting 2]
img = cv.imread('image.jpg')
img1 = np.copy(img)
_img1 = np.copy(img)
## [Reference counting 2]
## [Reference counting 3]
img = cv.imread('image.jpg')
sobelx = cv.Sobel(img, cv.CV_32F, 1, 0);
_sobelx = cv.Sobel(img, cv.CV_32F, 1, 0)
## [Reference counting 3]
def primitive_operations():
@@ -57,17 +57,17 @@ def primitive_operations():
## [Set image to black]
## [Select ROI]
smallImg = img[10:110,10:110]
_smallImg = img[10:110,10:110]
## [Select ROI]
## [BGR to Gray]
img = cv.imread('image.jpg')
grey = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
_grey = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
## [BGR to Gray]
src = np.ones((4,4), np.uint8)
## [Convert to CV_32F]
dst = src.astype(np.float32)
_dst = src.astype(np.float32)
## [Convert to CV_32F]
def visualize_images():

View File

@@ -25,8 +25,8 @@ def gammaCorrection():
res = cv.LUT(img_original, lookUpTable)
## [changing-contrast-brightness-gamma-correction]
img_gamma_corrected = cv.hconcat([img_original, res]);
cv.imshow("Gamma correction", img_gamma_corrected);
img_gamma_corrected = cv.hconcat([img_original, res])
cv.imshow("Gamma correction", img_gamma_corrected)
def on_linear_transform_alpha_trackbar(val):
global alpha

View File

@@ -85,13 +85,13 @@ _, contours, _ = cv.findContours(bw, cv.RETR_LIST, cv.CHAIN_APPROX_NONE)
for i, c in enumerate(contours):
# Calculate the area of each contour
area = cv.contourArea(c);
area = cv.contourArea(c)
# Ignore contours that are too small or too large
if area < 1e2 or 1e5 < area:
continue
# Draw each contour only for visualisation purposes
cv.drawContours(src, contours, i, (0, 0, 255), 2);
cv.drawContours(src, contours, i, (0, 0, 255), 2)
# Find the orientation of each shape
getOrientation(c, src)
## [contours]