My goal is to create a program that plays Mahjong. I figured the algo would be a bit like this:

While there are blocks left {
Fetch new board
Recognize blocks //find 2 of the same images within the image.
Find free blocks //not *really* necessary: computer versions don't allow the non-free blocks to be clicked/removed, so the program can click away.
Check which ones are the same and remove those. //Will send input, but this part is covered. 
}

So obviously there are tons of algorithms for image recognition, but I was wondering if anyone knew the the simplest way of image recognition. What bubble sort is to sorting, this algo needs to be to image recognition. ;)

Thanks in advance,

So you are wanting to read a board created by another program. You want to read a screen capture of it?

How many different pieces in mahjong?

If the pieces are different enough and there's not too many, you could probably figure out something simple.

You want to read a screen capture of it?

Yes, the idea was to screen capture the board.

How many different pieces in mahjong?

I have no clue, but I think it differs per puzzle.

you could probably figure out something simple.

Perhaps, hehe. But I don't think it depends on how many different pieces there are, my algorithm with search for exact matches, which is possible since the tiles are exactly the same.

Just image recognizing only won't solve the Mahjongg game, as the program also has to respect the rules of the game, but I assume this isn't the problem ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.