Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Logo > Re: [LogoForum]...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 1572 of 1588
Post > Topic >>

Re: [LogoForum] Re: Focusing and "Unfocusing" pixels

by "John St. Clair" <john.stclair@[EMAIL PROTECTED] > Mar 3, 2008 at 01:06 PM

The message below is being cross-posted from the LogoForum.  Please 
reply here at comp.lang.logo and it will be cross-posted back to the 
LogoForum.  The original author of this message is 
Andreas.Micheler@[EMAIL PROTECTED]
 Juan,

In aUCBLogo-4.8 this will be possible:
to test_imagefilter
clearScreen
im=loadImage "grass.jpg
width=(BitMaxX im)+1
m=reRGBA toMatrix im
; simpleLowPass m
FFTfilter m
im2=(Bitmap RGBA m.1 m.2 m.3 m.4)
BitPaste im2
end

to simpleLowPass m
filterstrength=2
repeat 2
[ for [i 1 4][m.i=lowpassFilter m.i filterstrength]
for [i 1 4][m.i=transpose m.i]
]
end

to FFTfilter m
for [i 1 3][m.i=FFT m.i]
mx=MatrixWidth m.1
my=MatrixHeight m.1
x0=int mx/2
y0=int my/2
r=int mx/5
Home
setFloodColor RGB 0 0.2 0.5
fillRect (list -x0 -y0)(list x0 y0)
setFloodColor rgb 1 1 1
PenUp
setXY x0 y0 fillCircle r 
setXY x0 -y0 fillCircle r
setXY -x0 y0 fillCircle r
setXY -x0 -y0 fillCircle r
bm=BitCopy mx my
bm=BitResize bm mx my
BitMakeTransparent bm 0
mask=Array 3
mask.1=(Float (BitAnd (Array bm) 255))/255
mask.2=(Float (BitAnd LShift (Array bm) -8 255))/255
mask.3=(Float (BitAnd LShift (Array bm) -16 255))/255
for [i 1 3][m.i=(toMatrix (Array m.i)*mask.i)]
for [i 1 3][m.i=invFFT m.i]
setXY x0+10 -100
end

to zero_circle m
for [y -r r]
[ for [x -r r]
[ if (sqrt x*x+y*y) < r
[ ix=saturateAbove mx saturateBelow 1 x+x0
iy=saturateAbove my saturateBelow 1 y+y0
m.ix.iy=0
]
]
]
end

This already works here, :-)
but I have problems with the stability of aUCBLogo-4.8,
the checks dont pass, so I cannot upload it yet.

The FFTfilter routine multiplies the spectrum of the image with a mask,
which is generated simply by drawing.
The mask is split in the three color channels.
So you can generate pretty much any FFT image filter effect. :-)

Cheers,
Andreas
__._,_.___
LogoForum messages are archived at: 
http://groups.yahoo.com/group/LogoForum




 3 Posts in Topic:
Re: [LogoForum] Re: Focusing and "Unfocusing" pixels
"John St. Clair"  2008-03-03 13:06:51 
Re: [LogoForum] Re: Focusing and "Unfocusing" pixels
"John St. Clair"  2008-03-03 13:09:08 
Re: [LogoForum] Re: Focusing and "Unfocusing" pixels
"John St. Clair"  2008-03-03 13:12:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:06:23 CDT 2008.