VisionPro Platform

Download and Install VisionPro

Please download VisionPro from Cognex official website.

Note

Percipio has tested VisionPro 9.0 and confirmed that it can open the Percipio camera normally. It is recommended to use this tested version of VisionPro.

Set Up USB Camera Environment

If you use a USB camera, complete Set Up USB Camera Environment before proceeding.

Download camport_visionpro SDK

Choose any of the following methods to download the camport_visionpro SDK:

  • Access https://gitee.com/percipioxyz/camport_visionpro.git using a browser and download the SDK.

  • Use the git command to obtain a local copy: Open the terminal, switch to the working directory where the SDK should be stored, and enter the git clone command to clone the remote repository.

    git clone https://gitee.com/percipioxyz/camport_visionpro.git
    

The directory structure of the camport_visionpro SDK is shown below:

📦 camport_visionpro SDK
├── 📁 Core Libraries
│   ├── PercipioCamera.dll               # Main camera library, encapsulating core interfaces such as camera control and image acquisition
│   ├── PercipioCameraExtern.dll         # Camera extension library, providing additional advanced functions or hardware extension support
│   ├── tycam.dll                        # Camera low-level driver or hardware communication library
│   └── tyimgproc.dll                    # Image processing library, providing algorithms such as image preprocessing and enhancement
│
├── 📁 Tool Modules
│   ├── PerciPioCameraToolBlock.vpp      # Visual programming tool block (for graphical development environments, e.g., VisionPro)
│   └── PercipioCameraToolBlock.vtt      # Tool block configuration or template file
│
├── 📁 Sample Programs
│   └── Program.cs                       # Project entry program
│
└── 📁 Documentation
    └── Update Log.txt                   # Version changelog

Configure Environment

  1. Right-click the VisionPro shortcut icon and select Open file location from the shortcut menu to access the installation directory of VisionPro.

  2. Copy PercipioCamera.dll, PercipioCameraExtern.dll, tycam.dll and tyimgproc.dll to bin folder in the VisionPro installation directory.

  3. Copy PercipioCameraToolBlock.vtt to bin/Templates/Tools folder in the VisionPro installation directory.

Run

This section explains how to run a Percipio camera in VisionPro. Steps are as follows:

  1. Double-click to run the VisionPro software.

  2. Double-click Image Source to enter VisionPro(R) QuickBuild Job Editor - CogJob1 page.

    cogjob1
  3. click the Show VisionPro Tools icon to bring up the VisionPro Tools page.

    PercipioCameraToolBlock
  4. Double-click PercipioCameraToolBlock and add it to the ToolGroup.

    Add PercipioCameraToolBlock
  5. Double-click PercipioCameraToolBlock, select the Input/Output tab in the PercipioCameraToolBlock page, and set the input parameters.

    Set Camera SN
    Input Parameters

    Parameter Name

    Description

    CameraId

    Set the camera serial number.

    IREpipolarRectificationFlag

    Set the IR image epipolar rectification switch. True: enabled; False: disabled.

    AlignMode

    Set the image alignment mode. 0: no alignment; 1: rgb2depth; 2: depth2rgb.

    TimeOut_ms

    Set the trigger timeout in milliseconds (ms). Default: 5000 ms.

    orthoRefZ_mm

    Set the height of the orthogonal correction reference plane in millimeters (mm).

    Output Parameters

    Parameter Name

    Description

    OutputColorImage

    Outputs the RGB color image.

    OutputIRImage

    Outputs the IR grayscale image.

    OutputDepthImage

    Outputs the depth image, in mm.

    xPitch

    The actual physical size represented by each pixel in the X direction (e.g., 4.93509 mm/pixel).

    yPitch

    The actual physical size represented by each pixel in the Y direction (e.g., 4.93509 mm/pixel).

  6. click the Run icon. You can view the images captured by the camera in the output terminal.

    Running Results

    Afterwards, add other tools according to actual needs, and connect the output port of PercipioCameraToolBlock to the input port of other tools.

  7. Optional: If you have secondary development needs for PercipioCameraToolBlock, you can click the Create/Edit Script icon and edit the script.

    Edit Script

Secondary Development

If you have secondary development needs for PercipioCameraToolBlock, click the Create/Edit Script icon and edit the script.

Edit Script
  • GetInt

    Gets an integer feature. For example, get the color image exposure time.

    int m_exposure_time = 0;
    ret = cameraSingle.GetInt((int)EnDeviceComponent.TY_COMPONENT_RGB_CAM, (int)En_FEATURE_ID.TY_INT_EXPOSURE_TIME, ref m_exposure_time);
    Console.WriteLine($"GetInt ret: {ret}");
    
  • SetInt

    Sets an integer feature. For example, set the color image exposure time.

    cameraSingle.SetBool((int) EnDeviceComponent.TY_COMPONENT_RGB_CAM,(int) En_FEATURE_ID.TY_BOOL_AUTO_EXPOSURE, false);
    ret = cameraSingle.SetInt((int)EnDeviceComponent.TY_COMPONENT_RGB_CAM, (int)En_FEATURE_ID.TY_INT_EXPOSURE_TIME, 400);
    Console.WriteLine($"SetInt ret: {ret}");
    

    Comparison images before and after setting:

    Before setting

    Before setting

    After setting

    After setting

  • GetBool

    Gets a boolean feature. For example, get the AEC switch status.

    bool aec = false;
    ret = cameraSingle.GetBool((int)EnDeviceComponent.TY_COMPONENT_RGB_CAM, (int)En_FEATURE_ID.TY_BOOL_AUTO_EXPOSURE, ref aec);
    Console.WriteLine($"GetBool ret: {ret}");
    
  • SetBool

    Sets a boolean feature. For example, disable AEC.

    ret = cameraSingle.SetBool((int) EnDeviceComponent.TY_COMPONENT_RGB_CAM,(int) En_FEATURE_ID.TY_BOOL_AUTO_EXPOSURE, false);
    Console.WriteLine($"SetBool ret: {ret}");
    
  • GetEnum

    Gets an enumeration feature. For example, get the color camera resolution.

    ret = cameraSingle.GetEnum((int)EnDeviceComponent.TY_COMPONENT_RGB_CAM, (int)En_FEATURE_ID.TY_ENUM_IMAGE_MODE, ref resolution);
    Console.WriteLine($"GetEnum ret: {ret}");
    
  • SetEnum

    Sets an enumeration feature. For example, set the color camera resolution.

    uint resolution = cameraSingle.ImageMode(TY_PIXEL_FORMAT_LIST.TY_PIXEL_FORMAT_YUYV, TY_RESOLUTION_MODE_LIST.TY_RESOLUTION_MODE_1920x1440);
    ret = cameraSingle.SetEnum((int) EnDeviceComponent.TY_COMPONENT_RGB_CAM, (int) En_FEATURE_ID.TY_ENUM_IMAGE_MODE, resolution);
    Console.WriteLine($"SetEnum ret: {ret}");
    

    After running, you can see the resolution change.

    Comparison images before and after setting:

    Before setting

    Before setting

    After setting

    After setting

  • GetFloat

    Gets a floating-point feature. For example, get Scale_Unit.

    ret = cameraSingle.GetFloat((int)EnDeviceComponent.TY_COMPONENT_DEPTH_CAM, (int)En_FEATURE_ID.TY_FLOAT_SCALE_UNIT, ref scale_unit);
    Console.WriteLine($"GetFloat ret: {ret}");
    
  • SetFloat

    Sets a floating-point feature. For example, set Scale_Unit.

    ret = cameraSingle.SetFloat((int) EnDeviceComponent.TY_COMPONENT_DEPTH_CAM, (int) En_FEATURE_ID.TY_FLOAT_SCALE_UNIT, 5.0f);
    Console.WriteLine($"SetFloat ret: {ret}");