parser = ArgumentParser(description="Segment foreground with OpenCV GrabCut.") parser.add_argument("image", help="Input image path.") parser.add_argument("cutout", help="Output PNG path for the transparent cutout.") parser.add_argument("--rect", required=True, help="Initial rectangle as x,y,width,height.") parser.add_argument( "--foreground-point", required=True, action="append", help="Sure-foreground point as x,y; repeat for separate subject regions.", ) parser.add_argument( "--foreground-stroke", action="append", default=[], help="Sure-foreground stroke as x1,y1,x2,y2,thickness; repeat as needed.", ) parser.add_argument("--exclude-rect", required=True, help="Sure-background rectangle as x,y,width,height.") parser.add_argument("--iterations", type=int, default=5, help="Iterations per GrabCut pass.") args = parser.parse_args()