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

How can I get measured data in VB code?

Hi, Media Cybernetics

I'm editing some codes in ImagePro Macro.

I want to get measured data values in the DataTable directly by VB code without using EXCEL or clipboard.

What I want to get data are RgnPixelCentroidX, RgnPixelCentroidY (Region : Centroid Pixel X, Y) and the position of rising edge, falling edge of lineprofile.

I want to know the VB command  what I can access those measured values directly.

thank you.


Answers

  • Options
    haesol,

    The forum contains several examples of getting measurements and line profile data from a macro. Please check the following topics:

    Measurements:
    https://forums.mediacy.com/discussion/comment/93#Comment_93 

    Line Profile:
    https://forums.mediacy.com/discussion/179/line-profile/p1 

    You can also search the forum by McMMSubFeature or "line profile" to get more results.

    Yuri
  • Options

    Thanks YuriG

    Thanks to your link I already make my own macro about 70%.

    But I faced a big problem that processing time.

    In my macro, there are more than 70 circles. And I draw 6 lineprofiles for each circle. (I want more but when I did 12 lineprofiles/circle my computer was shut down.)

    So, I want to reduce the process time.


    At first, the reason of I consider ImagePro is performance.

    The program that we now in use has very long process time.

    But in my macro ImagePro and our current program are similar.

    I think it is possible to reduce process time with ImagePro.

    I already use some lineprofile options such as mono interpretation, no update intensity map, do width 1....


    I want to attach my measured image but I can't because of company security rule.

    Then It's my questions.


    1. Can lineprofile invisible?

    I guess if my macro don't draw lineprofile in my monitor, it can be 10 times faster or more. But still I can get position data of edges.


    2. If upgrade to ver.10, it can be faster?

    I'm using ImagePro 9.2 now. When I upgrade ver.10 there are many difference of performance?


    3. If upgrade my computer HW, it can be faster?

    my computer spec is i7 6700, 8G ram, GeForce GT730.

    After I measure 1 image, 7G ram is in use. And my graphic card is not good.

    So I think HW upgrade.


    4. Any idea for reduce process time?

    Please give me any idea for reduce process time.


    Thanks

  • Options
    haesol,

    I's difficult to talk about improving performance without seeing you macro and the test images. It could be just an issue of optimizing the macro or using a different approach to get the same result. 
    Can you share your macro and some test images describing exactly what you want to achieve? You may simplify your project to share only the critical part. The best way to share the macro is to save the project to IPX file (File | Package in the project workbench) and attaching to the post.

    Yuri
  • Options
    Hi haesol,

    Yes, you can speedup the analysis with hidden line profiles, but you mentioned you "draw" them - they should be visible. 70 circles, 6 line profiles on each with several edged on each profile is a lot of data - updating tables/graphs/UI takes bigger chunk. One of the ways could be process one circle at the time and use Data Collector to store the data. I believe the image itself could help, but we need to understand the macro's workflow for future recommendations.

    Thanks,
    Nikita.
  • Options

    Thanks all

    I attach my ipp file by zip.

    In the ipp, I execute 'RealTest01' function. (It execute CetCent Sub, OneHoleNodoc Sub)


    And I draw my concept below.

    Final goal include a function of stitch to 2 images but now I don't think that.


    Thanks to your help.

  • Options
    edited January 2019
    Hi Haesol,

    Thanks, for providing details. As I see from the image, you want to get outline points of the circle using line profiles. Why did you choose that method? Is it possible to segment the circle directly (using threshold or smart segmentation)? If yes, then you can get outline points right from the segmented object (http://forums.mediacy.com/discussion/comment/543/). We also have measurements that return an array of values with defined angle increments, such as Radii, Calipers, Fourier Descriptor.(see http://forums.mediacy.com/discussion/comment/641#Comment_641
    http://forums.mediacy.com/discussion/102/how-to-count-number-of-stellar-shape-vertices-using-fourier-descriptor/p1  ). 
    Using these methods would me much more effective and faster than drawing line profiles.

    Let us know if these methods can be used in your project.

    Yuri


  • Options

    Hi YuriG

    The method use threshold or smart segmentation has low reliability.

    When we calculate CD such as diameter, CD values are shaking by image quality.

    We have many many images and it is difficult to guarantee all image's quality.

    So, I calculate the center of circle by threshold method and next using lineprofile to find edge of circle.

    I have a idea for increase performance.

    I draw one lineprofile and get the "Origin_Rising" and "Origin_Falling" values.

    Next I remove that lineprofile.

    So I can reduce process time.

    But another problem appeared.

    It is deffrent to edge position what I calculate by "Origin_Rising", "Origin_Falling" values and ActiveImage's edge position.

    I used spatial calibration and PixelSizeX, Y...



    Anyway, the method using threshold is not a good answer for me :(


    Thank you all

    haesol

  • Options
    haesol,

    If you think that edge detection of line profile is reliable, it might be possible to create smart segmentation recipe (with LowPass, Edge channels, as in Line profile edge detection) that would produce similar results, then you can just measure Diameters of segmented objects.

    Can you post one of your images so we can check if smart segmentation can be used? (and also the parameters of line profile edge detectors that you use).

    Thanks,

    Yuri

  • Options

    Hi YuriG,


    We think the method of dege detection of lineprofile is reliable because now we use that way to other program.

    I will try smart segmentation recipe.

    I can't upload or send image to you. But we can send to ERETEC INC that the Korea agency of MEDIA Cy.

    We sign a contract of NDA(non-disclosure agreement) so I can send to there.

    I will contact to ERETEC INC.


    Thanks,

    haesol


Sign In or Register to comment.