18 lines
509 B
Python
18 lines
509 B
Python
run ("LedDetection")
|
|
|
|
|
|
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()) |