Skip to content

Commit

Permalink
Fixed the problem that indices were of type float.
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-ardu authored and ArduCAM committed Jun 13, 2023
1 parent 842508b commit b8994bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Jetson/JetsonNano_PTZ/AutoFocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def filter(self,value):
if len(self.value_buffer) == max_len:
sort_list = sorted(self.value_buffer)
self.value_buffer.pop(0)
return sort_list[max_len / 2]
return sort_list[max_len // 2]
return value

def sobel(self,img):
Expand All @@ -84,7 +84,7 @@ def calculation(self,camera):
image = camera.getFrame()
width = image.shape[1]
height = image.shape[0]
image = image[(height / 4):((height / 4) * 3),(width / 4):((width / 4) * 3)]
image = image[(height // 4):((height // 4) * 3),(width // 4):((width // 4) * 3)]
#return laplacian(image)
#return sobel(image)
return self.laplacian2(image)
Expand Down

0 comments on commit b8994bf

Please sign in to comment.