Hello, How to crop this image if you please?
1 view (last 30 days)
Show older comments
I wanna crop this image. I have some other images like those but with different currencies so I want something that can be applied to all of them in order to differentiate them. Thanks
2 Comments
Chad Greene
on 20 Jun 2014
I don't think crop is the word you're looking for if you simply want to differentiate between different types of currency. Cropping simply means to cut the edges off of the image. Principal component analysis may help you automatically identify different types of currency.
Accepted Answer
Image Analyst
on 21 Jun 2014
This is very trivial if you just simply put the notes over the proper colored background. For notes with light colored borders, put them on black construction paper. Then it's pretty trivial - there are at least three ways I can think of off the top of my head. It's so much easier to do image processing when you start with a good image than to try things to "fix up" a crummy image image before you can start the image processing. See attached m-file, test3.m, which will produce the image below (where I darkened the surround to simulate you taking your photo on the proper background).
Basically what I did was to convert to graylevel and threshold. Then call regionprops() to get the bounding box. Finally call imcrop() to crop out the image into a new, smaller image.
5 Comments
Image Analyst
on 28 Jun 2014
Why don't you just tape black paper to the lid? You can get the note in a variety of ways, such as by converting to gray scale and thresholding, cropping from know coordinates, or getting the sum vertically and horizontally and looking for smooth and "rough" parts, or by using a texture filter such as entropyfilt() or stdfilt() to find smooth parts and taking the largest smooth area as a background mask. What approach do you want to try? If you try one and want me to look over your code, attach it.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!