imageSearch 在Win10与win7的运行问题

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: imageSearch 在Win10与win7的运行问题

Re: imageSearch 在Win10与win7的运行问题

Post by SL5 » 05 Dec 2018, 01:48

thanks! great work.

BTW maybe something similar is possible with dynamic Autohotkey (dynAhk)?
I use it a lot but it sometimes loads 2 seconds for a simple message box.

your cachePic-System
probably not help if i use only some few pics(?)

have you ever compared it to the java sikuli2 ? Me, yes for long time. i keep a aye of sikuli.

Re: imageSearch 在Win10与win7的运行问题

Post by d582693456 » 04 Dec 2018, 20:22

SL5 wrote:
30 Nov 2018, 11:35
what is the advantage of this class over a simple imagesearch function?
thanks for you answer,I had Solved the question by used LoadPicture()
load picture to cache before loop lots of pictures, imageSearch can reduce 90% time!

Re: imageSearch 在Win10与win7的运行问题

Post by SL5 » 30 Nov 2018, 11:35

what is the advantage of this class over a simple imagesearch function?

Re: imageSearch 在Win10与win7的运行问题

Post by d582693456 » 25 Nov 2018, 22:18

我循环了100次检索,然后发现,检索的速度与%start_x%,%start_y%, %end_x%,%end_y%检索的区域大小有关

imageSearch 在Win10与win7的运行问题

Post by d582693456 » 25 Nov 2018, 21:24

imageSearch 在Win10与win7的运行比较:

Code: Select all

	;获得每个角色牌区里的五张牌的校详情
getCardsDetail(role)
{
    cards := []
        for index_region, matchRegion in role.matchRegions
        {
            for index, element in Cards52
            {
                card := FindPicture(matchRegion,element)
                ;~ MsgBox,% card
                ;52次循环
                if (card != -1 && card != -2)
                {
                    cards.push(card)
                    break
                }
                if(index == 52)
                    MsgBox,% "有不识别的图片!"  matchRegion.start_x  "x"  matchRegion.start_y  "," matchRegion.end_x "x"  matchRegion.end_y
            }
        }   
        return cards
}

;图片匹配方法
FindPicture(matchRegion,card)
{
	local start_x  := matchRegion.start_x
	local start_y  := matchRegion.start_y
	local end_x := matchRegion.end_x
	local end_y := matchRegion.end_y
	local path := card.path
	ImageSearch, FoundX, FoundY,%start_x%,%start_y%, %end_x%,%end_y%,*190 %path%

	if(ErrorLevel  =2)
	{
		return -2
	}
	else if  ErrorLevel = 1
	{
		return -1
	}
	else
	{
		return card
	}
}
上个星期,我将在win7写的图片匹配脚本,移植到win10系统的笔记本里,结果发现在匹配的这个地方特别的慢,
匹配的思路是:将需要匹配的图片在图片库中进行穷举比较,当检索所有图片依然没有找到能匹配的时候,返回-1,检索成功则返回检索的对象,。
方法在win7的老笔记本里跑的很快,几乎秒读,可是移植到win10的系统里,就需要大约3秒的时间才能检索完毕,虽然依然能匹配成功,请教各位大佬,有遇到过相同问题吗?如何解决?

Top