Comment on page
Contour Mask
The
Contour Mask
node in AugeLab Studio generates a mask image based on the contour provided as input. The mask image isolates the region inside the contour, allowing further analysis or processing on the selected area.The
Contour Mask
node takes an input image and a contour as inputs and provides the following output:- 1.Mask Image: The mask image that isolates the region inside the contour.
- Node Title: Contour Mask
- Node ID: OP_NODE_CONTOUR_MASK
The
Contour Mask
node has the following input sockets:- 1.Image: The input image from which the contour is extracted.
- 2.Contour: The contour that defines the region of interest.
The
Contour Mask
node has the following output socket:- 1.Mask Image: The mask image that isolates the region inside the contour.
The
Contour Mask
node uses the mask_counter
function to generate the mask image based on the provided contour. The function performs the following steps:- 1.Approximates the contour to a rectangle using the
cv2.approxPolyDP
function. - 2.Calculates the four corners of the rectangle using the minimum and maximum sums and differences of the contour points.
- 3.Calculates the width and height of the rectangle.
- 4.Generates a transformation matrix using the four corners of the rectangle and a destination rectangle.
- 5.Warps the source image using the transformation matrix to obtain the masked region.
- 1.Drag and drop the
Contour Mask
node from the node library onto the canvas in AugeLab Studio. - 2.Connect the input image to the Image input socket of the
Contour Mask
node. - 3.Connect the contour of the region of interest to the Contour input socket of the node.
- 4.Run the pipeline.
- 5.The
Contour Mask
node generates the mask image that isolates the region inside the contour. - 6.Use the mask image for further analysis, processing, or visualization in subsequent nodes.
- The
Contour Mask
node is useful for isolating a specific region defined by a contour from an input image. - The node approximates the contour to a rectangle and generates a mask image that represents the region inside the contour.
- The mask image can be used for further analysis or processing, such as feature extraction or segmentation, in subsequent nodes.
That concludes the documentation for the
Contour Mask
node in AugeLab Studio. Use this node to generate a mask image based on a contour and isolate the region of interest for further analysis or processing.