How can i crop image using C#

2020-06-23 06:01发布

问题:

I have a picture of document taken from camera. Now what i have to do is crop only document from that image . Please can anyone suggest me how best it can be done or first is it possible or not

Edit

For more information .. my next question How to get edge coordinates of a image?

回答1:

If you know the area that contains the image data you would like to crop, you could use this article from MSDN:
http://msdn.microsoft.com/en-us/library/ms752345.aspx

If you need to find the relevant area before cropping, you need to investigate some image processing techniques. e.g. Corner Detection



回答2:

In the assumption you are performing preprocessing for OCR, I would look into using the Aforge Framework if possible.

There is a specific set of functions in the Imaging classes for preforming crops and any other related manipulations(image rotation, hue adjustment, brightness/contrast adjustment, filter noise, etc) that you might need.



回答3:

Two links for you

http://google.com/search?q=c%23+crop+bitmap and http://www.nerdydork.com/crop-an-image-bitmap-in-c-or-vbnet.html