如何以适当的方式裁剪图像,C#? [英] How to crop an image in an appropriate way, C#?

查看:92
本文介绍了如何以适当的方式裁剪图像,C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个能够像SAT一样从多项选择中获得答案的程序。因此,为了确定选择哪个答案我想到了获得特定像素的颜色

(如果像素颜色接近黑色,则选择menas这个选项......)

但在我这样做之前,因为它需要很多精确度来处理特殊像素,我正在寻找一些东西来帮助我裁剪扫描的答案表 - 利用页面上的框架或任何其他标志。并使它成为直的(以防有人以错误的方式扫描它)

所以有什么建议吗?



我有什么尝试过:



我在很多网站上搜索了3天,但发现我的情况没什么用处!

Hi, I am working on a program which is able to get the answers from a multiple-choices questions just like SAT. So in order to determine which Answer was selected I thought about getting the color of specific pixels
(If pixel color is nearly black that menas this choice is selected...)
But before I do that and since it requires a lot of accuracy to deal with specefic pixels, I am searching for something to help me crop the scanned Answers sheet - by taking advantage of the frame on the page or any other signs. and to make it straight (in case someone scanned it in a wrong way)
So any suggestions?

What I have tried:

I searched a lot of sites for 3 days but found nothing useful to my case!

推荐答案

请参阅以下CodeProject文章:

裁剪图像 [ ^ ]

< a href =https://www.codeproject.com/Articles/3319/Image-Rotation-in-NET> .NET中的图像轮换 [ ^ ]



这里是WPF版本:在WPF中旋转和裁剪图像 - Pete Brown's 10rem.net [ ^ ]



这里是一个跨平台的.NET Core库: GitHub - SixLabors / ImageSharp:一个用于处理图像文件的跨平台库;用C#编写 [ ^ ]



这是一篇C#模板匹配文章: C#中的快速对象检测 [ ^ ]



对于模板匹配,您还可以使用全面的 OpenCV 库,但这主要是C ++:模板匹配 - OpenCV 2.4.13.7文档 [ ^ ]
See these CodeProject articles:
Cropping Images[^]
Image Rotation in .NET[^]

And here's a WPF version: Rotating and cropping an image in WPF - Pete Brown's 10rem.net[^]

And here's a cross platform .NET Core library: GitHub - SixLabors/ImageSharp: A cross-platform library for the processing of image files; written in C#[^]

Here is a C# template matching article: Rapid Object Detection in C#[^]

For template matching you can also use the comprehensive OpenCV library, but this is mostly C++: Template Matching — OpenCV 2.4.13.7 documentation[^]


这不是一个简单的领域,你需要潜入dee进入理论。我建议你这个开头:

重定向通知 [ ^ ]

请注意上面的文章只是一个开头,它描述了最复杂的情况。



如果您没有摄影,但扫描文档我建议您阅读Google搜索提供的内容: Google [ ^ ]



我知道这个答案并不是一个快速的帮助。但是,如果没有人偶然处理过这个话题,那么你就会得到更好的答案。这里没有人愿意做你的工作。



抱歉没有更好的新闻。
This is not an easy field and you Need to dive in deep into the theory. I would suggest you this as a start:
Redirect Notice[^]
Please note the above article is only a start and it descibes the "most" complex case.

In case you have not a photography, but a scanned document I suggest to read through what this Google search presents:Google[^]

I am aware that this answer is not really a quick help. But if noone who deals with this topic by chance has read your question, you will get no better answers. Nobody here will be ready to do your job.

Sorry not to have better News.


这篇关于如何以适当的方式裁剪图像,C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆