Jump to content
ttt480

Determine the number of copies picture on the screen

Recommended Posts

ttt480

Good evening.

Help to understand question.

On the screen is a picture (1.bmp), which shows 4 apples and 2 pears.

I have a picture of one Apple "Example.bmp".

How can the script determine how many copies of the image (from the image "Example.bmp") is on the screen ?

(Script needs to look at the picture "Example.bmp", counting how many copies of it is on the screen and generate the message - with the number found in the screen copies)

Example.bmp

1.bmp

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

What have you tried so far?
We do not spoon feed users here, we teach them to fish ;)

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
ttt480

water, The finished script is not necessary.

Give me an idea.

Share this post


Link to post
Share on other sites
Earthshine

_FileToArray work?


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
water

How should _FileToArray help in this case ??


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
ttt480

Maybe.

I'm not an expert in Autoit.

How to use  "_FileToArray"  in my case ?

Share this post


Link to post
Share on other sites
Earthshine

Get a list of images, or files into an array. Then you have the count and you could compare them was my idea

 

Sorry. I meant _FileListToArray

#include <Array.au3>
#include <File.au3>
#include <MsgBoxConstants.au3>

Local $aArray = _FileListToArray(@DesktopDir, '*.bmp', Default, True)
; Sort the array
_ArraySort($aArray) ; sorts ascemding by default
; display it if you want to or comment out next line as this is usually for debug purposes
_ArrayDisplay ($aArray)

now go compare your imgages and see how many you have.

Use the built in Help file for AutoIt and look up that function for samples.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JLogan3o13

@ttt480 are you really searching for pictures of apples and pears, or something else? Please explain in more detail what you are trying to do, what you have tried on your own, what application this is in, and what your desired end result would be. There may be multiple ways to skin this particular cat, depending on your answers. Help us help you ;)

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
ttt480

JLogan3o13,

Only the example is apples and pears.

Just want to count the number of certain symbols (in this case apples).

Share this post


Link to post
Share on other sites
JLogan3o13

So show a screenshot of the "certain symbols", and what are they contained in (application, web app, etc.). Again, having to pull teeth is not going to get you the help you seek

Edited by JLogan3o13
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
ttt480

Jos

Well.

In reality - I want to count the red circles with a line in the middle.

Just apples - more clear to people.

So I asked for apples, to make people understand.

1.bmp

Example.bmp

Share this post


Link to post
Share on other sites
JLogan3o13

Again, is this in a desktop application? If so which application? Is it in a webpage? If so which site?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Earthshine

did you try what I posted? it will give you the count in element 0 of your array. you can compare the images using other methods you can look up in AutoIt. Set the path correctly to where you want to search for your images from.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
ttt480
5 minutes ago, JLogan3o13 said:

and what are they contained in (application, web app, etc.).

No. This is not an app.

It's just a picture that is open on the desktop (Paint editor).

Share this post


Link to post
Share on other sites
JLogan3o13

@Earthshine if you see not one but two Moderators involved in a topic, please refrain from posting - there is usually a reason.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
JLogan3o13

Ok, paint editor is an application. So you're saying you have multiple instances of the paint editor open, or you're trying to count the number of "apples" in a single paint editor instance?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Earthshine

sorry. hey are MVP's mods too? I kind of figured Jos was because he's developer

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
ttt480

JLogan3o13

I mean:

The script makes the image of the entire screen, that is PrintScreen.

And analyzes the resulting screenshot.

Finds the Example picture, and outputs the message (Msg) on the number of these pictures.

Share this post


Link to post
Share on other sites
JLogan3o13

@ttt480 So you have a script that does at least part of what you want already. Why would you go 19 posts into a thread without sharing that?! How about showing us what you have, so we can see what you're trying to do rather than asking us to guess?

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

×