Skip to main content
. 2025 Sep 12;15(18):2316. doi: 10.3390/diagnostics15182316
Algorithm 1 Automatic Color Deconvolution Algorithm [3]
     Input: RGB Slide, β
  • 1:

    procedure  FindOptimalStainVectors

  • 2:

        Convert RGB to OD using Equation (4)

  • 3:

        Remove data with OD intensity less than β

  • 4:

        Calculate SVD on the OD tuples

  • 5:

        Create a plane from the SVD directions corresponding to the two largest singular values

  • 6:

        Project data onto the plane and normalize them into a unit length

  • 7:

        Calculate the angle of each point with respect to the first SVD direction

  • 8:

        Find robust extreme values back to the OD space

     Output: Optimal Stain Vectors