Author
Topic: playing card compares (Read 1627 times)

I need to create 52 cards images in my program that I want to compare to an on line program. On average that will mean scanning about 50% of the image file in my program to find a match. For Example: I have the image of the 2 of clubs in my program and the on line program is displaying the 2 of clubs. This means I have to scan 52 items to find a match. I'm wondering about the time this will take as I have no control over how fast the next set of images will be displayed in the on line program. The image file in my program should be the same resolution as the card image in the on line program. Any use of 3rd party programs will be to slow. So it has to be done in my program.

1st suggestion for creating the image file in my program. 2nd suggestion for comparing the two image files speedily.

Purpose of the program is for my use only and as we age the memory problems get tougher. Want to keep a record of the cards played for each hand. Thanks for any suggestions.

The image file in my program should be the same resolution as the card image in the on line program. Any use of 3rd party programs will be to slow. So it has to be done in my program.

1st suggestion for creating the image file in my program.

Sounds like a screen grabbing problem. Can you grab imagesof the cards in your on line program? Well, you must if youwant something to compare to, correct?

Quote

2nd suggestion for comparing the two image files speedily.

If you use the same images as the program, just eXclusiveOR the two card images. If they are the same, you end upwith a zeroed image. If there is some jitter in grabbing thecard images, use a minimum/maximum correlation algorithmon the XORed images. Count the mismatched pixels and lookfor a minimum in both number and kind.

Thanks guys for responding.I don't feel that the site I am trying to compare the cards images is cheating in any way.Yes this is related to that program. I have not been working on it constantly because mywife has been very sick for about 3 months.

I am trying to grab images of the cards displayed by the on line program.So far I have not succeeded. I would guess it has something to do with the focus of theon line program and my program OR not able to get the correct handle of the online program.

I think after I am able to read an image from the online program, I then should build anotherprogram to save the 52 cards images I have gotten from the on line program. Then include them in my original program for comparison purposes.

zeddicus

I have not been working on it constantly because mywife has been very sick for about 3 months.

I'm truly very sorry to hear that. How is she doing?

Quote

I am trying to grab images of the cards displayed by the on line program.So far I have not succeeded. I would guess it has something to do with the focus of theon line program and my program OR not able to get the correct handle of the online program.

Sounds feasible, but may not be easy.

Quote

I think after I am able to read an image from the online program, I then should build anotherprogram to save the 52 cards images I have gotten from the on line program. Then include them in my original program for comparison purposes.

Let me know how it all works out. Wish I could be more helpful. But am severely crippled by not having computer and no way of writing and compiling code.

Just in case that my assumption would be wrong that you have already thought about it:

There is no need to compare the entire card. Each card usually has its denomination in two of the corners and checking a 15x20 pixel section (or maybe less) in one of those corners should be sufficient to identify it. All you would need to do is grab images of the chosen corners.

Must have been a super lazy programmer for not drawing cards resembling a real deck of cards.

Many years ago I needed cards for a program of mine. That was before the Windows era and the availability of scanners so that I had to draw my own (I also had to write my own drawing program in order to have the data in a format I could understand!). I made sure the cards would look like the usual physical ones.

Maybe you could give us a link for the site displaying those cards you intend to"duplicate". Someone may have a bright idea.