Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Much faster implementation #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

QuantumLiu
Copy link

Original code performans 210 seconds per time.
New implementation performances 0.46 second per time.
About 500 times faster.

Original code performans 210 seconds per time.
New implementation performances 0.46 second per time.
About 500 times faster.
dc = cv2.cvtColor(dc, cv2.COLOR_BGR2LAB)
t_mean, t_std = get_mean_and_std(dc)
img_n=((sc-s_mean)*(t_std/s_std))+t_mean
np.putmask(img_n,img_n>255,255)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img_n = np.clip(img_n, 0, 255) instead of line 50/51 is even simpler and maybe even faster

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.

None yet

2 participants