Python OPENCV uses lab space to change the spring scene to fall

Source: Internet
Author: User

A period of time before the implementation of the Reinhard color migration algorithm, it is very interesting, and then made some changes in the code, there are some discoveries, the lab channel of a channel value changed to about 127, you can change the green to yellow, and the other color changes are very small, So you can change the scene of the spring to fall, here is the core code:

# -*-coding:utf-8-*- Import  = cv2.imread (' test. jpg'= cv2.cvtcolor (image,cv2. Color_bgr2lab) image[:,:,1] = 127= cv2.cvtcolor (image,cv2. COLOR_LAB2BGR) cv2.imwrite ('test.jpg', image)

The principle of implementation is very simple, as said above, but the effect is very good, paste a few results diagram:

Python OPENCV uses lab space to change the spring scene to fall

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.