PB is fun

For everything that's not in any way related to PureBasic. General chat etc...
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

PB is fun

Post by JCV »

Besides using PB for most of our utilities in construction like generating scripts for autocad, analysing xlsx files to database, automated tools, etc..
I have a lot of spare time during Ramadan so I created something which interest me and at the same time learning how image recognition works.
I created my own image recognition that is fast enough to recognize any objects in screen and its also useful for optical recognition. I chose a game which is easy to play with and heres my result. This is a 300KB compiled file without using any dll like OpenCV. The speed, size and the memory usage still amazes me. It just show how powerful PB is. :D

So what do you do for fun?

Image

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: PB is fun

Post by Shield »

Looks cool! I'd be interested in getting a little more info on your approach.
What techniques did you use? Can you provide any (online) sources you've been using? :)
JCV wrote:So what do you do for fun?
Unfortunately, nothing with PB anymore except prototyping and small tools... :|
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Re: PB is fun

Post by JCV »

I was looking for a simple image matching library and I found opencv template matching. I saw many questions in stackoverflow about opencv template matching regarding many false detection for transparent images but failed to find a simple solution which doesn't require some additional image processing. http://stackoverflow.com/questions/4761 ... ansparency
Template matching in opencv doesn't support transparency so I created my own version of template matching in PB and later on added more feature for my ocr program.
For my ocr, i created a separate program to count the number of color occurrence and coordinates and later use it to for possible match. and compare possible matches based on that.

You can do similar to what I do in OpenCV which is more capable in processing complex images. My approach only works for images that doesn't require rotation and changing size.

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
Post Reply