MATLAB Answers

How to find the valley areas of the image?

3 views (last 30 days)
Sk
Sk on 12 Jan 2020
Commented: Sk on 20 Jan 2020
How to calculate the depth of the letters in the given image, so that i can find the valley areas ? Please help me.1.jpg

  0 Comments

Sign in to comment.

More Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 12 Jan 2020
Edited: KALYAN ACHARJYA on 12 Jan 2020
The segmention approach for this image is already answerd, for localizing valley region please see the watershed algorithm. It would be great if you follow the Gonzalez Book (Digital Image Processing using MATLAB), where detail explanation is discussed with matlab code. Please note that here you can get the area of valley or basin, not the depth.
rgb=imread('rgb.jpg');
BW1=im2bw(rgb2gray(rgb));
BW2=bwareaopen(~BW1,60);
%% This Part @Image Analyst
windowSize=5;
kernel=ones(windowSize)/windowSize^2;
blurryImage=conv2(single(BW2),kernel,'same');
BW3=blurryImage>0.5;
%% Morpho Operation
se=strel('disk',2);
BW3=imclose(BW3,se);
rgb(~BW3)=0; % Mask Apply
imshow(rgb);

  13 Comments

Sk
Sk on 20 Jan 2020
@Image Analyst, The output after applying adapthisteq() and binarization step is black. And my final output is given below:3.jpg
KALYAN ACHARJYA
KALYAN ACHARJYA on 20 Jan 2020
May be it can slightly improved by preprocessing & appropriate morpho operation.

Sign in to comment.

Sign in to answer this question.