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

How to macro control Live Image capture

Hi, I have control of an automated Prior stage through the API to the OASIS card but now want to automate some Live Image capture, how do I start a Live Image capture session (I can't find an example of McLiveTiling to re-engineer) so that I can save the captured image as a TIFF file?

Best Answer

  • Answer ✓
    Sorry, Yuri if I was not clear but I do have the 9.2. version but our QImage camera does not show as available for acquisition of images but is the camera is still available on the same PC in the 9.1 version.  The user guide for 9.2 says you have to have a separate license for camera image capture - I will need to speak to our IT folk about resolving this as we work in a locked - down IT environment.

Answers

  • Hi Chris,

    You can just activate macro recording and do the steps you want, which will record commands that you can then reuse in your macro.

    Here is how the macro may look after recording steps related to live tiling:

        Public Function LiveTiling() As SimpleScript
            LiveTiling = New SimpleScript
            Dim doc1, doc2
    
            'Start live preview
            With Capture.CaptureCommands.Preview(LiveTiling)
                .PreviewSettings = True
                .PreviewOn = True
                .Run(Nothing, Nothing)
            End With
    
            With Application.DocumentCommands.Active(LiveTiling)
                .Run(doc1)
            End With
    
            'Start Live Tiling
            With Process.LiveTilingCommands.RunOnImage(LiveTiling)
                .Run(doc1, Nothing)
            End With
    
            'add Tile (repeat multiple times)
            With Process.LiveTilingCommands.Add(LiveTiling)
                .Run()
            End With
    
            'stop live tiling
            With Process.LiveTilingCommands.RunOnImage(LiveTiling)
                .Run(doc2, Nothing)
            End With
        End Function
    
    
    Live tiling is designed mostly for users without automatic stages, so the tiles are placed automatically based of manual stage movements, which can be inaccurate and random.
    If you have an automatic stage, you may use another approach: capture multiple images in given pattern and then use post-acquisition tiling, which is available in Premier on the Process tab, Tiling button.

    Regards,

    Yuri

  • Thanks Yuri, I was trying the macro recording but unfortunately Premier was giving me the 'No instance of an object error' and so would not create the macro.  Our free update to 9.2 does not have the camera installed so I was having to use the 9.1 version to develop in.  I am definitely interested in in your second suggestion as that mimics our manual process using third party software - I will just need to sort out pixel maths to define the appropriate rectangles and number of images for tiling.  If you have a simple code example already available I would be grateful.
  • Hi Chris,

    You should update to 9.2 version. Even if you don't have internet connection, you can download it on the computer that is connected and copy to offline computer.
    When you have acquired images, then you can also activate macro recording to see what commands are used to add images and change parameters of Tiling view, so you can use these commands in your macro.

    Regards,

    Yuri

  • Hi Chris,

    If Premier 9.2 is licensed for capture, you may simply need to install the capture interface. Since it is already installed in the 9.1 version, an easy method to accomplish this is using Add/Remove Programs in the Control Panel. The QImaging Capture Interface9 should be listed in Add/Remove programs. If you select it and click on the Change button in the A/R dialog, the installer will start running. Click Next until you reach a dialog with 3 buttons. One of the buttons will be named Change. Click on that button and it will detect the 9.2 application as a target. Make sure it is checked and finish the installation. The capture interface should then be installed into 9.2.
  • Hi Trey, thanks I tried this and interestingly the QImaging app says it is installed to work with the 9.2 version but... it doesn't appear in IPP9.2 but is working in my 9.1 copy on the same PC, the mystery deepens!
  • Resolved camera issue on IPP9.2 - The QImaging application would not add the camera to the 9.2 installation even as Administrator.  Resolution: Copied the installation MSI file to the desktop (try running the app and selecting change, see what the .msi file it is installing from is called, search on the hard disk to find it) then uninstalled the application.  Re-ran the MSI installation file as administrator and this added the camera config to IPP9.2.
  • Hi Chris,

    I'm glad you were able to find a solution. However, I do apologize for the inconvenience of the steps you needed to go through to get it working. I'll check and see if I can reproduce your problem to fix the setup for a future release.
Sign In or Register to comment.