Jump to content

PixelChecksum


Recommended Posts

Hello Autoit Community,

I was using PixelChecksum and found that it sometimes gives different values for the same images.

I tried to increase the number of steps, but it sometimes still give 2 different values the same image !

what should i do ?

Edited by Goblin
Link to comment
Share on other sites

It depends on how old you are, but general idea is to finish school, college, find a decent job, get merried and have children.

There are examples of that out there.

But regardles of all that you should always, at least try to, do what pleases you the most.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

It depends on how old you are, but general idea is to finish school, college, find a decent job, get merried and have children.

There are examples of that out there.

But regardles of all that you should always, at least try to, do what pleases you the most.

thx but, what is this has to do with my question ?

Link to comment
Share on other sites

thx but, what is this has to do with my question ?

Sorry, what was your question?

Btw, here's something that could be useful: Question marks go at the end of sentences that are questions. As with full stops you do not put a space before a question mark, but you do need at least one space after one.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Sorry, what was your question?

Btw, here's something that could be useful: Question marks go at the end of sentences that are questions. As with full stops you do not put a space before a question mark, but you do need at least one space after one.

i am sorry if my question wasn't clear.

My question is: PixelChecksum shows 2 different values to 2 similar images (actually two identical images), how to fix this ?

P.S: Increasing number of steps isn't a proper solution in my case (tried it before).

Link to comment
Share on other sites

i am sorry if my question wasn't clear.

My question is: PixelChecksum shows 2 different values to 2 similar images (actually two identical images), how to fix this ?

P.S: Increasing number of steps isn't a proper solution in my case (tried it before).

If PixelChecksum() returns different values, then the images are definitely NOT identical.

Are you sure that the 2 images are in exactly the same position when you run PixelChecksum()?

If only one pixel in the images a slightly different shade, PixelChecksum() will return a different value. The purpose of a check sum is to prove that the 2 are identical, not to prove they look the same.

As a workaround you could try comparing each pixel in the images using PixelGetColor() in a nested loop and count the number of pixels that match. You could then decided if the number of pixels that match is close enough for you.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

@Bowmore: Here is the script used for the 2 images:-

HotKeySet("{NUMPAD0}","RecognizeName")

Sleep(2000)

While 1
    Sleep(1000)
WEnd


Func RecognizeName()
$countryname = PixelChecksum(334, 211, 532, 248, 1)
MsgBox(0,"",$countryname)
EndFunc

and in the attachments u will find 2 images(almost identical) that gave 2 different values.

ExampleImage.rar

Link to comment
Share on other sites

  • Moderators

Goblin,

Sorry to butt in, but the 2 images in your download do not even have the same size! (12,966 vs 12,958). So how on earth can you expect them to give the same result? There is no way they are "identical" - so no way PixelCheckSum will give you the same result.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Goblin,

So how do you know the 2 areas you use are "identical"? The fact you get 2 different answers from PixelCheckSum is pretty conclusive evidence that they are not!

"Click"

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@Melba23: Because i captured the same why.

Actually, what i am trying is some kind of simple OCR (limited OCR) for a simple bot for a game (not for a Captcha).

Example:- When it see "Brazil", it select it's flag.

In the attachments a better image.

ExampleImage2.rar

Edited by Goblin
Link to comment
Share on other sites

Problem Solved, the problem was in the game itself, i made it in Low Quality so the game made some kind of (small random deformation) on the screen that changes every time the game opened, thx u all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...