Skip to content
Advertisement

plt.imshow() display the image inside another image

I am new to Python and I apologize if this is very basic. I am doing image processing but when I read a png image using cv2 and then display the image using plt.imshow() it gives me strange images(Image with extra boundries). I did the following.

JavaScript

I am attaching the resulting images here.

[the original image]

1

[After displaying the image through plt.imshow().]

2

[after doing opening image processing technique]

3

Advertisement

Answer

Is the extra part you’re talking about a red area?enter image description here

If I understand correctly, This code can be used to cut the transparent part of the picture

JavaScript

newpic1 newpic2

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement