# How to find length of wall sizes

I have room size calculated from mathematica. Now i have to classify between walls from the image

My second output should be from the source image, i have to classify similar walls based on thickness and categorize as External wall 1, Interior wall2 along with their lengths. I am new to mathematica and any help will be appreciated

source image:

I have achieved the canvas layout based on

rooms = ComponentMeasurements[watershed, "BoundingBox"];

Clear[growRect]
growRect[{{x1_, y1_}, {x2_, y2_}}] :=
Module[{checkRectEmpty, growSingleDirection, growSingleStep, cx, cy,
left, top, right, bottom, sizeEstimate, size},
(
{cx, cy} = Round[{x1 + x2, y1 + y2}/2];

checkRectEmpty[{left_, top_, right_, bottom_}] :=
Max[ImageValue[
m, {cx - left ;; cx + right, cy - top ;; cy + bottom}]] == 0;
growSingleDirection[size_, grow_] :=
If[checkRectEmpty[size + grow], size + grow, size];
growSingleStep[size_] :=
Fold[growSingleDirection, size, IdentityMatrix[4]];

sizeEstimate =
Abs[Round[{x2 - x1, y2 - y1, x2 - x1, y2 - y1}/2 - 20]];
{left, top, right, bottom} =
FixedPoint[growSingleStep, sizeEstimate, 20];
Rectangle[{cx - left, cy - top}, {cx + right, cy + bottom}]
)]


Please let me know how can i enhance further to achieve the sizes for walls similar to room sizes

• What were your code attempts so far? How do you calculate room sizes as you reference? These sorts of things, like your code attempts, go a long way towards helping others to help answer your question! Welcome to mma.SE :) Feb 4, 2020 at 7:51
• @CATrevillian - I have calculated room sizes based on reference provided in link Feb 4, 2020 at 9:33
• You should add this referenced link to your question in an edit, and provide the code you used to do what you have done so-far. It would be far better to do this and would improve your chances of having the question looked at for people to answer it. As it stands, I am not sure what or how you have done what you have done, and have no way to answer. Others may vote to close this also if it does not appear you have done something with Mathematica. Links and updates provided in the comments can be easily buried and become non-visible a result. Feb 4, 2020 at 13:45
• I have edited. Thanks Feb 5, 2020 at 13:23
• Does mathematica support detecting wall sizes? Feb 7, 2020 at 5:26