Comment on page
Grab Cut Algorithm
The
GrabCut
node in AugeLab Studio applies the GrabCut algorithm to separate foreground objects from the background in an image.The
GrabCut
node uses the GrabCut algorithm to estimate the foreground and background regions in an input image. It can be used to extract objects from an image based on a provided mask or a bounding box.- Node Title: Grab Cut Algorithm
- Node ID: OP_NODE_GRABCUT
The
GrabCut
node has the following input sockets:- Image: The input grayscale image to be processed. Connect a grayscale image to this socket.
- Mask/ROI Coordinates: The mask or region of interest (ROI) coordinates to define the area of interest in the image. Connect a generic socket with the ROI coordinates as (start_point, end_point).
The
GrabCut
node has the following output socket:- Image: The resulting image with foreground objects extracted and background removed.
The
GrabCut
node has the following configuration options:- MODE: Choose between two modes: "MASK" and "ROI". In the "MASK" mode, you can provide a binary mask where the foreground pixels are marked as 1 and the background pixels are marked as 0. In the "ROI" mode, you can provide the coordinates of a rectangular region of interest (ROI) to define the area of interest in the image.
- Iterations: Specify the number of iterations to perform during the GrabCut algorithm. Increasing the number of iterations can lead to better segmentation results.
- 1.Drag and drop the
GrabCut
node from the node library onto the canvas in AugeLab Studio. - 2.Connect the input grayscale image to the Image input socket of the
GrabCut
node. - 3.Optionally, connect a generic socket with the ROI coordinates to the Mask/ROI Coordinates input socket to define a region of interest.
- 4.Configure the node properties according to your needs, such as choosing the mode and setting the number of iterations.
- 5.Run the pipeline.
- 6.The
GrabCut
node will apply the GrabCut algorithm to the input image and produce the image with foreground objects extracted at the Image output socket.
- The
GrabCut
node uses thecv2.grabCut
function from OpenCV to perform the GrabCut algorithm. - The GrabCut algorithm estimates the foreground and background regions in an image based on an initial mask or bounding box.
- In the "MASK" mode, provide a binary mask where the foreground pixels are marked as 1 and the background pixels are marked as 0. Any intermediate values will be considered probable foreground or background.
- In the "ROI" mode, provide the coordinates of a rectangular region of interest (ROI) as
(start_point, end_point)
. The ROI defines the area of interest in the image. - The GrabCut algorithm iteratively updates the foreground and background models based on the provided mask or ROI.
- The output image will have the foreground objects extracted and the background removed.
- Connect the output of the
GrabCut
node to other nodes in the pipeline for further processing or analysis.
That concludes the documentation for the
GrabCut
node in AugeLab Studio. This node allows you to apply the GrabCut algorithm to separate foreground objects from the background in an image.Last modified 4mo ago