views:

382

answers:

3

Hi All,

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 http://stackoverflow.com/questions/1890422/how-to-get-edge-coordinates-of-a-image

+3  A: 

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

weichsel
Very nice suggestion with `CroppedImage`. I wasn't aware of such capability with WPF.
Sung Meister
Thanks Weichsel ... Let me look into it
prakash
Weichsel ... I am considering the approach suggested by you ... Need one help do u know where i can find implementation of Corner detection algorithm....or Canny algorithm...
prakash
A: 

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

Padu Merloti
Would you change the tinyURL to the full URL lest they will lead me to NSFW pages at work.
Sung Meister
Thanks Padu i will update you if i got any solution
prakash
Posting Let Me Google That For You links isn't particularly helpful
ChrisF
@ChrisF: Not helpful, but funny.
Ian Boyd
+1  A: 

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.

entens