How can I identify/Detect regions in grayscale image with thin border?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi All, Am working on a problem where I wish to extract regions in the image below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194138/image.gif)
Objective: - Identify every region. - Calculate the Area and related parameters.
What I have done?
- Read image and convert to Grayscale
[MainImg, MainImg_Map] = imread('MainImg');
GrayImg = ind2gray(MainImg,MainImg_Map); #Convert to Gray
- Detect Edges
FindEdge_Sobel = edge(GrayImg, 'sobel');
- Create structuring element to make borders more visible
se1 = strel('line',3, 90);
se0 = strel('line',3, 0);
- Dilate the Image objects
ImgDill = imdilate(FindEdge_Sobel ,[se1 se0]);
- Result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194140/image.jpeg)
MORE QUESTIONS: > How to set foreground and Background for the image? > How I can make those border to enclose region as in Original Image?
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Image Segmentation and Analysis 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!