Problems in getting the image transported between two ports using .tobytes() with setExternal() method since setExternal() crashes with python 3.6.9 #2474
Labels
Component: Bindings
swig, python, java, ruby, perl, octave, matlab, lua, csharp, tcl
Issue Type: QA/Support
This is a generic question or a support request that does not require a patch
Hi all,
I am using Ubuntu 18.04.5 LTS (Bionic Beaver), python v3.6.9, Numpy v1.19.5, Yarp v3.3 and Opencv v4.2.0.
I wrote a script to read an image from the folder using opencv and wrote that image to a port
/sender
. I wrote another script that listens to the port/sender
and reads that image from that port and displays it usingplt.imshow()
.Since I had faced the similar problems with
setExternal()
as mentioned in the issue #1873 (Bindings: setExternal crashes for RGB images with python>=3.6), so I tried to follow thetobytes()
workaround to transport the image between two ports which was also suggested in the same issue #1873 .When I send the image from
/sender
to/reader
, the only thing I get back is a black image. I don't know where I made the mistake. Can someone please point out my mistake. I have attached the scripts forsender.py
andreceiver.py
below.Any help in this regard would be highly appreciated. I have been trying to get around this issue for almost two weeks now and didn't get any help from anywhere so far. So please take some time to at least point me to the right direction.
Thanks in advance.
@andylucny
@BrutusTT
@Nicogene
@drdanz
################################################################################################
Here is the script of
sender.py
. It reads the image from the folder and opens and writes to/sender
port:########################################################################################
Here is the script of
reader.py
. It opens a/reader
port which reads the image from the/sender
and displays it usingplt.imshow()
:###################################################################################################
On terminal 1, I start
yarpserver
.On terminal 2, i run
python3 reader.py
On terminal 3, i run
python3 sender.py
here is the image that I am trying to transport
And here is what I get at the end
The text was updated successfully, but these errors were encountered: