Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started by: Shockwave on July 20, 2011
-
An example of a realtime Sobel Edge Detection routine.
Also, a little pixellation effect to make it a little more interesting.
Sorry for the small screen but it's pretty intensive and requires two 3*3 masks to be applied to each pixel and calculations on the results.
Anyway, a Youtube video is coming for those who have difficulty running this.
There are a lot of selectable options you can use to see how different effects look with this filter, all totally interactive :)
Hope you enjoy it!
Btw: The binary is packed with UPX - if your AV software gives an alert, it's your AV software and not the intro!
I'll edit in the vid as soon as it's uploaded to Zootube..
Edit: [Video added]
Please note that the video is captured at 30fps - it looks better if you run the binaries..
[youtube]t-19VMItegg[/youtube]
-
Awesome demo! Lovely effects and it all runs really smooth! :clap:
Text was a bit hard to read at times.
-
Ah, cheers Kirl - I probably could have chosen a bigger font but I really love Frankie Ghost.. There's not much interesting text anyway I should make more of an effort next time! :)
-
That is so Cool :clap:
It run so smooth on window and full screen! :)
-
Thanks Hotshot, glad you liked it and it ran smooth for you.
-
Runs super smooth for me.
Very nice Shockwave! Good work on all the different toggles too, lots to play with :)
-
Wow, this is indeed awesome stuff and just rules! (http://www.webanarchy.net/v3/images/smilies/jawdrop0.gif) Music's nice too. Well done!
-
No problems running it on my computer, and that sobel effect is really nicely done. Also cool that you allowed for some interactivity.
-
Thank you very much for the kind comments!
I'm pleased that it's running full frame rate for you so far :) Makes me think I could have maybe pushed the resolution a bit higher...
-
Very well done mate :goodpost:
-
Hey, lots of stuff happening here, and very fast! I'm actually quite impressed with the raw speed of this.
-
Thanks guys :)
-
It runs smooth even with my AV switched on ???
Still, I do like the range of effects, this time simultaneously. Excellent effort, and the tune is catchy.
The F-Key options are a plus too. Choosing a winner is going to be difficult again, but that's one of the things that makes these competitions worth entering.
-
It runs smooth even with my AV switched on ???
I am really glad to hear that... There are over 20 calculations needed for each pixel in the Sobel area, I really did think that this was going to frame out on a lot of systems.
-
From the looks of it, it works a lot faster than Flash.
-
Awesome work Shocky.
-
Absolutely fantastic job there. I did not expect that a complete intro is the result of this competition really. But you
make a outstanding intro there. Very well done, mate! :clap:
-
Thanks :) I'm really glad you both liked it!
-
This is a very polished demo given the time that you had to work with.
I never really never cared for the Sobel filter until your demo!
Through adjusting the settings you can really see that there is not just one size fits all approach with such a filter I like that you have let us see the demo from different approaches.
I also like the pixely bottom filter it is pleasant and really makes you see how data can be crunched down with resolution. (I think it looks great)
The time spent to create different shapes and effects behind the square sobel filter is also noted, well done showcasing the effect on different subjects.
-
I'm jealous of the smooth tunnel alone, the rest of the effects are just rubbing it in my nose! ;D
[edit] That seems weird, I believe that sould be: rubbing my nose in it... ???
-
Thanks both your comments are very kind :)
-
:clap: Marvelous! So... demo :P
-
Its a cool demo, looks great. I only have a dissapoint wich is based in the limitated effects that reduces to a window filtering real-time. I guess that all those animated graphics may create some spectation and after all i was really specting to find more effects. Thats the worst i have to say, anything else is great. I have no problem to watch it speedy, no slow-downs in my computer so it moves perfectly smooth and everything is cool. Remember me old paradox demos in playstation games, even the music. Nice to see. Good work
-
Its a cool demo, looks great. I only have a dissapoint wich is based in the limitated effects that reduces to a window filtering real-time.
I decided on the Sobel filter which needs to do over 20 calculations per pixel so I had some choices to make about it.
I could have applied the filter to a static image and not cared about the resolution but this is running over some real time effects so I had to either do it within something more powerful than Freebasic, like shader language (which I don't know), or sacrifice the framerate to have a higher resolution, or reach a compromise which I did.
I decided that it would be nice to have a window where you could see the sobel filter affecting a real time image so you could see it acting on something live and moving.
If you consider that my code is actually doing the following loop on the sobel part of the screen, maybe you can appreciate better why the window is small.
DIM AS DOUBLE INOUT
INOUT = 120
PP2=@RENDER_BUFFER((xres*70))
FOR Y = 70 TO YRES-70
PP3=@SCREEN_BUFFER(X+((Y-1)*XRES))
FOR X = 0 TO XRES-1
IF ( Y < 1 ) OR (Y >= YRES-1) OR (X < INOUT) OR (X >XRES-INOUT) THEN
*PP2 = * PP3
ELSE
SUMX = 0
SUMY = 0
PP=@SCREEN_BUFFER(X+((Y-1)*XRES))
FOR I= -1 TO 1
PP-=1
FOR J=-1 TO 1
CURP = *PP+J
SUMX += CURP * GX(J+1,I+1)
SUMY += CURP * GY(J+1,I+1)
PP+=1
NEXT
PP+=XRES
NEXT
SUM = ABS((SUMX)+ABS(SUMY)) * SOBELSENSE
*PP2 = PALETE (SUM)
END IF
PP2+=1
PP3+=1
NEXT
NEXT
Your point of having a limited number of effects is a fair one though, I used up all the time I could by trying to add a variety of effects so you could see the soblel working on them instead of perhaps having one effect and more filters.
-
FOR I= -1 TO 1
PP-=1
FOR J=-1 TO 1
CURP = *PP+J
SUMX += CURP * GX(J+1,I+1)
SUMY += CURP * GY(J+1,I+1)
PP+=1
NEXT
PP+=XRES
NEXT
Since the 3x3 sobel matrix (http://en.wikipedia.org/wiki/Sobel_operator#Formulation) is symmetric you can separate it into 2 passes, each using a 3x1 matrix:
( 1 ) (-1 0 1 )
(1,0,-1) * ( 2 ) = (-2 0 2 )
( 1 ) (-1 0 1 ) This way you just need six adds instead of 9 multiply-add.
-
That's a nice optimisation, thanks Hellfire it didn't occur to me to do it that way :)
K+
-
:o
lovely effect, nice feeling... love it every time i give it a run!
-
I might have said this before, but I'll say it again - 5 effects running simultaneously, this smoothly - words cannot describe how excellently brilliant this is.
-
Thanks guys, you're very kind :)