0

I am trying to generate images with opencv without it adding a white border and tick marks around the image.

Here is an example image.

This is an example of what I want it to return.

user2722968
  • 13,636
  • 2
  • 46
  • 67
dsBoulder
  • 67
  • 8
  • So given the example image, are you trying to return its untouched copy? Removing the border is trivial, but if you want the actual original pixels, that's a difficult problem. A suggestion I have is to do image inpainting but you need to detect those coloured boxes and supply that as a mask into the process - this is also not guaranteed to give you the original image. Also, please show what you've tried to solve this problem. This page is useful: [ask]. – rayryeng May 15 '18 at 20:57
  • No sorry. I am trying to return the identical first image without the white boarder – dsBoulder May 15 '18 at 21:01
  • How are you actually producing the first image? It looks like you're using `matplotlib` to display the image. If that's the case, link #1 to remove all of the borders and axes: https://stackoverflow.com/questions/9295026/matplotlib-plots-removing-axis-legends-and-white-spaces. Link #2 to actually obtain the image data from the window: https://stackoverflow.com/questions/23345165/python-how-to-get-the-data-from-an-plt-imshow. – rayryeng May 15 '18 at 21:02

0 Answers0