Following is my python code to plot stock chart on a background image from local file. The code is not optimal, I will improve it later. Hope it be useful. The example is plot ABX.TO.csv (download from yahoo finance) data on a logo collection image (my file:/media/Data1/XIU/AACodes/NASDAQ_stocks.png). Code # plot stock data with a background-image ..
Tag : howto
import cv2 input_imgfn=”tobrighten.jpg” output_imgfn=”brightened.jpg” def change_brightness(img, value=30): hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) h, s, v = cv2.split(hsv) v = cv2.add(v,value) v[v > 255] = 255 v[v < 0] = 0 final_hsv = cv2.merge((h, s, v)) img = cv2.cvtColor(final_hsv, cv2.COLOR_HSV2BGR) return img img = cv2.imread(input_imgfn) #load rgb image img = change_brightness(img, value=90) #increases #img = change_brightness(img, value=-30) ..