ImageCrop

The ImageCrop node is used to crop 2D images.

Cutting Method:

  1. Enter the x1,y1,x2,y2 properties of the image clipping for cutting.

  2. Box select ROI in 2D view for cutting.

Node parameter

  • x1:The column coordinates of the starting point of the image crop.

  • y1:The row coordinates of the starting point of the image crop.

  • x2:The column coordinates of the ending point of the image crop.

  • y2:The row coordinates of the ending point of the image crop.

  • image:Sets the visual properties of an image in a 2D view.

    • visOn Open image visualization.

    • m_visOff Turn off image visualization.

  • image_list:Sets the visual properties of the image list in 2D view. The property value description is consistent with image.

Data signal input and output

Input:

Note:Select one of the data signals to input according to the requirements.

  • image :

    • Data type:Image

    • Input content:Image to be cut

  • image_list :

    • Data type:ImageList

    • Input content:List of images to be cut

Output:

  • image :

    • Data type:Image

    • Output content:After cutting the image

  • image_list :

    • Data type:ImageList

    • Output content:After cutting the image list

Functional Demo(Cut using attribute values)

Use the ImageCrop node to cut the banana part of the image to be cut.

Step 1: node preparation

Add Trigger, Load, ImageCrop nodes to the node graph.

Step 2: Set the node parameters

  1. Set the Load node parameters:

    • type → Image

    • filename → icon_more → Select image file name ( example_data/images/image.png )

    • image → visOn

  2. Set the ImageCrop node parameters:

    • x1 → 0

    • y1 → 0

    • x2 → 700

    • y2 → 500

    • image → visOn

    Note:When the mouse stays on the 2D picture, the coordinates of the current pixel can be displayed below the 2D view.

Step 3: Connect node

image-20231229142124679

Step 4: Run

Click the Run button of RVS to Trigger the trigger node.

Running result

As shown in the following figure, the results of the Load and ImageCrop nodes are displayed in the 2D view. The ImageCrop node intercepts the 700*500 portion of the banana image.

image-20231229142323835

Functional Demo(Select ROI for cutting)

Use the ImageCrop node to cut the banana part of the image to be cut.

Step 1: node preparation

Add Trigger, Load, ImageCrop nodes to the operator graph.

Step 2: Set the node parameters

  1. Set the Load node parameters:

    • type → Image

    • filename → icon_more → Select image file name( example_data/images/image.png )

    • image → visOn

Step 3: Connect node

image-20231229142124679

Step 4: Run

  1. Click the Run button of RVS to Trigger the trigger node.

  2. Locate the visual image of the ImageCrop node in the 2D view and click the Normal Mode button in the following image.

    image-20231229143228632

  3. Click the normal mode button to change to box selection mode, select the area to be cropped in the image (banana part), the yellow box in the following figure is the part that has been framed. Displays x1,y1,x2,y2 of the selected parts of the box in the log view.

    Note:To uncheck the box, click the free area of the image loaded by the ImageCrop node.

    image-20231229142543407

  4. Trigger the Tigger node again.

Running result

As shown in the following figure, the result of the ImageCrop node is displayed in the 2D view. Capture the banana portion of the image.

image-20231229143126195