manuel-munoz-aguirre / PyHIST

A pipeline to segment tissue from the background in histological images
GNU General Public License v3.0
56 stars 13 forks source link

Performance changes #32

Open ajinkya-kulkarni opened 1 year ago

ajinkya-kulkarni commented 1 year ago
  1. downsample_image(): Added a default value of "numpy" for the mode argument. Changed the conversion from PIL image to numpy array to remove the alpha channel.

  2. bg_color_identifier(): Simplified the computation of the number of lines for the background selection. Changed the output format of the function to return bord_unique alongside bg_color as another possible candidate for background color.

  3. selector_otsu(): Simplified the code by using np.mean() instead of np.sum() and dividing by the total number of pixels. This provides a more direct measure of the proportion of background pixels. Simplified the if/else statement at the end to remove redundancy.