efficient way to compare 2 images? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: efficient way to compare 2 images? (/showthread.php?tid=1151) |
RE: efficient way to compare 2 images? - Kernelpanic - 11-18-2022 Quote:That's what I'm wondering. Your image comparison is a core problem of the AI: Pattern recognition/comparison, or something. I don't know the exact name at the moment. The problem was already described by Hubert L. Dreyfus in his first book in 1972: "What Computers Can't Do: The Limits of Artificial Intelligence". This pattern recognition is essential for the survival of all living beings. For example: A deer must recognize at first glance whether what it sees is harmless or dangerous (such as a wolf). All the best! Really! - Show the eggheads what basic programmers can do. RE: efficient way to compare 2 images? - SpriggsySpriggs - 11-18-2022 Or, very simply, MEM both images and compare the data within for equality by putting the data into a string and checking image1$ = image2$ RE: efficient way to compare 2 images? - SpriggsySpriggs - 11-18-2022 (11-18-2022, 09:08 PM)Kernelpanic Wrote: A deer must recognize at first glance whether what it sees is harmless or dangerous (such as a wolf)I don't know, man. Deer are quite retarded. A deer will jump at the slightest twig movement but will watch a 2,000 pound metal machine roar towards it and not budge an inch. RE: efficient way to compare 2 images? - Kernelpanic - 11-18-2022 (11-18-2022, 09:10 PM)Spriggsy Wrote:(11-18-2022, 09:08 PM)Kernelpanic Wrote: A deer must recognize at first glance whether what it sees is harmless or dangerous (such as a wolf)I don't know, man. Deer are quite retarded. A deer will jump at the slightest twig movement but will watch a 2,000 pound metal machine roar towards it and not budge an inch. Because the machine doesn't know it and therefore can't classify it (first time): dangerous or not PS: There is a video (but where now), about twelve years old, that shows the German Bundeswehr during target practice with howitzers - and about 200 to 300 meters away deer are grazing peacefully. Why? Because they've realized by now that the banging isn't aimed at them. RE: efficient way to compare 2 images? - James D Jarvis - 11-18-2022 squish the two images down to a really small image. If they don't match when they are 2 by 2 pixels they sure aren't going to match when they are say 200 by 200 pixels. if it matches keep comparing pixels by pixel in slightly larger scaled image until back up to original size. crude example: Code: (Select All) Screen _NewImage(800, 500, 32) RE: efficient way to compare 2 images? - SpriggsySpriggs - 11-18-2022 Code: (Select All) Option Explicit RE: efficient way to compare 2 images? - madscijr - 11-18-2022 (11-18-2022, 09:08 PM)Spriggsy Wrote: Or, very simply, MEM both images and compare the data within for equality by putting the data into a string and checking image1$ = image2$ So far, this sounds pretty workable. Thanks! (I could just manually include fill points in the shape data, but it's fun to solve problems like this!) RE: efficient way to compare 2 images? - Pete - 11-18-2022 If the images are in a file, just open each into a variable with BINARY. If the variables are equal, the images are the same.... Pete RE: efficient way to compare 2 images? - SMcNeill - 11-18-2022 An example with 720p images at play: Code: (Select All) Randomize Timer RE: efficient way to compare 2 images? - SMcNeill - 11-18-2022 (11-18-2022, 09:30 PM)Pete Wrote: If the images are in a file, just open each into a variable with BINARY. This may not work for a variety of reasons. Different formats of the same image. One was saved compressed, the other wasn't. One has additional file attributes attached to it, that the other doesn't. You'd want to load the files into memory and compare the contents of the image once they're loaded. After all, you want to know if the IMAGES are identical; not the files which contain them. |