Closedown
This commit is contained in:
@@ -46,22 +46,19 @@ def integrate (ips):
|
||||
|
||||
|
||||
last_ret = (None, None)
|
||||
x=None
|
||||
def detect_led(ip):
|
||||
global roi_center, roi_radius, integration_count, integration_continuous, integration_partial, frames
|
||||
global count , last_ret , x
|
||||
x=ip
|
||||
global count , last_ret
|
||||
aux = sub_image(ip, roi[0], roi[1], roi[2], roi[3])
|
||||
grayscale(aux)
|
||||
#gaussian_blur(aux)
|
||||
|
||||
if (integration_count>1):
|
||||
if (integration_count>1):
|
||||
frames.append(aux)
|
||||
if len(frames) >integration_count:
|
||||
del frames[0]
|
||||
if not integration_continuous:
|
||||
if (len(frames)< integration_count):
|
||||
if last_ret[1] is not None: invert(last_ret[1])
|
||||
if last_ret[1] is not None: invert(last_ret[1])
|
||||
return last_ret
|
||||
if (not integration_partial) and len(frames) <integration_count:
|
||||
return last_ret
|
||||
@@ -92,13 +89,27 @@ def detect_led(ip):
|
||||
if not integration_continuous:
|
||||
frames = []
|
||||
|
||||
if npoints!=12:
|
||||
save_image(op_image(aux, output,"xor", in_place=False), "{images}/" + str(datetime.datetime.now().strftime("%Y%m%d_%H%M%S"))+".png", "png")
|
||||
#if npoints!=12:
|
||||
# save_image(op_image(aux, output,"xor", in_place=False), "{images}/" + str(datetime.datetime.now().strftime("%Y%m%d_%H%M%S"))+".png", "png")
|
||||
#return (results,aux)
|
||||
return (results,output)
|
||||
|
||||
|
||||
|
||||
|
||||
ip = None
|
||||
|
||||
class MyFilter(Filter):
|
||||
def process(self, image, data):
|
||||
global roi_center, roi_radius, ip
|
||||
ip = load_image(image)
|
||||
(results,output) = detect_led(ip)
|
||||
if output is not None:
|
||||
invert(output)
|
||||
output = pad_image(output, roi[0], 0,roi[1], 0)
|
||||
op_image(ip, output, "xor")
|
||||
return ip.getBufferedImage()
|
||||
|
||||
#Setting the filter to a source
|
||||
img.setFilter(MyFilter())
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
run ("LedDetection")
|
||||
|
||||
|
||||
def integrate (ips):
|
||||
for i in range(len(ips)):
|
||||
if i==0:
|
||||
|
||||
Reference in New Issue
Block a user