(How) can I normalize the HSV's v value to be between 0 and 1 with the help of opencv and python?

As I want to categorize and compare photos in terms of their brightness, I want to normalize the V values (HSV) to be between 0 and 1 – with 1 being the brightest. I use opencv with python. Thank you in advance! >Solution : import cv2 import numpy as np # Read an image frame… Read More (How) can I normalize the HSV's v value to be between 0 and 1 with the help of opencv and python?

Recreate colormap based on colorscale in matplotlib

I have an image of a color scale I filter out the actual color scale by using import cv2 import numpy as np colorbar = cv2.imread(‘colorbar-scheme-elevation.png’, cv2.IMREAD_UNCHANGED) colorbar = cv2.cvtColor(colorbar, cv2.COLOR_BGRA2BGR) hsv = cv2.cvtColor(colorbar, cv2.COLOR_RGB2HSV) lower_gray = np.array([0, 0, 0]) upper_gray = np.array([255, 10, 255]) mask = cv2.inRange(hsv, lower_gray, upper_gray) mask = cv2.bitwise_not(mask) res =… Read More Recreate colormap based on colorscale in matplotlib

Parse over large JSON array of Objects from Facebook

This is the JSON array: { "id": "", "name": "", "posts": { "data": [ { "likes": { "data": [ ], "paging": { "cursors": { "before": "QVFIUnpFd2IwMlhuOWI3dJqelFNNEZAPWDlqeENTNkg1N2RqMm9zQXBreVV6bE9KNXJzX29LeXlMZAzhNT2x3TEhlcGk3OG1Bd3ZABRmpyTXhnNDZAWV2hR", "after": "QVFIUl9Vbm14cld0dm41OTFtKYmgtelBKall2bnBINjBQMXBiNkNCMUM0d21lQXptOXRvbklkU0pHbV9yejNBVG9Jb2hqQTFoem1mdm9zMnJn" }, "next": "" }, "summary": { "total_count": 84, "can_like": true, "has_liked": false } }, "comments": { "data": [ { "created_time": "2022-05-25T18:22:19+0000", "message": "", "id": "" }, {… Read More Parse over large JSON array of Objects from Facebook