Jump to content

Recommended Posts

Hello

Just the same Dissociable.OCR not going to talk so much LOL

But it's a bit more complicated and needs more information than that one lol

Here we go.

 

I have coded a DLL file in C# to do Image Matching, Yes it is Dissociable.Matching.dll .

But why? why not just simply use ImgLoc? Here we go for some reasons:

  • Alpha Channel support (Ignore Transparent Pixels).
  • Three Pixel Comparison algorithms, Simple per-channel difference comparison, CIE1976 comparison and CIE2000
  • Boosted Multi-Threading. not processing several template files using Parallel, but processing pixels in a Multi-Threaded manner.
  • Smart! It detects if it costs less time by processing several template files using Parallel instead of Multi-Threaded Pixel Processing. like when the Source Image Height is less than 200.
  • GUI available to debug bunch of Images.
  • Bundling and Bundle extraction.
  • Dependency free!

However, ImgLoc also was/is the result of @trlopes's hard work with so many functions that the BOT relying on.

 

Q&A:

Q: How can i get all these fantastic things?

A: Just click the link below!

https://mega.nz/file/0G52QB4B#VSpC2pzQ84c7iMhLvcQtNnphftEL5Lbr1BWfjdFUvTI

 

 

Q: I'm getting a message regarding the name. why?

A: Because. never rename my boy's name.

--- End Q&A ---

 

Documentation

 

  • Find

The 'Find' function has 11 parameters!

Parameters and defaults: IntPtr sourceHandle, string templatePath, ushort levelStart = 0, ushort levelEnd = 0, ushort regionX = 0, ushort regionY = 0, ushort regionWidth = 0, ushort regionHeight = 0, ushort threads = 32, ushort limit = 0, bool saveDebugImage = false

  1. sourceHandle: hBitmap of source image you willing to search images in.
  2. templatePath: The Path to Directory or Bundle (.dmat) file containing template images to search in Source Image.
  3. levelStart: The Starting level that the dll will start searching for. Default: 0 = No level limit
  4. levelEnd: The Highest level that the dll can search for. Default: 0 = No level limit
  5. regionX: The X point that the dll will start from in Source Image. Default: 0 = 0
  6. regionY: The Y point that the dll will start from in Source Image. Default: 0 = 0
  7. regionWidth: The Width of the Rectangle that the dll will search in within the Source Image. Default: 0 = Source Image's Width.
  8. regionHeight: The Height of the Rectangle that the dll will search in within the Source Image. Default: 0 = Source Image's Height.
  9. Threads: The amount of the threads that the dll will create to search within the pixels. Default = 32 - NOTE: Will not process pixels in a Multi-Threaded manner for Source Images with Height lower than 200.
  10. Limit: Limit the number of matches. Improves the performance by not processing leftover template images or the leftover pixels if reached to the limit. Default: 0 = No limit.
  11. saveDebugImage: Save Debug Images. If true, two images will be Saved in 'Dissociable.Imaging.DebugImages' Folder located in dll folder. The first one is the Source Image used to search templates in. The second one also is the Source Image, but with marked up found points. NOTE: Second Debug Image will be Saved "ONLY" if it get any matches.  NOTE2: Debug Images are saved in Sub-folders for each Bundle file/dir to be more organized (bundles with small file name/dir name will have some sub-folders name in folder name).

NOTE: All parameters has to be passed to 'Find' function, but you can use their defaults.

 

  • GetVersion

The 'GetVersion' function has no parameters. this function returns the dll version.

 

  • CreateBundle / ExtractBundle

There are also 'CreateBundle' and 'ExtractBundle' functions. but i recommend you use the GUI. NOTE: GUI also uses those functions of the dll. but you don't need coding 🙂

 

 

Template Files

They must be a 32-bit png files.

Their names must be in this format: ObjectName_MaxDiff_PixelComparisonAlgo_Level.png

Defaults: "_0_S_0.png"

After the level, you can include anything. doesn't make changes.

Available Pixel Comparison Algorithms:

  • CIE76
  • CIE2000
  • S (NOTE: S Stands for Simple, anything else than CIE76 (or CIE1976)/CIE2000 will be compared by Per-Channel Difference Comparsion)

NOTE: S is so Simple, Fastest comparison. then we get CIE76, it has a few math BUT then we have CIE2000 comparison, its complicated so it is slowest.

 

Examples

Example .au3 file and bundle has included within the download archive.

 

 

Let me know if you have found issues or bugs right in here. Impossible🤴.

 

 

The GUI Mapping Files

Q&A:

Q: What is that?!

A: GUI can load a 'map' file so you can map your images to it.

---

Q: Whats the point of having map files and mapping images?!

A: The GUI will always check if that objects and that amount is found. then it will tell you if it Is a Match or Not. Matches are Colored green while NotMatches are Red!

---

Q: Wow! so it helps me debug thousands of images within a minute! right?

A: Yes! You don't need to see every image's points and debug image.

---

Q: Wait what? Debug Image? I still want to see that! where's it?

A: Click on the Source Image you want which is listed in the Grid. Surprise.

---

Q: How can i create map files?

A: place a 'dmat.map.txt' file in the same folder as your Source Images folder.

---

Q: Just that? will i have a map file by just creating that txt file?

A: No! Map files must have a line 'Per' Source Image, The line format is: FileNameWithExtension:ObjectName|ObjectLevel|ObjectCount

---

Q: Can you tell me an example of a line of a map file?

A: Why not. SourceImage.png:Elix-14-7|Inferno-6-2

---
Q: What if i don't care to the level or count of the objects?

A: Make it like Inferno-0-0

---

Q: Do i need to map all Source Images?

A: No, you can even map just one image! the others will have 'NoMap' in their Status column

---

Q: Is it even necessary, all these map file things?

A: No! It will get you the matches and debug images and all. but just it will not tell you if all required things been found or not, you will get 'NoMap' in status column.

---

Q: I'm amazed of all the works you did! what can i do for you?

A: Buy me a beer! 16Sod3Ak914m5kHWdDyshgf9k92qLKuCFY (BTC)

 

Edited by LookMomImOnTheWeb
DLL v1.0.7.0 - GUI 1.0.1.0
  • Like 4
  • Upvote 2
Link to post
Share on other sites
  • 4 weeks later...
On 9/7/2020 at 6:20 AM, Boldina said:

I don't know why, but sometimes it reaches the middle it stops finding points, sometimes.

 

A certain amount of searches cuts in the middle of the image

Impossible.

 

===========

 

Updated the first post with Dissociable.Matching.dll v.1.0.0.4:

- Fixed issue with WinAPI captures.

  • Like 2
  • Upvote 1
Link to post
Share on other sites

Updated the first post with Dissociable.Matching.dll v.1.0.5.0:

- Added TrainImage function.

 

Dissociable.Matching.GUI v.1.0.1.0:
- Added GUI options for TrainImage function.

 

Q&A

Q: What's TrainImage function? huh?

A: A function to Train Matching image files!

 

Q: Woah! How you made such a function that needs so much brain and focus?

A: Well, No AI or things like that. FOCUS! The function goes through each template (all png files in directory entered) within specified rectangle and ONLY keep the pixels that matched with the MaxDiff you specified in ALL templates. Imagine you collected 200 images of 'Level 14 Elixir Collector ' in specific rect of COC. you make a Source image of that 'Level 14 Elixir Collector ' (Simple crop), then set RECT and templates directory and it will make you a .png file that was able to recognize all the 'Level 14 Elixir Collectors ' in all those 200 template images, whether the background changed or not! it will get you a template that match 'em all. which MIGHT result in accurate bundles, not guaranteed... the resulted images always has to be tested.

The resulted image might even be a full transparent png file, but guess what! that matches all! genius! JK, delete 'em.

 

Q: More details?

A: Hover on the fields, count to 1, Tooltip is with you.

Edited by LookMomImOnTheWeb
  • Like 1
  • Upvote 1
Link to post
Share on other sites
On 27/9/2020 at 6:03, LookMomImOnTheWeb dijo:

Updated the first post with Dissociable.Matching.dll v.1.0.5.0:

- Added TrainImage function.

 

Dissociable.Matching.GUI v.1.0.1.0:
- Added GUI options for TrainImage function.

 

Q&A

Q: What's TrainImage function? huh?

A: A function to Train Matching image files!

 

Q: Woah! How you made such a function that needs so much brain and focus?

A: Well, No AI or things like that. FOCUS! The function goes through each template (all png files in directory entered) within specified rectangle and ONLY keep the pixels that matched with the MaxDiff you specified in ALL templates. Imagine you collected 200 images of 'Level 14 Elixir Collector ' in specific rect of COC. you make a Source image of that 'Level 14 Elixir Collector ' (Simple crop), then set RECT and templates directory and it will make you a .png file that was able to recognize all the 'Level 14 Elixir Collectors ' in all those 200 template images, whether the background changed or not! it will get you a template that match 'em all. which MIGHT result in accurate bundles, not guaranteed... the resulted images always has to be tested.

The resulted image might even be a full transparent png file, but guess what! that matches all! genius! JK, delete 'em.

 

Q: More details?

A: Hover on the fields, count to 1, Tooltip is with you.

I did the same to detect the green dots.

---

Can we apply this intelligence to AIO?

Edited by Boldina
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...