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
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