Open 8bignic8 opened 3 years ago
@8bignic8
Your code has a divide by zero bug
---> hsi = cv2.merge((jitHUE(red, blue, green), calc_saturation(red, blue, green), calc_intensity(red, blue, green)))
ZeroDivisionError: division by zero
In solid black image
If you can tell me where exactly the division by zero happens maybe I can help
If you can tell me where exactly the division by zero happens maybe I can help
Using photoshop or other graphical software, create a 20x20 image with a single black color.
In base code in this repository, in this case you get nan
but in your code we get the divide zero bug.
As a result, your code runs extremely fast. This is an excellent point.
I prefer that you handle this exception with try ... except
sincerely
Hey I added Jit to your Programm but i dont know how to push to your projekt its much faster, soooo. Here is the code: requrements conda install numba
import cv2 import numpy as np import math from numba import jit
def RGB_TO_HSI(img):