how can i remove white spaces around this image ?
Show older comments
Accepted Answer
More Answers (1)
Image Analyst
on 27 Jun 2017
0 votes
It looks reasonably well cropped right now. Why do you need to chop off a few pixels more? What's the need? I think you can do what you need to do without cropping to the bounding box, so why bother?
5 Comments
Israa Alqaraleh
on 27 Jun 2017
Israa Alqaraleh
on 27 Jun 2017
Image Analyst
on 27 Jun 2017
You might be able to use a radon transform, like in the attached demo, but you'd have to adapt it to find the profile with the greatest contrast.
But I think maybe I'd try to use hough to detect lines. Then find the average angle of all the lines it finds. If that doesn't work you can find the bounding box of the dots with bwconvhull() and then try to identify the 4 sides and determine which are parallel or 90 degrees to each other. The minimum perimeter polygon algorithm may be useful here. On your bottom, because the line doesn't go all the way over, the top line will not be parallel to the bottom line of the convex hull.
Israa Alqaraleh
on 27 Jun 2017
Image Analyst
on 27 Jun 2017
I already told you what to do next if that didn't work: "If that doesn't work you can......". See my above comment.
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!