简体   繁体   中英

Python OpenCV - Crop image to area with gray background

It is quite hard to explain what I want in the title. I'll show what I need with an example or input/output. I have an image called 'image.jpg' that'll be an image with random strokes of different shades of black and dark-blackish gray on a white background and on one area it'll be a light grey background

1个

I want to use python's opencv and maybe PIL if it's useful and crop the image so I'll only see the gray area. So after whatever code I'll do it'll look like this image here

2个

That's it, appreciate all help here. I don't seem to know where to start here so I can't include whatever code I tried.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM