Errors in Image recognition

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jeroen Sloendregt
Newbie
Posts: 5
Joined: Mon Feb 23, 2009 12:54 pm

Errors in Image recognition

Post by Jeroen Sloendregt » Mon Feb 23, 2009 1:02 pm

Dear All,

I try to get the IR to work propperly. what I want to do is have the MS goto another worksheet in excel by finding the tab though IR.

This is my macro: (which I actually copied from the help-video)

// FIND TABBLAD
//GetScreenRes>sX,sY
//ScreenCapture>0,0,sX,sY,C:\macro\picture\SCREEN.bmp
FindImagePos>C:\macro\picture\tabblad.bmp,SCREEN,20,1,XPos,YPos,imgs


if>imgs>0
MouseMove>XPos_0,YPos_0
LClick
endif

(first two lines is commented because it seems that is not needed anymore in my version: 11.1)

First: the tabblad.bmp is a 0KB file.. (made by MS capture tool)
second: I get an error on the 'findimagepos' line: access violation at address 00310210 in module msched.exe

anyone any idea what goes wrong???

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 23, 2009 1:46 pm

If tabblad.bmp is a zero byte file then that is your problem. Try recreating t.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jeroen Sloendregt
Newbie
Posts: 5
Joined: Mon Feb 23, 2009 12:54 pm

Post by Jeroen Sloendregt » Wed Feb 25, 2009 9:30 am

Thanks for your reply,

in fact I tried several times (it is not that hard ;-)
I select the 'findimagePos' function,
click 'capture'
then menu 'capture'; 'screen after 5 sec delay'
(because I want to get a capture from my excel file; but it doesnot work in other windows as well)
i select the button I want (size +/- 1x3cm)
click: file/save as in image capture window
save the file...

In explorer it is 0KB
:(

where does it go wrong?

Jeroen Sloendregt
Newbie
Posts: 5
Joined: Mon Feb 23, 2009 12:54 pm

Post by Jeroen Sloendregt » Thu Mar 05, 2009 8:20 pm

I tried on 3 different computers and all the same error..
can anyone help me please? :roll:

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Image Capture 0kb

Post by gdyvig » Thu Mar 05, 2009 9:40 pm

Hi,

We have seen that a few times.

First check the obvious.
Do you actually see the image in the Image Capture window before you do the save?

On one machine we had problems if we drew the capture rectangle from the bottom up.

On machine started doing Image Captures correctly after we re-installed Macro Scheduler (or the latest update).

Gale

Jeroen Sloendregt
Newbie
Posts: 5
Joined: Mon Feb 23, 2009 12:54 pm

Post by Jeroen Sloendregt » Fri Mar 06, 2009 3:43 pm

Hello gdyvig,

thanks for your reply.

Actually I did not see the actual capture in the window before saving it.. that should be?

after try 2-3 times I get the 'access violation' error again as described below..
unfortunately re-install did not solve the problem..

Any more clues?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Check for CrossHair cursor

Post by gdyvig » Fri Mar 06, 2009 7:27 pm

When you use the Capture tool, wait for the normal cursor/pointer to change to the CrossHair pointer. Otherwise you will capture nothing.

This may particularly be a problem if you use the Capture after 5 second delay method.


Hope that solves it!

Gale

Jeroen Sloendregt
Newbie
Posts: 5
Joined: Mon Feb 23, 2009 12:54 pm

Post by Jeroen Sloendregt » Wed Mar 11, 2009 7:16 pm

Dear Gale,
thanks for your effort,
the cursor change into red/dotted/running line whenever I select an area; but again I not see anything in the capture window to save..

Friend Marcus, any idea?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Mar 11, 2009 8:50 pm

Which version of Macro Scheduler are you using?

Maybe we need to connect up with BeamYourScreen so that we can see what you are doing and see if we can see why it isn't working for you.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Mar 11, 2009 10:04 pm

Jeroen Sloendregt wrote:the cursor change into red/dotted/running line whenever I select an area; but again I not see anything in the capture window to save..
Hi Jeroen,

Try this...
  1. size/position the MS main window so it is not blocking too much of the screen
  2. open a macro in the editor
  3. start the Image Capture Tool
  4. move windows around so that your target window (or desktop) containing the image you want to capture... is visible
  5. make sure the target window has focus
  6. hit SHIFT CTRL F12 and your mouse pointer will turn into a cross-hair
  7. move that cross-hair to one corner of the area you want to capture
  8. hold down the left mouse button... and while continuing to hold it down, move the cross-hair until the red dotted line surrounds the area you want to capure
  9. let go of the left mouse button and that area should have been captured... go look at the Image Capture Tool window.
  10. if the image there is what you want, hit File/Save As, give it a filename, click Save and you're done.
If that didn't work for you, I would take up Marcus on his BeamYourScreen offer.

Good luck and take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts