Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / - DBPro Coding Challenges -

Author
Message
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 31st Mar 2006 04:48 Edited at: 31st Mar 2006 05:24
Has judging began cause Ric said that when you got to bed on Wensday everything would be judged the next morning! And its Friday here!

When in Trouble with anything visit here your number one stop for help
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 31st Mar 2006 05:30 Edited at: 31st Mar 2006 05:32
@Darth Vader - That's not quite what he said.

He said he would start judging when he got home Thursday night.
I suspect he is working feverishly on it, and may post it tonight or tomorrow (Friday).
Ric often works late into the night, and then into the next morning.
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 31st Mar 2006 05:42 Edited at: 31st Mar 2006 08:02
Sorry I am just getting excited! Were does ric live UK or USA??

When in Trouble with anything visit here your number one stop for help
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 31st Mar 2006 06:16 Edited at: 31st Mar 2006 06:21
Ric lives in the UK.
Sorry for the slow response, we just got through eating dinner
here in San Francisco, CA.

Judging is very hard, takes alot of time.
Ric does a great job, he makes comments about all entries, that takes even more time.
I liked the way Ric does his judging, so I kind of followed his lead, and did my judging the same way.
Hey, thanks for letting me steal...um borrow...um copy your style of judging!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 31st Mar 2006 10:12
Maybe... ummm... Maybe Ric's gotten a little too addicted to one of the entries?




Open MMORPG: It's your game!
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 31st Mar 2006 10:15 Edited at: 31st Mar 2006 10:19
Hey RiiDii - I think Ric fell asleep playing...err a testing...err a judging our entries!
He will have keyboard marks on his forehead when he wakes up!

Hey, I just upgraded to DBPro 6.0 rc3 - and my Pachinko game compiles and plays just like it did for me using v5.9. The only change I had to make was change all the 'floor' variables to 'floorx'.

Really strange stuff going on, that my system works, and your systems don't - wow.

I am using Window XP Pro with SP2 (Service Pack 2).
Is anyone else using the same Windows XP Pro with SP2 like I am, and able to compile my Pachinko game and have it work?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Mar 2006 10:23
@BillR - I have Win XP Home SP2 and am using DBPro 6 RC2 and your code works perfectly after renaming floor to something else, and I also had to change ball size.

Really neat game!

Boo!
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 31st Mar 2006 10:35
@Spooky - Thanks for the info...I don't need to change ball size here.

Glad you like it!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 31st Mar 2006 11:45
Hey folks - sorry for the delay, I forgot when I said I would start judging last night, that it was my girlfriend's and my one year anniversary. We went out for a romantic dinner, and I resisted the temptation to turn on the pc as soon as we got back - don't think that would have gone down too well! So you'll have to wait until tonight I'm afraid!! Ahh .... the suspense ........!!!

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 31st Mar 2006 21:31
I just got back from holiday - dont THINK I'll have time for this one - so bring on the new one

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Mar 2006 22:05
Smart move Ric, I've been there. I'll tell ya from experience, it would've been very bad for you to turn on that PC.


Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Apr 2006 02:16
Nothing yet?

When in Trouble with anything visit here your number one stop for help
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 1st Apr 2006 02:26
I think Ric passed out from the stress of judging.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Apr 2006 02:38
A suggestion for the next challenge... More of a challenge than a game... Wave Physics.

This could be a 2D representation or a 3D one using vertex manipulation. It could be a static set of waves, usefull for sea in a game... It could also maybe include the ability to drop things in the water to make ripples and also include floating objects for riples to reflect off of, or even (for the Ãœber geeks) gaps to produce refraction.

Just an idea... Wave physics looks pretty fun and could be usefull. Maybe also include bonus point for bouyancy?

Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Apr 2006 07:40 Edited at: 1st Apr 2006 12:13
Maybe we should elect a new judge?

When in Trouble with anything visit here your number one stop for help
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Apr 2006 08:04 Edited at: 1st Apr 2006 08:05
maybe you could help him by collating together all the entries? hehe...

EDIT: btw, I made a little start on the fluid dynamics suggestion above...
http://forum.thegamecreators.com/?m=forum_view&t=75598&b=1

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Apr 2006 10:31
Ok - I'm here (went out last night sorry) and I'm judging right now. The results will be in within the next hour. Waves - like that idea Nick. Hope you had a good holiday - see any kiwis?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Apr 2006 12:16 Edited at: 1st Apr 2006 12:19
Quote: "The results will be in within the next hour"


Hey says nearly 3 hours ago

Holiday was fantastic - saw plenty of kiwi's... the people mind you, not the bird.

Here is my thread about it in Geek Culture. A few links to photos there too.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Apr 2006 12:33 Edited at: 1st Apr 2006 12:42
Here goes:

We had 8 entrants to this challenge - not bad! And the standard of work from some of the entrants was really impressive. Coming up with an ultimate winner for this one was tough, because there was such variation in the entries - but in the end, there was a clear winner, and it was based on what I said at the start would be the main criteria - the one I got most addicted to. Heres some feedback on all of the entries:

Virtual Nomad:

Just a screenshot of one of those games you see in a casino - don't know what they're called, though. It looks really nice, I just wish you'd got far enough to post the code.

Hobgoblin Lord:

A first attempt at these challenges - a simple horse racing game. The 'game engine' is pretty much there, in that you can see the horses (boxes) race against each other and you end up with a winner - but as it had no betting system in place, you couldn't call it a complete entry. Hope to see a more completed entry in the next challenge though!

Image All:

A building. Just add gambling game!

Bill:

Pachinko! Never heard of it until now, but I can see why it's so popular in Japan. It's basically what I would call pinball - or at least what really old pinball tables used to be like - when they actually had pins. This is probably the best demonstration of ODE physics I've seen - the balls behave really nicely as they bounce off objects, and trickle through the pins. At first, it's tempting to just fire tons of balls and hope for the best. After a while though, you begin to realise that by adjusting the firing rate, you can actually control, to an extent, where the balls end up - and it becomes more tactical. The overall presentation is great - but I can imagine how you could really go to town on this with media (including sound effects), and would really like to see something in the program announcements forum eventually. The main problem is the compatability. I don't think anybody was able to run the code properly from the snippet, and it's a real mystery. Just one thuoght - did you try running the code from the snippet yourself? I'm just wondering if there's a chance this forum is missing out something when you paste it. Anyway, thanks for posting the exe.

DarthVader:

Horbox Racing! It was good to see this one evolve. It started off quite similar to Hobgoblin Lord's attempt, but you continued to add bits into it, and ended up with something that was very playable. In fact, I spent quite a while playing it yesterday while I was meant to be working. I like the fact that the horses have different chances of winning, in different weather conditions. I'm not convinced that the tips at the beginning are such a good idea though - it might have been more fun to have to work out for yourself which horses had more chances of winning, by trial and error - then you could really feel that you were getting better at it. Nice presentation - and a nice little touches with the camera angle change, and the intro page. Good entry.

Rii:

Prisoners dilema (I think that's what it was called?). On the surface, it's a simple game, and to be honest I thought it was going to be a bit dull. But once you have worked out what you're meant to do (or , once you read the instructions properly!), it becomes quite involving. Eventually, it becomes quite easy to win - and thats where the AI comes in. This is the first piece of code I've ever seen which has AI which actually gets more clever the more it plays. I really want to study this neural network concept when I get time, because it looks amazing. I ran the training code, and managed to get it's intelligence score to -67 after about 600 epochs. I have to say, it didn't make it super clever - it only beat me 3 times before I stole all it's money - but on the other hand, it did draw with me a lot more often than it lost to me. I think the money calculations were a bit off though - I couldn't semm to get over $1000 even when I thought I should have done. In the end, the game becomes a bit like noughts and crosses - you both work out how the game works, and you end up with a stalemate most times. I'd suspect we'll be seeing this AI code again - it appears that it is totally transferable to any game - and that's what amazes me. Good job.

Cucumber:

Dice rolling. It's a game where you roll two dice, and if the total is higher than your 3 random opponents, you win. No betting, so it's not a gambling game, it's just a game of chance. After a few rolls, though, there isn't anything to keep your interest. Plenty of advice was given from forum members as to haw it could be made into a fun game, but you seemed to be reluctant to try and make it any better. Rii even threw in some 3d dice rolling code, which would have been ideal for this.

Mr. Bigger:

Slot machine. Probably the best presented game here - this actually looked and felt like a slot machine. Nice use of 3d buttons, and a good spinning action. I like the little touches like the growing and shrinking effect on the chart. THe actual game play was very simple, and could have benefited from a few added extras to keep interest - like 'nudge', 'hold' and 'gamble' options. Without these, and with what seemed to be like a pretty slim chance of winning anything more than a few $ when you get a single 7, it ends up with you just spinning and watching your money disappear. Good game, which was very close to being a great game, with really nice no media graphics.

And now to the winner:

3rd place:



2nd place:



1st place -







On with the next challenge!

Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Apr 2006 12:48 Edited at: 1st Apr 2006 12:49
Congradulations Bill!!
Thanks Ric!!

Idea for next challenge. How about something to do with shaders? I would love to learn about them!

When in Trouble with anything visit here your number one stop for help
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 1st Apr 2006 13:14
Quote: "Idea for next challenge. How about something to do with shaders?"


I'd have to go out and buy a new PC for that challenge! Shaders aren't supported on my antique pc.

How about an image memblock challenge? I only suggest that because it's one of those things I've never explored, but really feel it's about time I should!

Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 1st Apr 2006 13:20
Thats an Idea, only trouble is I haven't a clue about Memblocks!

When in Trouble with anything visit here your number one stop for help
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 1st Apr 2006 13:41 Edited at: 1st Apr 2006 15:13
YEA!!! - Thanks Ric!
And great job to all the other entries!
Glad you liked my Pachinko game, it sounds like others did too.

I had a lot of fun programming and playing my Pachinko game.
And yes, I tried every version of my source code that I posted.
I copied and pasted every version from this forum into a freshly loaded DBPro to make
sure it ran as soon as I posted it each time.

It was frustrating for me to not have anyone else able to compile and run it without having to change the ballsize.

I upgraded to DBPro 6.0 after I posted the final version for this challenge, I changed the variable 'floor' to 'floorx' and it compiled and ran fine, I didn't even have to change the ballsize.....weird stuff huh.
I have noticed that 6.0 seems to render a little darker.



SO.....On to the next challenge....I am tired it's Saturday 3:40 AM here in San Francisco, too tired to think of a challenge. So I will take suggestions for the next challenge, and hopefully pick one later today.
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 1st Apr 2006 19:06
Quote: "How about an image memblock challenge?"

hehe, i was thinking it's about time i started these challenges... and that seems like a good one for me to start in... mainly because i've already extensively used image memblocks

"We make the worst games in the universe..."
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 1st Apr 2006 19:07 Edited at: 1st Apr 2006 19:07
I re-submit my ideas of a 3d modeler with vertex manipulation or a physics system for the next challenge.


RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 1st Apr 2006 19:09
Congratulations Bill! Looking forward to the next challenge.


Open MMORPG: It's your game!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Apr 2006 19:32
Quote: "i've already extensively used image memblocks "

me too, so dont get your hopes up yet!

For those that haven't, here's a tutorial I wrote on image memblocks some years ago.
http://cca-software.com/darkbasic/tutorial_memblocks.zip


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 1st Apr 2006 22:38
I've used them a lot too - so I think it'd be good fun. For those of us who have used them a lot, we get the chance to explore new fangled ways of using them (maybe transparency effects?) and I'm sure we all know things the others dont. For those who have never used them before all you need to know is that they're so easy you'll want to cry Seriously - all they consist of are 3 values for width and height and depth and then just the pixel colour values as DWORDS...

I quite like my idea of wave physics still. You could go down a number of routes...
1) Using vertex manipulation to create a realtime wave mesh that ripples and so on
2) Using memblocks or pointers to create a 2D wave image as I have been playing with in my other thread I have in the DBP forum
3) Using images to create ripple effects for use on a normal map or bump map.

Plenty to go with there!

I agree with whoever it was that said we should go back to the challenges routes. Games are good for challenges as long as they are simple or can express a single challenge such as spring physics, car physics, lighting, etc, etc.

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 2nd Apr 2006 00:59
Quote: "and then just the pixel colour values as DWORDS..."

and the alpha channel (which you already alluded to in your post but forgot to mention in your list)

so each pixel is just 4 dwords...

oh, btw, completely off topic but my Computer Science teacher pronounces "pixel" really weird, like he's french or something.. "pix - el"

"We make the worst games in the universe..."
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 2nd Apr 2006 02:17 Edited at: 10th Apr 2006 13:02
OK, time for the next challenge!
I like all of your suggestions, thanks for them!
And Nicholas - your wave simulation sounds very interesting also, but may not get many entries, I don't know, maybe too math intensive, something I struggle with sometimes. Your work so far looks good, but I really wanted to see more of a top down view, but maybe that is for another challenge, or incorporate it into this challenge.

Well, several of you have used memblocks before, I never have so this will be new to me, (and Darth Vader it sounds like).


So, the next challenge is:
---------------------------

** Image Memblock Challenge **

Task: Create a visual display using memblock routines. You are free to choose to make yours a 2D or 3D version.
How you apply your memblock images is up to you, BUT, the main emphasis must be special effects or visual effect created by your memblock manipulations.

This will be a good chance for myself, Darth Vader, and all memblock newbies to get some experience in using image memblocks.
For all you experienced memblock users out there, I expect something extra from you. I am a visual person, so really show me what can be done by working with memblocks!

I will be looking for a little flair for this challenge, that little something extra.
It might be a special effect, a visual feast, or just something Kinda Cool!


Deadline: 2 weeks from today - Saturday 15th April. - 11:59 PM PST (California time)
----------------------------

Judging will be based upon:
The entry that I want to watch over and over again! Something that I want to learn how to do myself.

Here is a good place for all us memblock newbies to start!
http://cca-software.com/darkbasic/tutorial_memblocks.zip
Phaelax, thanks for your tutorial here to help get us started!
Halo Man
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 2nd Apr 2006 02:33
Sounds like a good challenge, i'll probably join

Chicago Rush Website: http://chicagorush.servegame.com/
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 2nd Apr 2006 03:50
I am kind of hoping that out of this challenge we can get some COOL routines and functions for special effects on images, for us and others to use. I think that would be a great outcome of this challenge.

So, wherever possible, use a routine or functions, so that these special effects can be copied and used in other programs easily. I know there will be arrays and other support structures involved in many cases, just comment what is needed to transplant these routines.

I'm kind of excited to see what everyones imagination can come up with on this challenge!
Mr Bigger
19
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 2nd Apr 2006 05:50
@Bill- Congratulations!
I`m not sure i'll be participating in your new challenge as i have little experience manipulating image memblocks but i`ll read up on it.

AMD 2600+/1GB DDR ram/GeForce Fx5600 256MB/W2KPro/DBPro 6.0
Better to remain silent and be thought a fool than to speak out and remove all doubt.
Abraham Lincoln
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 2nd Apr 2006 07:08
hello again! It's been a while since I've contributed to these challenges, so I thought this was an excellent time to give it another go!

I have not done a whole lot with memblocks up 'till now, so I decided to do something simple just to get my brain fired up:



It's not interactive yet, but it's a start. Enjoy!
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 2nd Apr 2006 07:09
@Mr. Bigger - I have done nothing with bitmaps before, but I have started because of this challenge. So jump right in, and give it a try!
So far, they seems VERY fast!
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 2nd Apr 2006 07:48
Okay I will give this try, though I haven't the foggiest about Memblock! The only thing I think I know is that they are certain amounts of memory allocation to certain things!?
Not even sure about that! Now weres Phaelaxes tutorial....

When in Trouble with anything visit here your number one stop for help
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Apr 2006 08:26 Edited at: 2nd Apr 2006 09:16
Quote: "so each pixel is just 4 dwords..."


umm no, each pixel is 1 dword, thats 4 bytes. 1 byte per channel.

forgetting about the alpha channel for a moment:



Grrrr, this sucks. They changed how memblocks and images work. Before, if you made a memblock from an image, then any changes you made to that memblock were immediately seen on anything that used that image. (object textures)


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Apr 2006 09:30 Edited at: 2nd Apr 2006 09:32
Ok, here's my first entry in months.

I'm not sure why the fire routine slows it down so much.

There's a neat side effect, plasma effect formed out of the fire. Turn the flame to about 3.94 to 3.7 and see the shift.

Mouse buttons adjust flame, arrow keys move around the cylinder.






Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 2nd Apr 2006 21:19
Cool!


Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Apr 2006 12:22
Just read Phaelax's tutorial. Well whadyaknow - these memblock things are actually really easy! Now the hard part - what to do with this new found knowledge .........

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2006 12:59
I told you memblocks were easy - why do you think I use them so much?
I always say "If somethings hard to do - its probably not worth doing"...

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Apr 2006 14:06 Edited at: 3rd Apr 2006 14:09
Hi everyone, long time no see...

I decided to give it a go too...

Here's some code I wrote a while ago, which some may remember from the code snippets.

Blending images together:



Blending images with a map (like ImageTrans):



[EDIT] Does someone has an algorithm for blurring? Not code, just the theory behind it. thx in advance...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2006 15:45
The most common way to blur is to use weighted averages...
If your pixel is at x,y then you take the surrounding 8 and do some kind of weighting on them.

Maybe do 50% on the center pixel, 8% each on the top, bottom, left and right and then 4.5% on the diagonals (I think that adds up to 100%).

You can also use this method to do things like edge detection. If the above example was (for smoothing):


Then horizontal line detection would be:


You can also expand these matrixes to improve the blur or detection.

NOTE: Those numbers are like ratio's, so in the first one where the center pixel is "4", that would be:
= 4 / (1+1+1+1+ 2+2+2+2 + 4)
= 4 / 16
= 1 / 4

If that makes no sense - lemme know and I'll try to reword it. I covered this type of stuff during my Computer Vision course at Uni.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Apr 2006 13:22
Thx Nicholas, I'll try it out.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Apr 2006 14:09 Edited at: 4th Apr 2006 14:38
Nicholas, you're the best.

Look what I coded in 20 minutes using your theory:



First image = original
Second = 1st time blurred
Third = 2nd time blurred

I have to say the effect is much promising...

[edit] An example:



It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2006 14:16 Edited at: 4th Apr 2006 14:19
Nice!! I'm glad it worked for you.

Next step is to make the mask dynamic and easier to edit... I recommend using either an array or another memblock? Use the same method for 3x3 or 5x5...

EDIT: I can see this challenge producing some really usefull functions - especially if that only took SvenB 20 minute!!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Apr 2006 14:26
Quote: "EDIT: I can see this challenge producing some really usefull functions - especially if that only took SvenB 20 minute!!"


lol, I had your help remember...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2006 14:36
true - but that help took me next to no time to type

It should be pretty easy for you to modify that to take custom matrix's... I'd be interested to see how a horizontal line detection mask comes out

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Apr 2006 14:44
Never heard of horizontal line detection mask... What does it do?

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2006 15:01
Ok, you know how did a weighted average on a complete 3x3 grid? Well what do you think will happen if you still use the 3x3 grid, but only use values of the horizontal middle row?
Say your origional was:


Try using:


Also, take note of what I said above, if you express your grid like this - its easier for human eyes to read. Get the computer to pass over the grid to get the total of it (so for the first one its 1+2+1+2+4+2+1+2+1) then each cell is a fraction of that total.. Which results in:


Am I making sense?

Login to post a reply

Server time is: 2024-11-24 18:03:42
Your offset time is: 2024-11-24 18:03:42