🟧 Binary Image Inversion

Function Description

This operator performs black-white inversion operations on input binary images, i.e., changing black pixels (usually pixel value 0) in the image to white, and white pixels (usually pixel value 255) to black.

Usage Scenarios

  • Matching algorithm input requirements: Many image processing operators (such as "Connected Component Analysis", "Distance Transform", etc.) usually require the target parts in the image to be white and other regions to be black. If the existing binary image has target parts in black and other regions in white, this operator can first perform black-white inversion to make it conform to subsequent algorithm input specifications.

  • Facilitating specific operations: When performing certain image processing operations, it may be necessary to process the originally black regions. In this case, the image can first be black-white inverted, complete the required processing, then invert back, to achieve flexible operations on different regions.

  • Visualization debugging: In some cases, inverted images may be easier to observe and debug.

Input Output

Input

Binary Image: One or more binary images to be inverted.

Output

Inverted Image: Images after black-white inversion.