bug fixing, and change the interpolation function to work with pillow.
This commit is contained in:
parent
912ffd8e5d
commit
c1012bae29
1 changed files with 5 additions and 7 deletions
|
@ -29,19 +29,17 @@ def image_interpolation(image1, image2, alpha):
|
||||||
alpha = max(0, min(1, alpha))
|
alpha = max(0, min(1, alpha))
|
||||||
|
|
||||||
# Perform interpolation
|
# Perform interpolation
|
||||||
interpolated_image = np.uint8((1 - alpha) * image1 + alpha * image2)
|
interpolated_image = Image.blend(image1, image2, alpha)
|
||||||
|
|
||||||
return interpolated_image
|
return interpolated_image
|
||||||
|
|
||||||
image = Image.open("ciscoTheProot/faces/prootface1.bmp")
|
image = Image.open("faces/prootface1.bmp")
|
||||||
image.thumbnail((128, 32), Image.ANTIALIAS)
|
image.thumbnail((128, 32), Image.ANTIALIAS)
|
||||||
RGBImage = pure_pil_alpha_to_color_v2(image)
|
noBlinkImage = pure_pil_alpha_to_color_v2(image)
|
||||||
noBlinkImage = np.array(RGBImage, dtype=np.uint8)
|
|
||||||
|
|
||||||
image = Image.open("ciscoTheProot/faces/prootface2.bmp")
|
image = Image.open("faces/prootface2.bmp")
|
||||||
image.thumbnail((128, 32), Image.ANTIALIAS)
|
image.thumbnail((128, 32), Image.ANTIALIAS)
|
||||||
RGBImage = pure_pil_alpha_to_color_v2(image)
|
fullBlinkImage = pure_pil_alpha_to_color_v2(image)
|
||||||
fullBlinkImage = np.array(RGBImage, dtype=np.uint8)
|
|
||||||
|
|
||||||
DesiredBlinkState = 0
|
DesiredBlinkState = 0
|
||||||
currentBlinkState = 0
|
currentBlinkState = 0
|
||||||
|
|
Loading…
Reference in a new issue