Skip to content

Performance changes - #32

Open
ajinkya-kulkarni wants to merge 1 commit into
manuel-munoz-aguirre:masterfrom
ajinkya-kulkarni:patch-1
Open

ajinkya-kulkarni wants to merge 1 commit into
manuel-munoz-aguirre:masterfrom
ajinkya-kulkarni:patch-1

Conversation

@ajinkya-kulkarni

Copy link
Copy Markdown
  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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant