A computer-implemented method for determining an architectural layout, the method comprising: - providing (S10-S52) a cycle of points, ( x 0,..., x n -1), that represents a planar cross section of a cycle of walls, and, assigned to each respective point x i, a respective first datum that represents a direction normal to the cycle of points at the respective point x i, the first datum assigned to each point x i being a normal vector n i which represents an approximate normal of a wall to which the point x i belongs; - counting, for each given normal vector n i, how many other normal vector n j form an angle lower than a predetermined threshold with the given normal vector n i, and denoting as N 0 the normal vector associated to the highest count; - minimizing a Markov Random Field energy, E ( l ( x 0),..., l ( x n -1)), defined on the cycle of points with labels l ( x i) taking values in a set of second data ( N k) k ∈{0,...,L- 1} each representing a respective direction N k normal to the architectural layout, thereby assigning, to each respective point x i, a respective second datum that is a respective one l ( x i) of the set of second data, the set of second data ( N k) k ∈{0,..., L -1} comprising angles between each wall and its neighboring walls, the vector denoted as N 0 normal being rotated according to each angle of the set of second data ( N k) k ∈{0,..., L -1} in order to form the labels of the MRF, the MRF energy comprising a unary term, ∑ i = 0 n − 1 D x i, l x i that penalizes, for each point x i, an angular distance, (1 - | N k.n i |, between the direction represented by the assigned second datum N k and the direction represented by the assigned first datum n i, the MRF energy further comprising a binary term, ∑ i = 0 n − 1 S x i, x i + 1, l x i, l x i + 1, that increasingly penalizes, for each couple of consecutive points ( x i, x i +1), an angular distance, 1 k≠m | n i. n j |, between the directions represented by the assigned second data ( N k, N m) as an angular distance (| n i. nj |) between the directions represented by each of the respective first datum ( n i, n j) assigned to each point of the couple of consecutive points ( x i, x j +1) decreases; - identifying maximal sets of consecutive points to which a same second datum N k is assigned; and - determining (S82-S86) a cycle of vertices ( y 0,..., y W -1) bounding a cycle of segments that represents the architectural layout, each segment corresponding to a respective wall, each segment fitting a respective maximal set and being normal to the direction represented by the second datum assigned to respective consecutive points of the respective maximal set. - providing (S10-S52) a cycle of points, ( x 0,..., x n -1), that represents a planar cross section of a cycle of walls, and, assigned to each respective point x i, a respective first datum that represents a direction normal to the cycle of points at the respective point x i, the first datum assigned to each point x i being a normal vector n i which represents an approximate normal of a wall to which the point x i belongs; - counting, for each given normal vector n i, how many other normal vector n j form an angle lower than a predetermined threshold with the given normal vector n i, and denoting as N 0 the normal vector associated to the highest count; - minimizing a Markov Random Field energy, E ( l ( x 0),..., l ( x n -1)), defined on the cycle of points with labels l ( x i) taking values in a set of second data ( N k) k ∈{0,...,L- 1} each representing a respective direction N k normal to the architectural layout, thereby assigning, to each respective point x i, a respective second datum that is a respective one l ( x i) of the set of second data, the set of second data ( N k) k ∈{0,..., L -1} comprising angles between each wall and its neighboring walls, the vector denoted as N 0 normal being rotated according to each angle of the set of second data ( N k) k ∈{0,..., L -1} in order to form the labels of the MRF, the MRF energy comprising a unary term, ∑ i = 0 n − 1 D x i, l x i that penalizes, for each point x i, an angular distance, (1 - | N k.n i |, between the direction represented by the assigned second datum N k and the direction represented by the assigned first datum n i, the MRF energy further comprising a binary term, ∑ i = 0 n − 1 S x i, x i + 1, l x i, l x i + 1, that increasingly penalizes, for each couple of consecutive points ( x i, x i +1), an angular distance, 1 k≠m | n i. n j |, between the directions represented by the assigned second data ( N k, N m) as an angular distance (| n i. nj |) between the directions represented by each of the respective first datum ( n i, n j) assigned to each point of the couple of consecutive points ( x i, x j +1) decreases; - identifying maximal sets of consecutive points to which a same second datum N k is assigned; and - determining (S82-S86) a cycle of vertices ( y 0,..., y W -1) bounding a cycle of segments that represents the architectural layout, each segment corresponding to a respective wall, each segment fitting a respective maximal set and being normal to the direction represented by the second datum assigned to respective consecutive points of the respective maximal set.