BBC BASIC for Windows
« BoxBlur 2 »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:02am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: BoxBlur 2  (Read 479 times)
David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx BoxBlur 2
« Thread started on: Jan 3rd, 2013, 03:49am »

If you haven't heard of 'box blurring' then consider looking it up!

Here's a BASIC prototype of a new, relatively fast box-blurring routine (includes EXE):

http://www.bb4wgames.com/temp/boxblur2_basic_prototype.zip

Try a value of 27 when asked for the filter window size.

It takes around 20 seconds to blur an image on my laptop (it is in BASIC, after all).

I know the unpleasant visual artefacts that can arise when using a square filter, but it's fine for its intended purposes (i.e. not broadcast-quality image processing!).

It should be much faster than the current, pretty dreadful GFXLIB_BoxBlurNxN routine after it's been translated to assembly language.

The image in the demo is that of the once-beautiful French actress, Emmanuelle Béart (before she ruined her looks with disastrous plastic surgery and which she now campaigns against).

The BB4W version was adapted from the source code at Mattias f*gerlund's Coding Blog:

(I don't know why this forum's software has inserted an asterisk in Mattias's surname.)

http://lotsacode.wordpress.com/2010/12/08/fast-blur-box-blur-with-accumulator/



My gratitude to Mattias! (To whom I will duly drop an e-mail.)


David.
User IP Logged

David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: BoxBlur 2
« Reply #1 on: Jan 3rd, 2013, 12:23pm »

A demo of a somewhat suboptimal assembly language implementation of Mattias's algorithm:

http://www.bb4wgames.com/temp/boxblur2_asm.zip

Use the left/right mouse buttons to decrease/increase the filter window size.

Certainly not as fast as it could be, but a darn sight faster than the current GFXLIB_BoxBlurNxN routine (and better in other ways).


David.
--
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: BoxBlur 2
« Reply #2 on: Jan 3rd, 2013, 3:56pm »

on Jan 3rd, 2013, 03:49am, David Williams wrote:
If you haven't heard of 'box blurring' then consider looking it up!

I've not heard that term, but isn't it identical to the more familiar 'running average' (or 'moving average') filter?

http://en.wikipedia.org/wiki/Moving_average

Quote:
(I don't know why this forum's software has inserted an asterisk in Mattias's surname.)

I suspect you do! I must admit, however, that in a mainly UK-centric forum it isn't really appropriate to censor that word: this side of the pond its common meaning is innocuous. My dictionary describes the 'offensive' meaning as "Slang, chiefly U.S. and Canadian".

Indeed many of Conforum's automatic substitutions are laughable, for example any reference to 'b*t*h' will be changed to 'pregnant dog' (it's not even accurate: my dictionary says 'female dog'), and as you've found the words are recognised not just in isolation but as part of a longer word.

So I think there's a good case for drastically pruning the 'profanity' list to include only the most offensive and commonly used swearwords; I've now done that for the groups I administer.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls