Imagesearch using gdip

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rakesha002
Posts: 46
Joined: 04 Dec 2017, 00:11

Imagesearch using gdip

14 Jan 2021, 08:45

Hello,

I need help in Imagesearch using gdip to fit my needs (my requirements are very complicated, sorry)
Haystack.png
Haystack.png (7.07 KiB) Viewed 953 times
In Haystack- same symbol 5 times, 1 time it is inverted, i need to find the inverted one,
The color, rotation, size, width of symbol varies (may not be the same) and
Every time i refresh window a new haystack with new symbol (same symbol 5 times and one inverted)

I tried converting Haystack into monochrome which reduces color issue-------1
I could use gdip rotate functions which reduces rotation problem---------------2 takes much time, and so on for other parameters
for which entire process will much more time because i had to search many needles to find the right one first shape and then other parameters,

What I really want to ask gdip and image-search coding experts is,
is there a better way to find my needle or perhaps finding all non-rotated symbols to find the black sheep (in that case i need an example code).
Thanks in advance.
note : i am not an expert in this by the way.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Imagesearch using gdip

14 Jan 2021, 08:52

One idea is to use optical character recognition to read the text, and then see if the text matches what you need. I do not know whether it will work.
rakesha002
Posts: 46
Joined: 04 Dec 2017, 00:11

Re: Imagesearch using gdip

14 Jan 2021, 09:03

Hi,

Thanks for the quick reply,
Tried the OCR thing, actually a few which are close to end result but not accurate for my situation, sorry i forgot to mention that.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Imagesearch using gdip

14 Jan 2021, 09:16

Since color, rotation, and size may vary, you are looking at a pattern matcher rather than a single AHK command. There are some face recognition scripts on the forum that you might be able to adapt somehow.
rakesha002
Posts: 46
Joined: 04 Dec 2017, 00:11

Re: Imagesearch using gdip

14 Jan 2021, 09:28

Hi mikeyww,

Now That's a new angle to look, nice suggestion, i will try and search in the forum meanwhile can you point me out bit more
if it is possible, thanks

Edit: You gave me good and new thinking angle about "pattern matcher" if i could find pattern of similar symbol, it is easy but it is way over my head.
Any further help is much appreciated Thanks.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Imagesearch using gdip

14 Jan 2021, 10:38

I can't add much. I don't think it will be very easy, but with enough effort, could be done! If you search the forum for "face recognition", there are some scripts by @malcev there.
rakesha002
Posts: 46
Joined: 04 Dec 2017, 00:11

Re: Imagesearch using gdip

16 Jan 2021, 02:19

Hello,

I'm trying to dig deep as "mikeyww" suggested, with no success,
i still need help, i'm all ears(eyes actually to read), any help, any suggestion would be great, thanks.
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Imagesearch using gdip

16 Jan 2021, 03:12

You can look for python+opencv examples how to do it.
rakesha002
Posts: 46
Joined: 04 Dec 2017, 00:11

Re: Imagesearch using gdip

16 Jan 2021, 08:50

Hi,

I will try that first thing tomorrow,
A link (if it is possible only) would be a great help, where to start instead of searching the web. Any way thanks for Suggestion.

Thanks
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Imagesearch using gdip

16 Jan 2021, 09:20

I did not do it, therefore I dont have links.
May be it can be done with cvFindContours.
We discussed about it here:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=77046
And after that compare contours with cvMatchShapes function.
https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=matchshapes#matchshapes
OpenCv - is not easy stuff and therefore it will take some time from You to create algorithm and translate it to ahk.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], peter_ahk and 365 guests