from ijutils import *
import java.awt.Color as Color


ip2 = load_image("images/img2.png", title="Image2")

ip3 = new_image(256, 256, "color", fill_color = Color.WHITE)
ip4 = new_image(256, 256, "color", fill_color =Color.WHITE)

copy_image_to(ip2, ip3, 25, 25)
copy_image_to(sub_image(ip2, 11, 33, 24,24), ip4, 123, 123)


#Correlate, convolve, deconvolve
grayscale(ip3)
grayscale(ip4)

cor = op_fft(ip3, ip4, "correlate", True)
con = op_fft(ip3, ip4, "convolve", True)
dec = op_fft(con, ip4, "deconvolve", True)

create_stack([ip3,ip4, grayscale(cor,False),grayscale(con,False),grayscale(dec,False)], title = "Correlation").show()

