I'd like to create an interactive tool which draws a circle over an image. 
Sliders will enable the radius and centre position of the circle to be set. 
The following code works, but is very slow:

using PyPlot, Interact, PyCall, Images, TestImages
@pyimport matplotlib.patches as patch

myim = testimage("mandrill")
f = figure()
@manipulate for r in 0:100
    withfig(f) do 
        ax = f[:add_subplot](1,1,1)
        ax[:imshow](separate(myim))
        c = patch.Circle((200.0, 200.0), alpha=0.2)
        c[:radius] = r
        ax[:add_artist](c)
    end
end

Obviously I've omitted the centre location interaction. Running in IJulia, 
the delay between moving the slider and circle changing its shape is 3-15 
seconds. 

Can anyone suggest ways to speed this up? 

Thanks

Andy

Reply via email to