I wrote a software to connect to the xray luggage inspection machine and receive the scanned images.
But these images are on a gray level and should be turned into a color photo.
Of course, the desired color photo must be with xray color code, which is different according to the category of materials. My output data from the device is as follows:
I convert this data to an image with the following Python code:
input_arr = np.array(input) # converting the list of lists to numpy array
input_arr_rescaled = (255.0 / input_arr.max() * (input_arr - input_arr.min())).astype(np.uint8)
plt.imshow(input_arr) # visualization with matplotlib
# for saving the matrix itself
from PIL import Image
im = Image.fromarray(input_arr_rescaled )
im.save("image.png")
Sample output image:
Sample output image of xray device:
My other question is how can I delete the image of the conveyor?