'error on search image in python image_match library

I'm using python image_match library. I need to use search_image method of this library. but when I se this method I got the below error:

Traceback (most recent call last):
  File "/var/www/html/Panel/test2.py", line 16, in <module>
    ses.search_image('https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg/687px-Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg')
  File "/usr/local/lib/python3.10/site-packages/image_match/signature_database_base.py", line 268, in search_image
    transformed_record = make_record(img, self.gis, self.k, self.N)
  File "/usr/local/lib/python3.10/site-packages/image_match/signature_database_base.py", line 356, in make_record
    signature = gis.generate_signature(path)
  File "/usr/local/lib/python3.10/site-packages/image_match/goldberg.py", line 161, in generate_signature
    im_array = self.preprocess_image(path_or_image, handle_mpo=self.handle_mpo, bytestream=bytestream)
  File "/usr/local/lib/python3.10/site-packages/image_match/goldberg.py", line 257, in preprocess_image
    return rgb2gray(image_or_path)
  File "/usr/local/lib/python3.10/site-packages/skimage/_shared/utils.py", line 394, in fixed_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/skimage/color/colorconv.py", line 875, in rgb2gray
    rgb = _prepare_colorarray(rgb)
  File "/usr/local/lib/python3.10/site-packages/skimage/color/colorconv.py", line 140, in _prepare_colorarray
    raise ValueError(msg)
ValueError: the input array must have size 3 along `channel_axis`, got (1024, 687)

Can you please help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source