mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Merge pull request #7285 from danil-tolkachev:none-comparison
This commit is contained in:
commit
26ecf2f374
@ -30,7 +30,7 @@ if __name__ == '__main__':
|
||||
|
||||
circles = cv2.HoughCircles(img, cv2.HOUGH_GRADIENT, 1, 10, np.array([]), 100, 30, 1, 30)
|
||||
|
||||
if circles != None: # Check if circles have been found and only then iterate over these and add them to the image
|
||||
if circles is not None: # Check if circles have been found and only then iterate over these and add them to the image
|
||||
a, b, c = circles.shape
|
||||
for i in range(b):
|
||||
cv2.circle(cimg, (circles[0][i][0], circles[0][i][1]), circles[0][i][2], (0, 0, 255), 3, cv2.LINE_AA)
|
||||
|
@ -36,7 +36,7 @@ if __name__ == '__main__':
|
||||
|
||||
else: # HoughLines
|
||||
lines = cv2.HoughLines(dst, 1, math.pi/180.0, 50, np.array([]), 0, 0)
|
||||
if lines != None:
|
||||
if lines is not None:
|
||||
a,b,c = lines.shape
|
||||
for i in range(a):
|
||||
rho = lines[i][0][0]
|
||||
|
@ -21,7 +21,7 @@ class TestSceneRender():
|
||||
self.deformation = deformation
|
||||
self.speed = speed
|
||||
|
||||
if bgImg != None:
|
||||
if bgImg is not None:
|
||||
self.sceneBg = bgImg.copy()
|
||||
else:
|
||||
self.sceneBg = np.zeros(defaultSize, defaultSize, np.uint8)
|
||||
@ -29,7 +29,7 @@ class TestSceneRender():
|
||||
self.w = self.sceneBg.shape[0]
|
||||
self.h = self.sceneBg.shape[1]
|
||||
|
||||
if fgImg != None:
|
||||
if fgImg is not None:
|
||||
self.foreground = fgImg.copy()
|
||||
self.center = self.currentCenter = (int(self.w/2 - fgImg.shape[0]/2), int(self.h/2 - fgImg.shape[1]/2))
|
||||
|
||||
@ -52,7 +52,7 @@ class TestSceneRender():
|
||||
|
||||
def getRectInTime(self, time):
|
||||
|
||||
if self.foreground != None:
|
||||
if self.foreground is not None:
|
||||
tmp = np.array(self.center) + np.array((self.getXOffset(time), self.getYOffset(time)))
|
||||
x0, y0 = tmp
|
||||
x1, y1 = tmp + self.foreground.shape[0:2]
|
||||
@ -64,7 +64,7 @@ class TestSceneRender():
|
||||
|
||||
def getCurrentRect(self):
|
||||
|
||||
if self.foreground != None:
|
||||
if self.foreground is not None:
|
||||
|
||||
x0 = self.currentCenter[0]
|
||||
y0 = self.currentCenter[1]
|
||||
@ -79,7 +79,7 @@ class TestSceneRender():
|
||||
def getNextFrame(self):
|
||||
img = self.sceneBg.copy()
|
||||
|
||||
if self.foreground != None:
|
||||
if self.foreground is not None:
|
||||
self.currentCenter = (self.center[0] + self.getXOffset(self.time), self.center[1] + self.getYOffset(self.time))
|
||||
img[self.currentCenter[0]:self.currentCenter[0]+self.foreground.shape[0],
|
||||
self.currentCenter[1]:self.currentCenter[1]+self.foreground.shape[1]] = self.foreground
|
||||
|
Loading…
Reference in New Issue
Block a user