MATLAB-based load bearing wall extraction method and router position adjustment method
The load-bearing wall information is extracted based on grayscale and feature recognition methods, and the router position is adjusted, which solves the problem of the load-bearing wall attenuation of wireless signals and improves the signal coverage and user experience of the wireless communication network.
Patent Information
- Application Number
- CN202510235411.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-27
AI Technical Summary
The existence of load-bearing walls significantly attenuates wireless signals, affecting the user experience of WiFi and other wireless communication networks, and it is difficult for the prior art to accurately identify and extract load-bearing wall information.
The load-bearing wall extraction method based on MATLAB is adopted to accurately extract the load-bearing wall information in the floor plan through the steps of grayscale, feature recognition and coordinate mapping, and the deployment location of the router is adjusted according to the extracted information to optimize signal coverage.
It realizes relatively accurate extraction of load-bearing walls, provides important data for subsequent signal attenuation analysis and equipment deployment, and improves signal coverage and user experience of WiFi and other wireless communication networks.
Smart Images

Figure CN120217489A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for extracting load-bearing walls, and the present invention also relates to a method for adjusting the position of a router. Background Art
[0002] Load-bearing walls are usually cast-in-place walls pre-embedded with, for example, steel mesh cages. For prefabricated buildings, the exterior wall panels used to construct the building exterior walls usually have steel mesh cages or FRP (Fiber Reinforced Plastics) mesh cages embedded, but for load-bearing walls, they are still mainly made by the cast-in-place method with steel mesh cages. The presence of the steel mesh cage has a certain shielding effect on wireless signals, mainly manifested in that the signal attenuates significantly when passing through the load-bearing wall. The attenuation amount is specifically manifested as the wireless signal attenuating by about 56% when passing through one load-bearing wall. For most civil buildings, the main wall part is the load-bearing wall. With the improvement of people's living standards, almost all households are equipped with WiFi. If the position of the adapted wireless router is arranged improperly, it may seriously affect the Internet access experience of WiFi users.
[0003] The wireless router is just a common application. Other wireless communication networks will also face the same problem, such as mobile phone signals. In view of this, the identification and extraction of load-bearing walls have a great impact on the layout of, for example, wireless routers, wireless APs, and wireless terminals. And in more applications, it is necessary to identify load-bearing walls to provide data input for subsequent signal attenuation analysis, equipment deployment, etc. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method for extracting load-bearing walls with the help of MATLAB to relatively accurately extract the load-bearing wall information in the floor plan and provide input for subsequent, for example, signal attenuation analysis. The present invention also provides an adjustment method for adjusting the position of the deployed router according to the extracted load-bearing wall information.
[0005] According to the first aspect of the embodiments of the present invention, a method for extracting load-bearing walls based on MATLAB is provided. The extraction method includes: 1) Grayscale conversion, converting the floor plan into grayscale; 2) Identification, obtaining the load-bearing walls from the floor plan through feature recognition; 3) Coordinate mapping, mapping the identified load-bearing walls into a given coordinate system.
[0006] Optionally, before the identification step, there is also a step of image enhancement for the floor plan.
[0007] Optionally, the step of image enhancement adopts: The first enhancement method is an enhancement method based on histogram equalization; The second enhancement method is a deconvolution enhancement algorithm; The third enhancement method is a sharpening filtering algorithm; The fourth enhancement method is a frequency domain filtering algorithm; The fifth enhancement method is a mapping method from a blurred image to a clear image based on convolutional neural network training; The sixth enhancement method, if there are multiple floor plan drawings of the same type, uses a multi-frame image complementary restoration algorithm; or The seventh enhancement method uses a blind deblurring algorithm.
[0008] Optionally, before the recognition step, there is also a step of converting a grayscale image into a binary image.
[0009] Optionally, the step of converting a grayscale image into a binary image is as follows: Use the Otsu method to determine a threshold and a reference grayscale value, and based on this threshold and this reference grayscale value, define the grayscale value of the pixels in the grayscale image whose grayscale value is less than or equal to the reference grayscale value + threshold as 0, and the grayscale value of the remaining pixels as 255.
[0010] Optionally, the threshold is not greater than 38, and the reference grayscale value is not greater than 65.
[0011] Optionally, before performing coordinate mapping, first obtain the boundary information of the load-bearing wall, and then convert the grayscale value of the pixel points with a grayscale value of 255 in the area constrained by the boundary to form a closed loop to 0.
[0012] Optionally, when performing coordinate mapping, only perform coordinate mapping on the boundary of the load-bearing wall.
[0013] Optionally, after performing coordinate mapping on the load-bearing wall, grid the floor plan drawing after address mapping to facilitate obtaining the matrix distribution of signal strength.
[0014] According to the first aspect of the embodiments of the present invention, a router adjustment method is provided. A user presets several expected deployment positions of routers and several signal receiving points. After mapping the load-bearing wall in a predetermined coordinate system according to the extraction method described in the first aspect of the embodiments of the present invention, set the current deployment position of the router, and calculate the current signal strength of the signal receiving points according to the position information of the load-bearing wall; Adjust the deployment position of the router, calculate the next signal strength of the signal receiving points, and traverse all deployment positions; Calculate the mathematical average of the signal strengths of each signal receiving point at each deployment position, and take the deployment position corresponding to the maximum value of the mathematical average as the selected deployment position.
[0015] According to the load-bearing wall extraction method based on MATLAB in the embodiments of the present invention, the floor plan provided by the user is first grayscaled, then the load-bearing walls are obtained through feature recognition, and finally mapped to a given coordinate system, so as to provide input for the application after the load-bearing walls are extracted. The image processing module of MATLAB can accurately obtain the required features through feature recognition, thus providing a relatively good basis for subsequent processing. Description of the Drawings
[0016] Figure 1 It is a floor plan of a floor plan.
[0017] Figure 2 It is a floor plan of a floor plan with load-bearing walls identified.
[0018] Figure 3 Flowchart of the load-bearing wall extraction method based on MATLAB. Detailed Embodiments
[0019] MATLAB is a commercial mathematical software produced by MathWorks, Inc. in the United States, and is used in fields such as data analysis, wireless communication, deep learning, image processing and computer vision, signal processing, quantitative finance and risk management, robotics, and control systems. Among them, the graphics processing module of MATLAB can realize the data visualization function, display vectors and matrices in graphics, and can annotate and print the graphics. High-level plotting includes two-dimensional and three-dimensional visualization, image processing, animation, and expression plotting. It can be used for scientific computing and engineering drawing. The new version of MATLAB has greatly improved and perfected the entire graphics processing function, making it not only more perfect in the functions that general data visualization software has (such as the drawing and processing of two-dimensional curves and three-dimensional surfaces, etc.), but also for some functions that other software does not have (such as the lighting processing, chromaticity processing of graphics, and the representation of four-dimensional data, etc.), MATLAB also shows excellent processing capabilities. At the same time, for some special visualization requirements, such as graphic dialogs, MATLAB also has corresponding functional functions to ensure the requirements of users at different levels. In addition, the new version of MATLAB has also made great improvements in the production of the graphical user interface (GUI), and users with special requirements in this regard can also be satisfied.
[0020] Correspondingly, as Figure 1 shown in the floor plan of the standard floor plan, it can be seen from Figure 1 that the walls completely drawn in black are load-bearing walls. In other words, the standard load-bearing wall primitives in the floor plan have obvious features, generally filled with pure black or dense cross-hatching, which are significantly different from other primitives. Simply using the color principle can make the distinction in principle, and the color can be recognized and extracted through color values.
[0021] For grayscale images, for example, a grayscale value of 255 represents pure white, and a grayscale value of 0 represents pure black.
[0022] Although floor plan images can be in color or black and white, even for color images, the color depths of different graphic elements are different. The load-bearing walls have obvious pure black characteristics. Therefore, by grayscaling the original input floor plan images and then identifying the load-bearing walls based on the grayscale values, the computational amount is relatively small and the accuracy is easy to guarantee. Therefore, regardless of the color mode of the original floor plan images, in the embodiments of the present invention, the image formats are unified and all are converted into grayscale images, that is, the color or black and white floor plan images provided by users are uniformly converted into grayscale images for subsequent binarization processing.
[0023] It should be known that in the embodiments of the present invention, it is mainly used to extract load-bearing walls, and other components in the floor plan images can be completely processed into blanks. Therefore, the computational amount of subsequent processing can be greatly reduced through binarization processing.
[0024] In addition, considering that due to different ways for users to input floor plan images into a computer, there may be a problem that the clarity of the obtained original floor plan images varies greatly. Therefore, in the embodiments of the present invention, before identifying the load-bearing walls, all or some of the floor plan images with low clarity can be subjected to image enhancement.
[0025] Regarding image enhancement, in the field of image processing technology, its basic function is to eliminate blurring and improve image quality, especially applicable to fields such as image restoration, enhancement, and super-resolution. The following are the optional image enhancement methods in the embodiments of the present invention: 1. Traditional image processing methods. This type of processing method is relatively mature, based on mathematics and signal processing technologies, and is applicable to slightly blurred images.
[0026] 1.1 Deconvolution. The basic principle of deconvolution is to estimate the blur kernel (point spread function, PSF) of the image and use deconvolution algorithms (such as Wiener filtering, Richardson-Lucy algorithm) to restore a clear image. Application scenarios: situations where the blur kernel is known or can be estimated (such as motion blur, Gaussian blur). Advantages: Fast calculation speed, suitable for simple blur. Disadvantages: Sensitive to noise, poor effect when the blur kernel estimation is inaccurate.
[0027] 1.2 Sharpening filtering method. The Laplace operator is used to enhance the image edges. Unsharp Masking can also be used to enhance details by subtracting the blurred image. Application scenarios: Slightly blurred images. Advantages: Simple and easy to implement. Disadvantages: May amplify noise.
[0028] 1.3 Frequency domain filtering method, whose basic principle is: removing high-frequency noise or low-frequency blur in the frequency domain (such as Fourier transform). The common methods are high-pass filtering or low-pass filtering. The former retains high-frequency details and removes low-frequency blur, while the latter removes high-frequency noise. Applicable scenarios: specific types of blur (such as motion blur). Disadvantage: Some details may be lost.
[0029] 2. Image restoration method based on deep learning. This method requires relatively more samples for similar processing of the same type of floor plan. Deep learning methods have made remarkable progress in the fields of image deblurring and super-resolution, and are especially suitable for complex blur and low-quality images.
[0030] 2.1 Convolutional Neural Network (CNN) method, whose principle is: learning the mapping from blurred images to clear images by training a neural network. Common models: SRCNN (Super-Resolution Convolutional Neural Network) and DeblurGAN. Both of these models belong to common deep learning-based image restoration methods and will not be elaborated here. The advantages of this type of image enhancement method are that it can handle complex blur and has better effects than traditional methods. The disadvantage is that it requires a large amount of training data and consumes a large amount of computing resources.
[0031] 2.2 Generative Adversarial Network (GAN) method, whose principle is to generate high-quality clear images through the adversarial training of a generator and a discriminator. A common model is DeblurGAN: specifically for image deblurring. Another common model is ESRGAN (Enhanced Super-Resolution GAN): for image super-resolution. The advantages of this type of image enhancement algorithm are that the generated images have rich details and better visual effects. The disadvantage is that the training is difficult and artifacts may appear.
[0032] 2.3 Self-supervised learning method, whose principle is to use the structural information of the image itself for training without a large amount of labeled data. A common method is Noise2Noise: training the model through noise image pairs. Another common method is CycleGAN: for image style transfer and deblurring. The advantages of this type of image enhancement algorithm are that it reduces the dependence on labeled data. Disadvantage: The effect may be weaker than that of supervised learning methods, but it can meet the needs of the embodiments of the present invention. After all, the load-bearing wall is significantly different from other walls.
[0033] 2.4 Super-resolution reconstruction method, the principle of which is to convert a low-resolution image into a high-resolution image through a deep learning model. A commonly used model is SRGAN: a super-resolution model based on GAN. Another common model is EDSR (Enhanced Deep Super-Resolution Network): a high-performance super-resolution model. The advantage of these image enhancement algorithms is that they can significantly improve the image resolution. The disadvantage is the high computational complexity.
[0034] 3. Multi-frame image restoration algorithm, which is mainly applied to the processing when there are multiple samples of the same house type diagram, and multiple samples can be used for restoration through information complementarity.
[0035] 3.1 Multi-frame super-resolution algorithm, the principle of which is to register and fuse multiple low-resolution images to generate a high-resolution image. The advantage of this image enhancement method is to improve the image quality by using multi-frame information. The disadvantage is that multiple frames of images are required and the computational complexity is high.
[0036] 3.2 Multi-frame deblurring algorithm, the basic principle of which is to remove blur by using complementary information in multiple frames of images. A commonly used method is the optical flow method: estimating the inter-frame motion to restore a clear image. Another common method is blind deconvolution: estimating the blur kernel by combining multi-frame information. The advantage of these algorithms is that they are suitable for dynamic scenes. The disadvantage is the high requirement for inter-frame registration.
[0037] 4. Blind deblurring method, which is mainly applied when the blur kernel is unknown, and these blind deblurring techniques can be used.
[0038] 4.1 Optimization-based method, the basic principle of which is to simultaneously estimate the blur kernel and the clear image through an optimization algorithm. A commonly used method is the maximum a posteriori probability (MAP): optimizing by combining prior knowledge. Another commonly used method is sparse representation: restoring by using the sparsity of the image. The advantage of these image enhancement methods is that there is no need to know the blur kernel in advance. The disadvantage is the high computational complexity and the possibility of falling into a local optimum.
[0039] 4.2 Deep learning-based method, the principle of which is to directly learn the mapping between the blur kernel and the clear image through a neural network. A commonly used model is Deep Blind Deblurring: an end-to-end blind deblurring model. The advantage of these methods is that the effect is better than that of traditional methods. The disadvantage is the same as that of other deep learning-based methods, that is, a large amount of training data is required, but once the model is generated, subsequent processing will be very convenient.
[0040] 5. Other methods include the inpainting method. When there are missing or damaged areas in an image, they can be filled through repair techniques. The noise removal method is applicable when there is noise in the image, and the quality can be improved through denoising techniques.
[0041] For the above image enhancement methods, those skilled in the art can make a trade-off according to the situation of the image samples (such as blur type, noise level, computing resources, etc.) and choose a suitable method, which will not be elaborated here.
[0042] After image enhancement, the contrast between the image and the background is often higher, making it easier to distinguish the image from the background. As mentioned above, for the extraction of load-bearing walls, only the load-bearing walls need to be extracted, and other primitives can be completely omitted or not displayed. Load-bearing walls often have obvious features. In the vast majority of floor plans, load-bearing walls are drawn with pure black primitives. Therefore, using the binary method has unique advantages.
[0043] Therefore, before identifying the load-bearing walls, further preprocessing of the enhanced floor plan is helpful for the success rate of identification. This preprocessing is mainly binarization.
[0044] Binarization is a common image processing method. There are many binarization methods available. In the embodiments of the present invention, the binarization function embedded in MATLAB is used, that is, the Otsu method is used for binarization. In the embodiments of the present invention, a threshold and a reference gray value are determined. Based on this threshold and this reference gray value, the gray values of the pixels in the grayscale floor plan whose gray values are less than or equal to the reference gray value + threshold are defined as 0, that is, pure black, and the gray values of the remaining pixels are defined as 255, that is, pure white. Accordingly, the load-bearing walls can be separated separately and presented on a pure white background.
[0045] Figure 2 The floor plan after binarization is shown. It can be seen from the figure that the binarized floor plan consists only of load-bearing walls composed of black primitives, and the other primitives are basically completely eliminated, presenting the characteristics of a white background. But from Figure 2 it can be seen that there are still some defects in the figure, mainly the noise generated by other primitives.
[0046] The above is only the result obtained through color value recognition. Compared with load-bearing walls, the noise features are also relatively obvious. It is often relatively scattered, while load-bearing walls are often continuous in the row direction or column direction. In other words, load-bearing walls often have a certain length and width and have a certain distribution scale in the row direction or column direction. And through the image processing toolbox of MATLAB, the part that may be a load-bearing wall in the binary image can be extracted.
[0047] It is also possible to use, for example, the recognition of the continuity of rows or columns to determine whether it is a load-bearing wall.
[0048] After the preliminary recognition of the load-bearing wall, contour detection is performed to obtain the boundary information of the load-bearing wall. After the boundary information is determined, the method of image filling can be directly used to eliminate the defective points in the load-bearing wall graph, that is, the pixel points with a gray value of 255 in the load-bearing wall graph are converted into 0.
[0049] Finally, the recognized boundary information of the load-bearing wall is mapped into a given coordinate system according to a predetermined ratio to provide input for subsequent processing such as signal simulation.
[0050] The following describes the position of the wireless router and the wireless signal coverage. It should be noted that under the condition that the position of the wireless router is determined, there are still many factors affecting the wireless signal coverage, including the parameters of the router itself, such as transmit power, antenna type, frequency (2.4 GHz or 5 GHz), etc., and at the same time, it is also affected by obstacles, mainly load-bearing walls, non-load-bearing walls and furniture, etc.
[0051] In the embodiments of the present invention, only the load-bearing wall is considered, and for the transmit power, antenna type and frequency, etc., which belong to fixed conditions, and furniture, etc. are possible subsequent layout situations. Therefore, in the embodiments of the present invention, it can be realized simply based on simulation. If on-site, a mobile phone APP such as the GiWiFi mobile phone assistant can also be used to identify the signal strength. If simulation is used to implement, the free space loss of the wireless signal can be not considered, the attenuation of other obstacles except the walls (including load-bearing walls and non-load-bearing walls) can be not considered, and the interference (such as the interference of other wireless devices, electrical appliances, etc.) can be not considered.
[0052] How to calculate the wireless signal coverage according to the position of the wireless router and the distribution of the load-bearing walls Calculating the signal coverage of the wireless router needs to consider multiple factors, including the position of the router, transmit power, antenna type, obstacles (such as load-bearing walls, furniture, etc.) and environmental interference, etc. The following are the specific calculation methods and steps: Based on the obstacle attenuation, for the load-bearing wall (generally a reinforced concrete wall), the attenuation is about 10 - 20 dB, and taking the median value of 15 dB, for the ordinary brick wall (currently mainly made of hollow bricks), the attenuation is about 5 - 10 dB, and taking the median value of 7 dB It should be known that for obstacle attenuation, there are established calculation methods in the art, namely RSSI (dBm) = transmit power (dBm) - free space loss (dB) - obstacle attenuation (dB). Under the condition of not considering free space loss, only obstacle attenuation can be considered. If free space loss is taken into account, the distance factor can be considered. This is common general knowledge in the art and will not be elaborated here.
[0053] Based on obstacle attenuation, mainly calculate the signal path, specifically from the router location to the target area, and calculate the number of load-bearing walls that the signal needs to pass through. For each load-bearing wall passed through, the signal strength is reduced by 10 - 20 dB (taking 15 dB as mentioned above).
[0054] Then estimate the signal strength at the predetermined position, mainly according to the distance and obstacle attenuation, and calculate the signal strength in the target area. Generally, a signal strength ≥ -70 dBm is required to ensure a good network connection.
[0055] Finally, adjust the router position according to the signal strengths at multiple target positions to improve the overall user experience. Generally speaking, if the signal is weak in certain areas, the position of the router can be adjusted to minimize the number of load-bearing walls that the signal passes through.
[0056] In addition, the router can also be placed in the central position to avoid being close to load-bearing walls.
[0057] Generally speaking, in a housing unit, there are often multiple frequently used points, usually the living room, bedroom, study, etc. Several definite points can be selected according to user habits. At the same time, for the router, its deployment location is often less restricted, but it is usually deployed at a certain position in the living room. Multiple positions can also be selected in the selectable area as the expected deployment positions. After the expected deployment positions of the router are determined, the signal strengths at the receiving points within the arc can be determined through simulation to form a distribution, and then the deployment position can be adjusted to view the signal strength distribution. Users can thus select a suitable deployment position for the router.
Claims
1. A load-bearing wall extraction method based on MATLAB, characterized in that: The extraction method comprises: 1) Grayscale: grayscale the floor plan; 2) Identification, obtaining the load-bearing walls by feature recognition of the floor plan; 3) Coordinate mapping: mapping the identified load-bearing walls into a given coordinate system.
2. The extraction method according to claim 1, characterized in that Before the recognition step, a step of image enhancement of the floor plan is also included.
3. The extraction method according to claim 2, characterized in that The steps of image enhancement are as follows: The first enhancement method is an enhancement method based on histogram equalization; The second enhancement method is a deconvolution enhancement algorithm; The third enhancement method is a sharpening filter algorithm; The fourth enhancement method is a frequency domain filtering algorithm; The fifth enhancement method is a mapping method from a blurred image to a clear image based on convolutional neural network training; The sixth enhancement method is to use a multi-frame image complementary restoration algorithm if there are multiple floor plans of the same type; or The seventh enhancement method adopts a blind deblurring algorithm.
4. The extraction method according to claim 1, characterized in that Before the recognition step, a step of converting the grayscale image into a binary image is also included.
5. The extraction method according to claim 4, characterized in that The steps to convert a grayscale image into a binary image are: The Otsu method is used to determine a threshold and a reference grayscale value. Based on the threshold and the reference grayscale value, the grayscale values of pixels in the grayscale image whose grayscale values are less than or equal to the reference grayscale value + the threshold are defined as 0, and the grayscale values of the remaining pixels are defined as 255.
6. The extraction method according to claim 5, characterized in that The threshold value is no greater than 38, and the reference grayscale value is no greater than 65.
7. The extraction method according to any one of claims 4 to 6, characterized in that Before coordinate mapping, the boundary information of the load-bearing wall is first obtained, and then the grayscale value of the pixel point with a grayscale value of 255 in the area constrained by the closed loop formed by the boundary is converted to 0.
8. The extraction method according to claim 7, characterized in that When performing coordinate mapping, only the boundaries of the load-bearing walls are mapped.
9. The extraction method according to claim 1, characterized in that After coordinate mapping of the load-bearing walls, the floor plan after address mapping is gridded to obtain the matrix distribution of signal strength.
10. A router adjustment method, characterized in that: The user presets several expected deployment positions of the routers and several signal receiving points, maps the load-bearing wall in a predetermined coordinate system according to the extraction method described in any one of claims 1 to 9, sets the current deployment position of the router, and calculates the current signal strength of the signal receiving point according to the position information of the load-bearing wall; Adjust the deployment location of the router, calculate the next signal strength of the signal receiving point, and traverse all deployment locations; Calculate the mathematical mean of the signal strength of each signal receiving point at each deployment position, and take the deployment position corresponding to the maximum mathematical mean as the selected deployment position.