Comments on: the mean shift filter http://en.nicoptere.net/?p=444 giving something back to the Flash community Sun, 08 Feb 2015 13:47:19 +0000 hourly 1 http://wordpress.org/?v=3.8.1 By: Mr Ming http://en.nicoptere.net/?p=444&cpage=1#comment-3209 Wed, 21 Jul 2010 23:44:28 +0000 http://en.nicoptere.net/?p=444#comment-3209 Great blog!!! wow…Can this be used in flash cs5? Can someone share a working CS5 .fla with separate class so I can learn from it. Basically all I want to do is import an external image at runtime and add this filter on it. I’m a intermediate flash cs5 AS3 user that knows nothing about flex at the time.

With a basic working .Fla that uploads a image and filters it at runtime will be all I need. That will be great if one of you masters can help me..Please reply here or email me at stealburg@hotmail.com Thx and again great blog guys!!!

]]>
By: Median Cut « GrgrDvrt http://en.nicoptere.net/?p=444&cpage=1#comment-834 Wed, 18 Nov 2009 16:55:21 +0000 http://en.nicoptere.net/?p=444#comment-834 [...] Bien sûr tout celà n’est pas à confondre avec avec l’autrement plus compliqué mean shift filter. Bon, trop bien! Cette fois c’est le [...]

]]>
By: nicoptere http://en.nicoptere.net/?p=444&cpage=1#comment-603 Fri, 11 Sep 2009 09:03:29 +0000 http://en.nicoptere.net/?p=444#comment-603 thanks all for the nice words :)

Pixel Bender does excellent job to process a pixel or its close neighbours but it does not handle loops.
as for Andi’s filter, you can see PB limitations pretty soon ; the effect would be more intense if we could increase the radius more.
as mentioned by @Quasimondo, alll it could be used for is this inner loop work. would it be worth?
I read somewhere that the ShaderJobs are much faster for calculations.

@andi: I netvibed your RSS & added it to blogroll, cool stuff there :)

@quasimondo
I’m glad you would’nt leave it alone!
the filter runs so much faster now that one could almost use it for real. thanks lot.

@frank PB of course but within the limitations mentioned above ^^

@rackdoll thanks :)

]]>
By: rackdoll http://en.nicoptere.net/?p=444&cpage=1#comment-602 Fri, 11 Sep 2009 08:20:14 +0000 http://en.nicoptere.net/?p=444#comment-602 Great effect! Nice found! Good job :)

]]>
By: Frank Reitberger http://en.nicoptere.net/?p=444&cpage=1#comment-601 Fri, 11 Sep 2009 07:06:12 +0000 http://en.nicoptere.net/?p=444#comment-601 superb Nicolas. Could be nice to build a PB-Shader on this too… ;)

]]>
By: Mario Klingemann http://en.nicoptere.net/?p=444&cpage=1#comment-599 Thu, 10 Sep 2009 22:28:50 +0000 http://en.nicoptere.net/?p=444#comment-599 Okay I coudn’t leave it untouched and tried to optimize it a bit. It turns out though that there is not that much to optimize in that inner loop since the sliding window around the pixel is moving.

So I did the usual stuff: replace the Array with a Vector and store the pixel infos in a typed object. I took the freedom to move the colorspace from YIQ to YUV which is closer to human perception even though that whole color space change doesn’t seem to make any big difference in the final result – one could leave the pixels simply in RGB and save oneself those back and forth color conversions.

The speedup of using a Vector shows best with bigger radii – at the maximum setting it’s ~2x speed on my machine.

The biggest speedup for small radii was to allow the processing of more than one line per timeout. That will give you ~4x the speed for small radii (the bigger the radius is the smaller the effect of this improvement).

There might be a possibility to replace that inner loop which calculates the distance with a tiny pixel bender filter, not sure how much that will bring.

Here’s the optimized version so far (I have added two more parameters, just to see if the result is any different: minShift controls the size of the pixel shift that has to happen before the iteration is stopped, maxIterations is the maximum amount of iterations per pixel before the loop exits):

http://www.quasimondo.com/scrapyard/MeanShift_opt.zip

]]>
By: Tweets that mention HIDIHO! » Blog Archive » the mean shift filter -- Topsy.com http://en.nicoptere.net/?p=444&cpage=1#comment-598 Thu, 10 Sep 2009 20:17:15 +0000 http://en.nicoptere.net/?p=444#comment-598 [...] This post was mentioned on Twitter by tekool. tekool said: RT @nicoptere the mean shift filter http://bit.ly/ZSndG #actionscript – great effect. I spy with my optimizer eye: deeply nested loops ;-) [...]

]]>
By: Mario Klingemann http://en.nicoptere.net/?p=444&cpage=1#comment-597 Thu, 10 Sep 2009 19:49:18 +0000 http://en.nicoptere.net/?p=444#comment-597 That’s a great effect – thanks for finding and porting it! And I wish I had some time for trying to optimize it a bit right now, but I still have a talk to prepare…

But after a quick look I saw already a few potential areas to gain a few milliseconds.

]]>
By: Andy Li http://en.nicoptere.net/?p=444&cpage=1#comment-596 Thu, 10 Sep 2009 19:46:10 +0000 http://en.nicoptere.net/?p=444#comment-596 WOW! This post is interesting! I’ve implemented bilateral filter in Pixel Bender ( http://blog.onthewings.net/2009/04/14/bilateral-blur-by-pixel-bender/ ) and the result is very similar to the mean shift filter as seen in your post. You should try do the filter in PB too and have a comparison :)

BTW, I’m also doing some 3D thing related to stereoscopic images! But I think I will do it in openFrameworks since Flash is too slow for that…
Hope to read more about your project :)

]]>