Open JVedant opened 3 years ago
Please provide stack trace (from gdb) and used modules.
Does it work with normal numpy arrays without of this processing:
i = np.array(data.raw_data)
i2 = i.reshape((IM_HEIGHT, IM_WIDTH, 4))
i3 = i2[:, :, :3]
Please try to run OpenCV samples (e.g. https://github.com/opencv/opencv/blob/master/samples/python/drawing.py).
Please provide stack trace (from gdb) and used modules.
Does it work with normal numpy arrays without of this processing:
i = np.array(data.raw_data) i2 = i.reshape((IM_HEIGHT, IM_WIDTH, 4)) i3 = i2[:, :, :3]
Please try to run OpenCV samples (e.g. https://github.com/opencv/opencv/blob/master/samples/python/drawing.py).
The code block is used in carla (simulator to train Reinforcement Learning models on self driving cars), and the function arguement "data" is captured from one of the sensors of the vehicle. (using carla.listen() - https://carla.readthedocs.io/en/latest/python_api/#methods_41)
Yes it does works with the provided OpenCV Sample, but not with the numpy preprocessing (converting raw data to array, reshaping and then slicing). Also when added print(i3) in the function, the values of i3 are displayed perfectly in the terminal.
"Slicing" of numpy arrays is not properly supported by OpenCV Python binding. see #15895 for problem statement and workarounds
Ohh, so how shall one display a image from bytes ? because the "data.rawa_data" returns bytes value and the 4th dimension is not required so i need to slice the array into 3 dimension. also i guess it worked on some older versions.
System information (version)
Detailed description
When used cv2.imshow() in loop, the window doesn't reload and gets stuck at the first frame.
Steps to reproduce
the function block is used in a loop of multiple images where it is suppose to display all the images in a single window.