Lookup table error

import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt

img = cv.imread('images/spider.png', cv.IMREAD_COLOR)
img = cv.cvtColor(img, cv.COLOR_BGR2RGB)

h, s, v = cv.split(cv.cvtColor(img, cv.COLOR_RGB2HSV))

sigma = 70
a = np.arange(0, 1, 0.1)

for value_a in a:
    func = np.minimum(s + value_a * 128 * np.exp(-(s - 128)
                                             ** 2 / (2 * sigma ** 2)), 255)

    s = s.astype(np.uint8)
    s_new = cv.LUT(s, func)
    img_new = cv.cvtColor(cv.merge((h, s_new, v)), cv.COLOR_HSV2RGB)

    plt.imshow(img_new)
    plt.show()
    cv.imshow('image', img_new)
    cv.waitKey(1)

cv.waitKey(0)
cv.destroyAllWindows()

I get an error like this
$ “C:/Program Files/Python311/python.exe” c:/Users/user/Desktop/assignment/Q3a.py
Traceback (most recent call last):
File “c:\Users\user\Desktop\assignment\Q3a.py”, line 18, in
s_new = cv.LUT(s, func)
^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\lut.cpp:368: error: (-215:Assertion failed) (lutcn == cn || lutcn == 1) && _lut.total() == 256 &&
_lut.isContinuous() && (depth == CV_8U || depth == CV_8S) in function ‘cv::LUT’

can I know why I got that kind error and how to fix it