简体   繁体   English

Python OpenCV - 将图像裁剪为灰色背景区域

[英]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我有一张名为“image.jpg”的图片,它是一张图片,在白色背景上有不同深浅的黑色和深黑色灰色的随机笔触,在一个区域上它会是浅灰色背景

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.我想使用 python 的 opencv 和 PIL(如果有用的话)并裁剪图像,这样我只会看到灰色区域。 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.我似乎不知道从哪里开始,所以我无法包含我尝试过的任何代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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