Home Image-Pro Automation (Macros, Apps, Reports)

Beginner in writing macro - grid definition

Hi all,
I'm a beginner in writing macros (more than beginner!)
I want to write a macro which 'replicates' the same measurement (correlation track) on many AOI. Basically, I want to create a grid on my picture, and repeat this track on every square of the grid. 

I've recorded a macro while making the track on one AOI

ipRect.Left = 259
ipRect.top = 497
ipRect.Right = 329
ipRect.bottom = 557
ret = IpAoiCreateBox(ipRect)
ret = IpTrackShow(TRACK_TABLE,TRACK_SHOW)
ret = IpTrackMeasSet(TM_ADD_CORREL_TRACK,0,0)
ret = IpSeqSet(SEQ_ACTIVEFRAME, 0)
End Sub


I'd like to tell the macro to 'move' the AOI and repeat from the step1. 

Oh, and another thing: I want the macro to ask me at the beginning the size of the AOI I want (which should be a kind of mesh size of my grid)

I hope it's clear enough
Thank you for your support

Answers

  • OPS! WRONG SECTION!!!! It's not Image Pro Premier, but Image Pro Plus... I can't move the question SORRY
  • You can use IpStGetInt to prompt for AOI size (check macro help for examples of IpStGetInt).
    Then you just make a loop along X and Y where you change ipRect coordinates. The loop should cover image width and height, which can be obtained from IPDOCINFO returned by IpDocGet (check help for examples on IpDocGet and IPDOCINFO).

    Regards,

    Yuri

  • unfortunately my problem is SO much bigger: I've never written a macro, so I don't know where to begin from.
    I can code in Matlab, so I've perfectly understood the logic of the macro you're suggesting me. Although this, I've tried to write something in Image Pro Plus, but I've definitively failed...
  • 2017-02-06-121903

    Bibiri --

    If the challenge that you have for IMAGE-PRO PLUS is beyond your programming skills, my company (ALCES IMAGING AND AUTOMATION) and I can assist you.

    Browse to

        alces.us

    for some company information.

    My CONTACT INFORMATION is at the base of the FRONT PAGE.

    I would post it here but I don't want it picked up by any AD BOTS.

    -- Matt


  • I hope I can find the solution to my problem here
Sign In or Register to comment.