Create a cvb.Image object from a numpy array


is it possible to convert a numpy array to a cvb.Image object? I didn’t find any function to do this. Just found this, which is unfortunately not helping for the python case.

Thanks for your help!

Hi @JRo85 !
Yes it is! Just try the following:

import numpy as np
import cvb
any_array = np.ones([2,2]) # 2x2 image of ones
cvb_image = cvb.WrappedImage.from_buffer(any_array)
# continue with cvb_image

Hope this helps. For fruther guidance you could look at Getting-Started-With-CVBpy