I currently have a .rec file that I have extracted frames from. One of the outputs from this object is a stream of IPL Images. I’m looking to build a python component (through the Python bridge) that can process the image into a NumPy array for further processing. I have already tried passing the input image into the .asarray()
function, but the shape of the new NumPy array seems to be empty. Looking to see if there is a way to process IPL Images coming from the Player component to process it as a NumPy array.
Check out the Python Bridge image samples at
RTMapsInstallLocation\packages\rtmaps_python_bridge\samples\Chapter4_Data_Processing\sample5_images_add.py
# Get inputs IOElt
image1 = self.inputs["image1"].ioelt.data
image2 = self.inputs["image2"].ioelt.data
# We convert arrays to int32 to avoid overflows
res = np.array(image1.image_data, dtype=np.int32) + np.array(image2.image_data, dtype=np.int32)
np.clip(res, 0, 255, out=res)
image1.image_data = np.array(res, dtype=np.uint8)