A control method for household security intelligent car system

Through the home security smart car system, combined with the smart car automatic navigation and environment sensing system, using infrared compensation algorithm and PID control, automatic navigation and real-time environmental monitoring are realized, solving the problem that the traditional indoor environment detection system cannot meet the modern safety hazards, and providing Mobile air quality detection and fire hazard monitoring solutions.

CN114661044BActive Publication Date: 2024-08-27HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210066662.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-08-27
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

The existing indoor environment detection system is relatively traditional in design and cannot meet the safety hazard needs of modern home life. In particular, there are many accidents in aspects such as air quality and fire hazards.

Method used

Adopt a home security smart car system, combine the smart car automatic navigation system and the on-board environment perception system, run in parallel through two lines, use components such as cameras, infrared ranging sensors, air quality sensors, etc., and adopt a fused infrared compensation algorithm and improved PID The control algorithm performs automatic navigation and environmental monitoring, and uploads data in real time through the WiFi module and cloud server.

Benefits of technology

It realizes rapid identification of obstacles, automatic navigation, real-time monitoring of air quality and fire hazards, reminds users and stops navigation, solves the problem of home safety hazards, meets the needs of modern environmental monitoring, and operates normally in dark environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661044B
    Figure CN114661044B
Patent Text Reader

Abstract

The present invention provides a control method for a household security smart car system. The method utilizes images collected by a camera to realize automatic navigation through an image navigation algorithm integrating an infrared compensation algorithm and a DC motor motion control algorithm. In image processing, an edge detection algorithm is used to fit the image edge of the object to a navigation path. When a suspected obstacle is encountered, a rectangular fuzzy algorithm is used to determine the existence of the obstacle and obtain a fitting path. Infrared ranging is used to compensate for the path in the blind area of ​​the camera field of view. Finally, a PID algorithm is used to control the motor motion to suppress steering twitching and tail swinging of the vehicle body when turning. In terms of environmental perception, periodic detection, threshold comparison, and voice broadcast are used, and the monitored environmental data are uploaded to the cloud in real time, so that users can view and control the status of the smart car through a mobile phone APP, thereby realizing mobile monitoring of the surrounding environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of smart home, and in particular relates to a control method for a home security smart car system. Background Art

[0002] As people's living standards rise, they pay more and more attention to comfort and safety in their home life. However, due to people's neglect of home life safety, safety hazards are always emerging. According to statistics, there are no less than hundreds of thousands of accidents caused by air quality, fire hazards and gas leaks in my country every year.

[0003] At present, most of the domestic indoor environment detection systems are still relatively traditional fixed-point designs, but they can no longer meet the current needs for environmental monitoring. In order to solve the current safety hazards in home life and improve traditional environmental monitoring equipment, a home security smart car system control method is provided. Summary of the invention

[0004] In view of this, in order to solve the deficiencies of the above-mentioned prior art, the purpose of the present invention is to provide a control method for a home security smart car system, the home security smart car system includes a smart car automatic navigation system and a vehicle-mounted environment perception system, the smart car automatic navigation system and the vehicle-mounted environment perception system are operated in a dual-line parallel manner; the vehicle-mounted environment perception system includes an external sensor, a voice module, a WiFi module, a lighting lamp and a cloud server; the smart car automatic navigation system includes a camera for acquiring image acquisition of vehicle front path information, an image recognition module, an infrared ranging sensor, a control system and a motor;

[0005] The control method comprises the following steps:

[0006] Step 1: The smart car automatic navigation system uses an image navigation algorithm that integrates an infrared compensation algorithm. The specific steps are as follows:

[0007] S1: The camera collects images, processes the acquired images, uses Sobel edge detection and Gaussian filtering to marginalize the obtained images, and divides the entire image into two parts, the upper half is the image at a farther distance, and the lower half is the image at a closer distance;

[0008] S2: Calculate the obstacle area S according to the rectangular fuzzy algorithm, determine whether there is an obstacle, and calculate the path L according to the left and right edges of the obstacle;

[0009] S3: There is a blind spot in the camera's field of view, and the infrared ranging sensor is used to compensate the path to obtain a path offset △;

[0010] S4: Calculate the total navigation path M=L+△, where L is the path obtained by image navigation, and △ is the path compensation amount obtained by infrared ranging;

[0011] Step 2: The total navigation path information is transmitted to the control system for motion control decision making, and motion control is performed through the motion control algorithm of the DC motor to achieve automatic navigation for indoor patrol;

[0012] Step 3: Set air quality monitoring thresholds;

[0013] Step 4: Each air quality sensor in the vehicle environment perception module periodically detects the surrounding environment and uploads the data to the cloud server in real time;

[0014] Step 5: When the measured value exceeds the air quality detection threshold, the voice module broadcasts a reminder, and the WiFi module makes the user's mobile phone vibrate to remind them. The monitored environmental data is uploaded to the cloud server in real time, and at the same time communicates with the home security smart car system to stop navigation and stop at the danger point.

[0015] Furthermore, the specific steps of calculating the path L in step S1 are as follows:

[0016] a) Use rectangular fuzzy algorithm to calculate the obstacle area S:

[0017] b) Determine whether there is an obstacle based on the obstacle area S. If S is less than the set threshold, there is no suspected obstacle in the image, and the entire image has only the leftmost and rightmost edges. The calculation formula of the path L is:

[0018]

[0019] Where XLi is the x-coordinate of the left edge of the path of the i-th row, and XRi is the x-coordinate of the right edge of the path of the i-th row;

[0020] c) If the area S of the obstacle is greater than the threshold, it is determined to be an obstacle; if the obstacle is on the left, its right edge is set as the left edge of the path XLi, and the right edge of the path XRi is the original edge value of the image; if the obstacle is on the right, its left edge is set as the right edge of the path XRi, and the left edge of the path XLi is the original edge value of the image; if the obstacle is in the middle, its left edge is set as the right edge of the path XRi, and the left edge of the path XLi is the original edge value of the image; the path L is calculated using formula (1).

[0021] Furthermore, the specific steps of the rectangular fuzzy algorithm in step a are:

[0022] a1) Obtain the edge coordinates of the object based on the edge-processed image. Assume that the image resolution is ML*NL. Define two two-dimensional arrays obj_L[2][NL] and obj_R[2][NL] to store the x and y coordinates of the left and right edges of the object respectively. In the x direction, search for the black and white transition points of the pixel points from left to right. There are two transition points in each row. The first transition point is the left edge of the object, and the second transition point is the right edge of the object. Scan row by row to obtain the left and right edge coordinates of the entire object. Record the x and y coordinate values ​​of the left edge in the two-dimensional array obj_L[2][NL], and the x and y coordinate values ​​of the right edge in obj_R[2][NL].

[0023] a2) Calculate the minimum x-coordinate value of the left edge and the maximum x-coordinate value of the right edge respectively. The difference between the two is the maximum x-coordinate difference. Similarly, calculate the maximum y-coordinate value of the left edge and the minimum y-coordinate value of the right edge. The difference between the two is the maximum y-coordinate difference. After obtaining the edge coordinates of the object, calculate the maximum x-coordinate difference L1. Calculate the maximum y-coordinate difference L2 of the object. L1 and L2 will be used as the two sides of the rectangle. Calculate the area of ​​the rectangle S = L1 × L2, which is approximately the area of ​​the obstacle.

[0024] Furthermore, in step S3, the infrared ranging sensor compensates the path, and the specific steps are as follows:

[0025] a) The infrared distance measuring sensor measures the distance values ​​x1 and x2 every 0.1s;

[0026] The infrared distance measuring sensor is arranged on both sides of the front of the vehicle body, and the angle between the infrared distance measuring sensor and the camera is between 70° and 80°. The infrared distance measuring sensor measures the distance value every 0.1s.

[0027] b) Set the distance threshold for obstacle existence to 50cm. When the infrared distance measurement of the obstacle is greater than 50cm, it is judged that there is no obstacle. When the infrared distance measurement is less than 50cm, it is judged that there is an obstacle.

[0028] c) Substituting the distance values ​​x1 and x2 into formula (2), we can obtain the path offsets △1 and △2 on the left and right sides of the front: the total path offset is △ = △1 + △2;

[0029]

[0030] In the formula, K is the proportional coefficient, and x is the distance value of infrared ranging, in cm.

[0031] Furthermore, the smart car automatic navigation system also includes an encoder, a gyroscope, a display screen and a wireless communication module.

[0032] Furthermore, the method of motor motion control in step 2 comprises the following specific steps:

[0033] a) According to the path M, calculate the path deviation value according to formula (3):

[0034] err=MX m (3)

[0035] Where err is the calculated path deviation value, M is the total path obtained by the automatic navigation algorithm, and Xm is the center coordinate of the camera;

[0036] b) Substitute the current path deviation value err(k), where k is the current moment, into the improved PID control algorithm

[0037] After formula (4), calculate the output PID of the PID controller out (k);

[0038]

[0039] In the formula, K p , K i , K d They are the proportional coefficient, integral coefficient, and differential coefficient of the PID algorithm, respectively. z is the suppression coefficient of the z-axis, err(k) is the path deviation value at the kth moment, k = 0, 1, ···, ∞, Gyro(k) can directly obtain the angular velocity of the z-axis through the gyroscope;

[0040] c) PIDout(k) is superimposed on the output parameters of the left and right motors to change the duty cycle of PWM, thereby achieving the differential speed of the rear wheels and realizing autonomous navigation.

[0041] Furthermore, the external sensors include but are not limited to temperature and humidity sensors, harmful gas sensors, PM2.5 concentration sensors and photoresistors.

[0042] Furthermore, the lighting lamp adjusts the brightness according to the light intensity obtained by the photoresistor to provide lighting services.

[0043] The beneficial effects of the present invention are:

[0044] The control method of the household security smart car system of the present invention, in a home environment, uses the Sobel edge detection algorithm to edge the image, uses the rectangular fuzzy algorithm to quickly determine the obstacle area, judges whether there is an obstacle according to the threshold value, obtains the navigation path, integrates the infrared compensation algorithm to compensate for the blind area of ​​the camera field of view, quickly calculates the total navigation path, effectively avoids obstacles, and determines the best navigation path;

[0045] Using the total navigation path, the improved PID algorithm is used to control the wheel speed through the left and right motors. In the improved PID algorithm, the angular velocity control amount of the z-axis measured by the gyroscope is added to avoid the car losing control due to excessive inertial steering when turning, or steering twitching, tail swinging, and being unable to drive in a straight line due to performance differences and dead zones of the left and right motors.

[0046] The home security smart car system can monitor the surrounding environment in a mobile manner: temperature and humidity detection, air quality detection, smoke concentration detection, PM2.5 detection, fire hazard detection, etc., and use mobile Internet technology to upload the detection information to the user's mobile phone, and at the same time perform voice broadcast reminders. It not only meets the current demand for environmental monitoring, but also achieves mobile air quality detection, integrates automatic navigation with environmental monitoring, and uploads the monitoring data to the cloud in real time, achieving multiple goals at one stroke, and can solve some of the current safety hazards in home life;

[0047] It can automatically adjust the brightness according to the surrounding environment and can operate normally even in darker environments. If there is a power outage at home, the car can also be used as a mobile lighting, which is safe and environmentally friendly. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 is the overall block diagram of the system of the present invention;

[0050] Figure 2 It is the system hardware principle diagram of the present invention;

[0051] Figure 3 A flow chart of a fast rectangular fuzzy algorithm according to an embodiment of the present invention;

[0052] Figure 4 is a flow chart of an image navigation algorithm according to an embodiment of the present invention;

[0053] Figure 5 The figure is a flow chart of an infrared ranging compensation algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following specific embodiments are given to further clearly, completely and in detail illustrate the technical solution of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The purpose of the present invention is to provide a control method for a home security smart car system, the home security smart car system includes a smart car automatic navigation system and a vehicle environment perception system, the smart car automatic navigation system and the vehicle environment perception system are operated in a dual-line parallel manner, such as Figure 1 As shown; the vehicle-mounted environment perception system includes an external sensor, a voice module, a WiFi module, a lighting lamp and a cloud server; the smart car automatic navigation system includes a camera for acquiring image acquisition of the path information in front of the vehicle, an image recognition module, an infrared ranging sensor, a control system and a motor;

[0056] The control method comprises the following steps:

[0057] Step 1: The smart car automatic navigation system uses an image navigation algorithm that integrates an infrared compensation algorithm. The specific steps are as follows:

[0058] S1: Use the MT9V034 camera with a wide angle of 130° and no distortion to collect images, process the acquired images, use Sobel edge detection and Gaussian filtering to marginalize the obtained images, and divide the entire image into two parts, the upper half is the image at a farther distance, and the lower half is the image at a closer distance.

[0059] S2: Calculate the obstacle area according to the rectangular fuzzy algorithm, determine whether there is an obstacle, and calculate the path L;

[0060] a) Use rectangular fuzzy algorithm to calculate the obstacle area:

[0061] The specific steps of the rectangular fuzzy algorithm are:

[0062] a1) Obtain the edge coordinates of the object based on the edge-processed image. The image resolution is 188*120. Define two two-dimensional arrays obj_L[2]

[120] and obj_R[2]

[120] to store the x and y coordinates of the left and right edges of the object respectively. Since the edge pixels of the object are black (grayscale value is 0) and the background is white (grayscale value is 255), the edge coordinates of the object can be accurately obtained by finding the black-white transition of the pixel points. In the image, in the x direction, start from the first row and search for the black-white transition points of the pixel points row by row from left to right. There are two transition points in each row. The first transition point is the left edge of the object, and the second transition point is the right edge of the object. The left and right edge coordinates of the entire object can be obtained. The coordinate values ​​of the left and right edges are recorded in obj_L[2]

[120] and obj_R[2]

[120] respectively. The first dimension of the two-dimensional array is used to store the y coordinate of the edge, and the second dimension is used to store the x coordinate of the edge.

[0063] a2) Calculate the minimum x-coordinate value of the left edge and the maximum x-coordinate value of the right edge according to the two-dimensional arrays obj_L[2]

[120] and obj_R[2]

[120] . Subtract the two values ​​to get the maximum x-coordinate difference value L1. Similarly, calculate the maximum y-coordinate value of the left edge and the minimum y-coordinate value of the right edge, and subtract them to get the maximum y-coordinate difference value L2. L1 and L2 will be used as the two sides of the rectangle, and the area of ​​the rectangle S = L1 × L2 is calculated, which is approximately the area of ​​the obstacle;

[0064] The rectangular fuzzy algorithm flow chart is as follows Figure 3 As shown;

[0065] b) Determine whether there is an obstacle based on the obstacle area S. If S is less than the set threshold, there is no obstacle. The entire image only has the leftmost and rightmost edges. Calculate the path L according to formula (1).

[0066] c) If the obstacle area S is greater than the threshold, it is determined to be an obstacle. If the obstacle is on the left, its right edge is set as the path left edge XLi, and the path right edge XRi is the original edge value of the image; if the obstacle is on the right, its left edge is set as the path right edge XRi, and the path left edge XLi is the original edge value of the image; if the obstacle is in the middle (this situation is rare, it can be regarded as an obstacle on the right and treated the same way), its left edge is set as the path right edge XRi, and the path left edge XLi is the original edge value of the image. Use formula (1) to calculate the path L, the flow chart is as follows Figure 4 shown.

[0067] S3: There is a blind spot in the camera's field of view, and two infrared ranging sensors are used to compensate for it to obtain the path offset △;

[0068] The specific steps are as follows:

[0069] a) The infrared distance sensors on both sides of the front of the vehicle measure the distance values ​​x1 and x2 every 0.1s;

[0070] Since a 130° camera is used, only a 130° range in front can be observed, with a 50° blind spot. Infrared ranging sensors are installed on both sides of the front of the vehicle body, with an angle between 70° and 80° with the camera, and the infrared ranging sensor measures the distance value every 0.1s.

[0071] b) Set the distance threshold for obstacle existence to 50cm. When the infrared distance measurement is greater than 50cm, it is judged that there is no obstacle. When the infrared distance measurement is less than 50cm, it is judged that there is an obstacle.

[0072] c) Substituting the distance values ​​x1 and x2 into formula (2), we can obtain the path offsets Δ1 and Δ2 on the left and right sides of the front: the total path offset is Δ=Δ1+Δ2.

[0073] The fusion infrared compensation algorithm compensates for the blind spots of the camera's field of view, quickly calculates the total navigation path, effectively avoids obstacles, and determines the best navigation path.

[0074] S4: Calculate the total navigation path M=L+△, where L is the path obtained by image navigation, and △ is the path offset obtained by infrared ranging. The flow chart is as follows: Figure 5 shown.

[0075] Step 2: Transmit the navigation path M to the control system, and use the improved PID algorithm to control the motor motion to achieve automatic navigation. The specific steps are as follows:

[0076] a) Based on the path M, calculate the path deviation value err(k) at the kth moment according to formula (3);

[0077] b) Substitute the current path deviation value err(k), where k is the current moment, into the improved PID control algorithm formula (4) to calculate the output PID of the PID controller: out (k);

[0078] Since the car may lose control due to excessive inertial steering when turning, or may twitch or drift, or may not be able to drive in a straight line due to performance differences and dead zones of the left and right motors, it is necessary to add a gyroscope to assist the motor control. When the car body drifts or twitches, a large angular velocity is generated along the Z axis. By suppressing this angular velocity, that is, generating a damping in the Z axis, the above phenomenon can be avoided. The angular velocity Gyro(k) of the z axis can be directly obtained by the gyroscope, and it can be integrated into the PID as an additional item Kz*Gyro(k), which can make the steering smooth and suppress the car body from drifting and twitching.

[0079] c) According to PIDout(k), the duty cycle of the PWM wave that controls the speed of the left and right motors is calculated, thereby achieving the differential speed of the rear wheels and realizing autonomous navigation;

[0080] Based on the PWM parameters of the motor, change the PWM duty cycle of the CPU to control the left and right motors. Set P WM is the duty cycle value of the original PWM that controls the vehicle speed. After correction, the PWM duty cycle of the left motor is: P WM +k1*PIDout(k), where k1 is the proportional coefficient; the PWM duty cycle of the right motor after correction is: P WM -k1*PIDout(k), after the above steps, the differential speed of the rear wheels is achieved;

[0081] It can prevent the car from losing control due to excessive inertia steering when turning, or from experiencing steering twitches, tail swinging, or from being unable to drive in a straight line due to performance differences between the left and right motors and different dead zones.

[0082] Step 3: Environmental monitoring sets air quality detection thresholds.

[0083] Step 4: Each air quality sensor in the vehicle-mounted environment perception module periodically detects the surrounding environment and uploads the data to the cloud server in real time.

[0084] Step 5: When the measured value exceeds the air quality detection threshold, the voice module broadcasts a reminder, and the WiFi module makes the user's mobile phone vibrate to remind them. The monitored environmental data is uploaded to the cloud server in real time, and at the same time communicates with the home security smart car system to stop navigation and stop at the danger point.

[0085] Furthermore, the external sensors include but are not limited to temperature and humidity sensors, harmful gas sensors, PM2.5 concentration sensors and photoresistors.

[0086] Furthermore, the smart car automatic navigation system communicates with the vehicle environment perception system through a 2.4G wireless module, such as Figure 2 shown.

[0087] Furthermore, the lighting lamp adjusts the brightness according to the light intensity obtained by the photoresistor to provide lighting services.

[0088] To summarize, the present invention utilizes an image navigation algorithm that integrates an infrared compensation algorithm and a motion control algorithm of a DC motor to upload environmental data to the cloud, and can monitor the surrounding environment in a mobile manner: temperature and humidity detection, air quality detection, smoke concentration detection, PM2.5 detection, fire hazard detection, etc., and utilizes mobile Internet technology to upload the detection information to the user's mobile phone, while performing voice broadcast reminders. It not only meets the current demand for environmental monitoring, but also achieves mobile air quality detection, integrates automatic navigation with environmental monitoring, and uploads the monitored data to the cloud in real time, achieving multiple goals at one stroke, and can solve some current safety hazards in home life.

[0089] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modification or substitution made to the present invention by any technician in the field within the technical scope of the present invention should be included in the protection scope of the present invention; therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A control method for a home security smart car system, the home security smart car system comprising a smart car automatic navigation system and a vehicle environment perception system, It is characterized in that The smart car automatic navigation system and the vehicle-mounted environment perception system are operated in a dual-line parallel manner. The vehicle-mounted environment perception system includes an external sensor, a voice module, a WiFi module, a lighting lamp and a cloud server; the smart car automatic navigation system includes a camera for acquiring image acquisition of the path information in front of the vehicle, an image recognition module, an infrared ranging sensor, a control system and a motor; The control method comprises the following steps: Step 1: The smart car automatic navigation system uses an image navigation algorithm that integrates an infrared compensation algorithm. The specific steps are as follows: S1: The camera collects images, processes the acquired images, uses Sobel edge detection and Gaussian filtering to marginalize the obtained images, and divides the entire image into two parts, the upper half is the image at a farther distance, and the lower half is the image at a closer distance; S2: Calculate the obstacle area S according to the rectangular fuzzy algorithm, determine whether there is an obstacle, and calculate the path L according to the left and right edges of the obstacle; S3: There is a blind spot in the camera's field of view, and the infrared ranging sensor is used to compensate the path to obtain a path offset △; S4: Calculate the total navigation path M=L+△, where L is the path obtained by image navigation, and △ is the path compensation amount obtained by infrared ranging; Step 2: The total navigation path information is transmitted to the control system for motion control decision making, and motion control is performed through the motion control algorithm of the DC motor to achieve automatic navigation for indoor patrol; Step 3: Set air quality monitoring thresholds; Step 4: Each air quality sensor in the vehicle environment perception module periodically detects the surrounding environment and uploads the data to the cloud server in real time; Step 5: When the measured value exceeds the air quality detection threshold, the voice module broadcasts a reminder, and the WiFi module makes the user's mobile phone vibrate to remind them. The monitored environmental data is uploaded to the cloud server in real time, and at the same time communicates with the home security smart car system to stop navigation and stop at the danger point.

2. A method for controlling a home security smart car system according to claim 1, It is characterized in that The specific steps of calculating the path L in step S1 are as follows: a) Use rectangular fuzzy algorithm to calculate the obstacle area S: b) Determine whether there is an obstacle based on the obstacle area S. If S is less than the set threshold, there is no suspected obstacle in the image, and the entire image has only the leftmost and rightmost edges. The calculation formula of the path L is: Where XLi is the x-coordinate of the left edge of the path of the i-th row, and XRi is the x-coordinate of the right edge of the path of the i-th row; c) If the obstacle area S is greater than the threshold, it is determined to be an obstacle; if If the obstacle is on the left, set its right edge as the path left edge XLi, and the path right edge XRi is the original edge value of the image; if the obstacle is on the right, set its left edge as the path right edge XRi, and the path left edge XLi is the original edge value of the image; if the obstacle is in the middle, set its left edge as the path right edge XRi, and the path left edge XLi is the original edge value of the image, and use formula (1) to calculate the path L.

3. A method for controlling a home security smart car system according to claim 2, It is characterized in that Furthermore, the specific steps of the rectangular fuzzy algorithm in step a are: a1) Obtain the edge coordinates of the object based on the edge-processed image. Assume that the image resolution is ML*NL. Define two two-dimensional arrays obj_L[2][NL] and obj_R[2][NL] to store the x and y coordinates of the left and right edges of the object respectively. In the x direction, search for the black and white transition points of the pixel points from left to right. There are two transition points in each row. The first transition point is the left edge of the object, and the second transition point is the right edge of the object. Scan row by row to obtain the left and right edge coordinates of the entire object. Record the x and y coordinate values ​​of the left edge in the two-dimensional array obj_L[2][NL], and the x and y coordinate values ​​of the right edge in obj_R[2][NL]. a2) Calculate the minimum x-coordinate value of the left edge and the maximum x-coordinate value of the right edge respectively. Subtract the two values ​​to get the maximum x-coordinate difference value. Similarly, calculate the maximum y-coordinate value of the left edge and the minimum y-coordinate value of the right edge. Subtract the two values ​​to get the maximum y-coordinate difference value. After obtaining the edge coordinates of the object, calculate the maximum x-coordinate difference value L. 1 ; Calculate the maximum value L of the object's y coordinate difference 2 , L 1 and L 2 As the two sides of the rectangle, calculate the area of ​​the rectangle S = L 1 ×L 2 , which is approximately the area of ​​the obstacle.

4. A method for controlling a home security smart car system according to claim 1, It is characterized in that In step S3, the infrared distance measuring sensor compensates the path, and the specific steps are as follows: a) The infrared distance sensor measures the distance value x every 0.1s 1 and x 2 ; The infrared distance measuring sensor is arranged on both sides of the front of the vehicle body, and the angle between the infrared distance measuring sensor and the camera is between 70° and 80°. The infrared distance measuring sensor measures the distance value every 0.1s. b) Set the distance threshold of the obstacle to 50cm. When the infrared distance of the obstacle is greater than 50cm, If the infrared distance is less than 50cm, it is judged that there is an obstacle. c) Set the distance value x 1 and x 2 Substituting into formula (2), we can get the path offset △ on both sides of the front 1 and 2 : The total path deviation is Δ = Δ 1 +Δ 2 ; Where K is the proportional coefficient, and x is the distance value calculated by infrared ranging, in cm.

5. A method for controlling a home security smart car system according to claim 1, It is characterized in that The smart car automatic navigation system also includes an encoder, a gyroscope, a display screen and a wireless communication module.

6. A method for controlling a home security smart car system according to claim 1, It is characterized in that The method of motor motion control in step 2 has the following specific steps: a) According to the path M, calculate the path deviation value according to formula (3): err=M-X m (3) Where err is the calculated path deviation value, M is the total path obtained in step 1, and Xm is the center coordinate of the camera; b) Substitute the current path deviation value err(k), where k is the current moment, into the improved PID control algorithm formula (4) to calculate the output PID of the PID controller: out (k); In the formula, K p , K i , K d They are the proportional coefficient, integral coefficient, and differential coefficient of the PID algorithm, respectively. z is the suppression coefficient of the z-axis; err(k) is the path deviation value at the kth moment, k = 0, 1, ···, ∞, Gyro(k) can directly obtain the angular velocity of the z-axis through the gyroscope; c) PIDout(k) is superimposed on the output parameters of the left and right motors to change the duty cycle of PWM, thereby achieving the differential speed of the rear wheels and realizing autonomous navigation.

7. A method for controlling a home security smart car system according to claim 1, It is characterized in that The external sensors include but are not limited to temperature and humidity sensors, harmful gas sensors, PM2.5 concentration sensors and photoresistors.

8. A method for controlling a household security smart car system according to claim 7, It is characterized in that The bright lamp adjusts the brightness according to the light intensity obtained by the photoresistor to provide lighting service.