I have an image and want to make a rectangle around black part which is in the middle of image.

3 vues (au cours des 30 derniers jours)
I have an image and want to make a rectangle around black part which is in the middle of image.

Réponses (2)

Dishant Arora
Dishant Arora le 23 Juin 2014
Go for connected component labelling and check out for bounding boxes parameter, plot it. For more information check out this demo by image analyst Image Segmentation Tutorial ("BlobsDemo")
  1 commentaire
abhishek
abhishek le 23 Juin 2014
sir i tried that code but its not working as i want. I tried bounding box, regionprops etc. but failed. so plz can you simply make some code for this situation.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 23 Juin 2014
What are you starting with? A gray scale image, or that binary image? If you have that binary image, you might want to call imclose() to connect some regions together, then call bwareaopen() to get rid of small noise regions, Then call regionprops and get the centroids and bounding boxes. Find the centroid closest to the center of the image and extract only that one with ismember.
  9 commentaires
Image Analyst
Image Analyst le 25 Juin 2014
Can't you just use the Pythagorean theorem? Or hypot()?
abhishek
abhishek le 26 Juin 2014
Modifié(e) : abhishek le 26 Juin 2014
hello sir. how can i find out the black pixel locations in an image and distance between center to that point.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by