Height detection method, model training method, electronic equipment and program product
Through image technology based on the spatial correction model, conventional camera devices are used to automatically detect human body height, which solves the problem of user burden and high cost of height detection in the existing technology, achieves fast and accurate acquisition of height information, and improves detection efficiency and applicability.
Patent Information
- Application Number
- CN202410783528.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-03
AI Technical Summary
In the existing technology, human body height detection requires manual input by users or relies on complex sensors, which increases user burden and cost. At the same time, it has poor generalization ability and cannot adapt to user needs without pre-set information.
By obtaining the detection image of the detection object, and determining the conversion ratio between the image and the real space based on the spatial correction model, the user's height information can be automatically obtained, and conventional camera devices can be used to replace complex sensors, thereby reducing system cost and complexity.
It achieves fast and accurate height detection, gets rid of the dependence on complex sensors, improves response speed and applicability, and reduces system cost and complexity.
Smart Images

Figure CN118587743A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to a height detection method, a model training method, an electronic device and a program product. Background Art
[0002] Human height is an important indicator of the human body. In practical applications, products can be adjusted based on human height to improve the user's applicable experience. For example, to improve the safety and experience of the vehicle, the safety equipment inside the vehicle and other equipment related to the riding experience can be adaptively adjusted based on the user's relevant parameters.
[0003] However, in the prior art, human height often needs to be preset by the user. Therefore, how to automatically obtain the user's height is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a height detection method and a model training method of a spatial correction model, which can estimate the user's height based on a detection image containing a detection object, thereby automatically obtaining the user's height information to solve the above-mentioned problem.
[0005] In a first aspect, the present application provides a height detection method, wherein the height detection comprises: obtaining at least one detection image containing a detection object. Determining a human body detection frame of the detection object in the detection image. Determining at least one positioning point based on the human body detection frame, wherein the at least one positioning point comprises a bottom edge positioning point on the human body detection frame. Inputting the at least one positioning point into a spatial correction model, determining a conversion ratio between the detection image at the bottom edge positioning point and the real space, wherein the spatial correction model is pre-trained based on the actual distance between at least two visual identifiers in the image sample. Determining height information based on the pixel height of the human body detection frame in the detection image and the conversion ratio.
[0006] In a second aspect, the present application provides a model training method for a spatial correction model, wherein the spatial correction model is used to determine the conversion ratio of an image at a specific position to a real space, and the method further includes: obtaining multiple image samples, wherein the image samples include at least two visual identifiers, and the at least two visual identifiers are longitudinally distributed at the same position based on a preset actual distance. Based on the image samples, multiple key points of the visual identifiers in the image samples are determined, and based on the multiple key points and the actual distances, the image samples and sample labels of the image samples are determined, wherein the sample labels at least include the actual distance between at least two visual identifiers. An initial spatial correction model is trained based on the image samples and their sample labels to determine the spatial correction model.
[0007] In a third aspect, the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the height detection method as described in the first aspect and / or the model training method as described in the second aspect.
[0008] In a fourth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the height detection method as described in the first aspect and / or the model training method as described in the second aspect when the computer program / instruction processor is executed. Optionally, the computer program can be stored in a readable storage medium of a computer device or in the cloud; the processor of the computer device reads the computer program from the readable storage medium or the cloud.
[0009] The present application provides a height detection, model training method, electronic device and program product. The present application can first obtain a detection image containing a detection object, and then determine the conversion ratio of the detection image and the real space based on a preset space correction model, so as to determine the height information of the detection object based on the conversion ratio. Therefore, the height detection method provided by the present application can be directly implemented by relying on a conventional camera device, and the height detection process is freed from the reliance on complex sensors. In addition, when performing height detection, the present application is based on the conversion ratio of the detection image and the real space. The conversion ratio can be quickly determined based on the positioning point of the detection object in the detection image. The calculation speed is fast and the amount of calculation is small, which reduces the cost and complexity of the system and improves the reaction speed when detecting height. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 It is an exemplary flow chart of a height detection method provided by an exemplary embodiment of the present application.
[0012] Figure 2 It is an exemplary flow chart of a method for determining height information provided by an exemplary embodiment of the present application.
[0013] Figure 3 It is an exemplary flow chart of a vehicle-based height detection method provided by an exemplary embodiment of the present application.
[0014] Figure 4It is an exemplary flow chart of a target cockpit adjustment method provided by an exemplary embodiment of the present application.
[0015] Figure 5 It is an exemplary flow chart of a spatial correction model training method provided by an exemplary embodiment of the present application.
[0016] Figure 6 It is a schematic diagram of a spatial correction model training process provided by an exemplary embodiment of the present application.
[0017] Figure 7 This is a system module diagram of a height detection system provided in some embodiments of the present application.
[0018] Figure 8 This is a system module diagram of a model training system provided in some embodiments of the present application.
[0019] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] Application Overview
[0022] In related technologies, height detection is generally implemented in two ways:
[0023] First, it can be manually set by the user. For example, in a vehicle, the driver / passenger can manually input relevant height information in the relevant setting interface, so that the vehicle obtains relevant information and performs adaptive adjustment based on the preset height information when the corresponding driver / passenger is detected.
[0024] Second, the user can be detected outside the vehicle by a specific sensing device to determine the height information of the user, wherein the specific sensing device is generally a camera device with a depth of field acquisition function or a specialized camera device (such as a fisheye camera looking down).
[0025] In practical applications, in the above-mentioned related technologies, there are at least the following technical problems:
[0026] First, for manual settings: users are required to input in advance, which increases the burden on users. Second, for users who have not set information in advance, the vehicle cannot adjust itself adaptively.
[0027] Second, for height detection based on specific sensors: Sensors that can accurately obtain user height information are generally complex in structure, requiring high costs to install and maintain the sensor system, and are easily affected by the in-vehicle environment. For example, height detection based on a fisheye camera looking down requires setting up the fisheye camera at a specific height. In addition, considering the setting issues of specific sensors, their generalization capabilities are generally poor.
[0028] In response to the aforementioned technical problems, the present application discloses a height detection method, a model training method, an electronic device and a program product, which relate to the field of image technology. The present application can first obtain a detection image containing a detection object, and then determine the conversion ratio of the detection image and the real space based on a preset spatial correction model, thereby determining the height information of the detection object based on the conversion ratio. Therefore, the height detection method provided by the present application can be directly implemented by relying on a conventional camera device, and gets rid of the dependence of the height detection process on complex sensors. In addition, when performing height detection, the present application is based on the conversion ratio of the detection image and the real space. The conversion ratio can be quickly determined based on the positioning point of the detection object in the detection image. The calculation speed is fast and the amount of calculation is small, which reduces the cost and complexity of the system and improves the reaction speed when detecting height. The following will refer to the attached Figures 1 to 9 Various non-limiting embodiments of the present application will now be described in detail.
[0029] Exemplary height detection method
[0030] Figure 1 It is an exemplary flow chart of a height detection method provided by an exemplary embodiment of the present application.
[0031] In some embodiments, Figure 1 The method P100 shown in the embodiment can be executed by a computing device including a camera device. For example, the aforementioned P100 can be executed by a vehicle. That is, the detection object in the present application can be a user (driver / passenger) of the vehicle. For another example, the aforementioned P100 can be executed by a mobile terminal, and the detection object is generally a user of the mobile terminal.
[0032] like Figure 1 As shown, P100 may include the following steps:
[0033] S110: Acquire at least one detection image containing a detection object.
[0034] S120: Determine a human body detection frame of the detection object in the detection image.
[0035] S130: Determine at least one positioning point based on the human body detection frame.
[0036] S140, inputting at least one positioning point into the space correction model to determine the conversion ratio between the detection image at the bottom edge positioning point and the real space.
[0037] S150, determining height information based on the pixel height of the human body detection frame in the detection image and the conversion ratio.
[0038] In the present application, the detection object may be the object of height detection in the present application. As mentioned above, the detection object may be a relevant user of the vehicle (such as a driver and a passenger). Further, considering that the detection object is identified based on an external camera device, the aforementioned detection object may specifically refer to a driver or a passenger in the process of entering the vehicle from outside the vehicle.
[0039] The detection image may refer to an image frame containing a detection object. At least one detection image may refer to multiple image frames containing a detection object acquired by a corresponding camera device. Taking into account the actual application scenarios of the present application, at least one detection image may be characterized as multiple continuous image frames arranged in chronological order. Among them, the detection image can be acquired by a corresponding image sensor (such as a camera), generally characterized as a two-dimensional image.
[0040] In some embodiments, the aforementioned S110 may filter out the detection image from each image acquired by the sensor based on the detection object in the image. The method of filtering the detection image may be related to the actual application scenario. For example, when the detection object is a specific object, the detection image containing the detection object may be filtered out from the image based on the preset information of the detection object (such as preset image features).
[0041] The human detection box can be the recognition result of the detection object in the detection image, wherein the human detection box can generally be represented as a quadrilateral selection box in a two-dimensional image (which can be understood as a quadrilateral figure in a two-dimensional image). The quadrilateral selection box is set based on the range of the detection object and is theoretically the minimum selection box that completely contains the detection object.
[0042] In some embodiments, the human body detection frame may be determined based on a target recognition algorithm. For example, the target recognition algorithm may be a CNN, Fast R-CNN, YOLO or other related algorithm that can generate a human body detection frame, and this application does not limit this.
[0043] Further considering that in the actual recognition process, the human body recognition frame is generally configured as a rectangular selection frame, when determining the detection image, the detection image containing the front information of the detection object can be selected as much as possible to avoid the influence of the detection object sideways or other postures on the human body detection frame. For example, an image of a front-facing two-foot standing posture can be preferred as the detection image.
[0044] In the present application, the conversion ratio can reflect the correspondence between the detection image and the real space, that is, the conversion ratio can also be understood as a mapping function from the detection image to the real space. Based on the conversion ratio, the data of a specific object in the detection image (such as pixel height) can be converted into the data of the object in the real space (such as actual height).
[0045] In some embodiments, the conversion ratio may be related to the actual landing point of the detection object (the standing position on the ground). Therefore, before determining the conversion ratio, at least one positioning point may be determined from the human body detection after determining the human body detection frame. Among them, the positioning point can be used to reflect the position of the detection object in the detection image. Considering that the conversion ratio is generally related to the landing point of the detection object on the ground (i.e., the position where the detection object stands on the ground), the aforementioned positioning point may at least include the bottom edge positioning point on the human body detection frame, and the bottom edge positioning point reflects the standing position of the detection object in the detection image.
[0046] In some embodiments, for conventional image sensors, objects at the same landing point are approximately considered to have no nonlinear distortion in height, that is, it can be understood that different objects at the same bottom edge positioning point have the same conversion ratio (which can be recorded as the conversion ratio). That is, when determining the conversion ratio, the positioning points only include the bottom edge positioning points.
[0047] In some embodiments, when the camera device is specially set or is a special camera device (such as a fisheye lens), the object at the same landing point may have nonlinear distortion in height, and the conversion ratio of the detected image at the same bottom edge positioning point may be different. At this time, the positioning point can also include other positioning points to determine the nonlinear distortion. Among them, the positioning point generally also includes at least one positioning point on the other three borders of the human body detection frame (such as the top edge positioning point). The conversion ratio is generally represented as a ratio value, and can also be represented as a parameter form such as an analytical expression, a matrix, a vector, etc. based on the positioning point.
[0048] In some embodiments, the aforementioned conversion ratio can be determined based on a space correction model, that is, the space correction model can at least be used to determine the conversion ratio between the detection image at the bottom edge positioning point and the real space.
[0049] Exemplarily, the height information of the detected object can be the product of the conversion ratio and the bottom fixed point. For example, H=h*r, where H is the height information of the detected object, h is the pixel height of the detected object, and r is the conversion ratio between the image and the real space at the fixed point.
[0050] As an alternative embodiment, the aforementioned S140 and S150 can be executed as a step by the spatial correction model, that is, while the positioning points are input into the spatial correction model, the human body detection frame or its feature information can be synchronously input into the spatial correction model, so that after the spatial correction model determines the conversion ratio based on the bottom edge positioning points, the human body detection frame is directly processed based on the conversion ratio to determine the height information of the detected object.
[0051] In some embodiments, the spatial correction model may be configured as a machine learning model trained based on multiple image samples of an external camera device. In order for the spatial correction model to determine the conversion ratio of each positioning point, the aforementioned image samples may traverse the field of view of the external camera device, so that the spatial correction model can determine the conversion ratio of each position within the field of view of the external camera device.
[0052] In some embodiments, to facilitate training of the spatial correction model, the image samples of the spatial correction model can be determined based on a detection image including at least two visual identifiers. The at least two visual identifiers are longitudinally distributed at the same position based on a preset actual distance, that is, the distance between the visual identifiers is a known value. During training, training data can be constructed based on the actual output of the spatial correction model. For details, see Figure 5 and its related description.
[0053] The height information may be data that at least reflects the actual height of the detected object in real space. In some embodiments, the height information may also include the actual height and other information related to the actual height. For example, the distribution of the skeleton points of the detected object may be determined based on the detected image, and then combined with the actual height, more posture information of the detected object (such as leg length, sitting height, etc.) may be determined, and packaged together with the actual height as the height information.
[0054] In some embodiments, in the aforementioned S150, a multiplication operation can be performed based on the pixel height of the human detection frame in the detection image and the conversion ratio to determine the height of the detection object in the real space.
[0055] In some embodiments, considering that in actual work, the same sensor can obtain multiple detection images of the detection object, each detection image can determine a detection height (i.e., the product of the pixel height in the detection image and the conversion ratio), and when executing the aforementioned S150, the height information can be determined based on each detection height. For example, a statistical operation (such as an average value) can be performed to determine the height information of the detection object.
[0056] Therefore, the height detection method involved in the aforementioned P100 can first obtain a detection image containing the detection object, and then determine the conversion ratio of the detection image and the real space based on a preset space correction model, thereby determining the height information of the detection object based on the conversion ratio. Therefore, the height detection method provided by the present application can be directly implemented by relying on a conventional camera device, and gets rid of the dependence of the height detection process on complex sensors. In addition, when performing height detection, the present application is based on the conversion parameters of the detection image and the real space. The conversion parameters can be quickly determined based on the positioning point of the detection object in the detection image. The calculation speed is fast and the calculation amount is small, which reduces the cost and complexity of the system and improves the reaction speed when detecting height.
[0057] In some embodiments, the aforementioned process P100 is mainly performed based on a specific image sensor, that is, the image sensor corresponds to the spatial correction model, so that the coordinate system of the image sensor is directly mapped to the real space. However, in actual applications, considering the complexity of the application scenario, the sensor that obtains the detection image may not be able to adapt to the current environment, resulting in the aforementioned conversion ratio distortion. In order to improve the adaptability of the present application to such scenarios, the present application also provides a method for integrating height information based on different processing methods ( Figure 2 ).
[0058] like Figure 2 As shown, process P200 may include the following steps:
[0059] S210: Determine the perception confidence of the spatial correction model based on the detection environment.
[0060] S220: In response to the perception confidence being lower than a threshold, determine a first height based on the human body detection frame and internal parameters and external parameters of the detection image.
[0061] S230: Determine a second height based on the pixel height of the human body detection frame in the detection image and the conversion ratio.
[0062] S240: Determine height information based on the first height and the second height.
[0063] In some embodiments, the aforementioned S210 and S220 can be regarded as the triggering conditions of P200, that is, when the perception confidence of the spatial correction model is lower than the threshold, the subsequent steps will be executed. If it is not lower than the threshold, the height information determined by the conversion ratio can be directly used.
[0064] In the aforementioned S210, the perception confidence can reflect the accuracy of the spatial correction model in the current scene. Among them, the accuracy of the perception confidence in the current scene may be related to the sensor that obtains the detection image. For example, when the sensor is a fixed camera device and its position is offset (such as lens angle offset caused by loose fixation), the spatial correction model trained based on its fixed position may not be able to adapt to its offset. For another example, when the aforementioned P100 is applied to a vehicle, the vehicle itself is in a complex area (such as slopes, bulges, potholes, etc.), and the detection image of its external camera device may be quite different from that during training, then it can be determined that its confidence is low.
[0065] In some embodiments, the perception confidence in the aforementioned S210 can be determined based on the difference between the current detection environment and the standard detection environment during the spatial correction model training. For example, the position of the horizon in the detection image can be compared with the position of the horizon in the training sample image during training, and the perception confidence can be determined according to the difference. The greater the difference between the two (such as position difference, inclination difference, etc.), the lower the confidence.
[0066] In some embodiments, when the aforementioned P100 is applied to a vehicle, the aforementioned detection environment can also be determined based on the vehicle body sensor. For example, the posture of the vehicle itself can be determined based on the vehicle body sensor to determine whether the field of view of the external sensor is abnormal. If the vehicle posture is horizontal, it can be determined that the field of view is normal, and the aforementioned confidence can be a value close to 1. If the vehicle posture is not horizontal, it can be determined that the field of view is abnormal, and the aforementioned confidence can be a smaller value.
[0067] In some embodiments, the confidence threshold can be set based on actual conditions, that is, when the confidence is lower than the threshold, it can be determined that the spatial correction model has obvious abnormalities in the current scenario.
[0068] In some embodiments, the process of determining the first height in the aforementioned S220 can be understood as a process of spatial mapping based on internal and external parameters. Among them, internal parameters refer to the internal characteristics and mechanisms of the camera, mainly including focal length, principal point, etc. Among them, the focal length determines the size of the camera's field of view and the size of the object image; the principal point is the projection center point of the image plane, which also affects the image shape and size. External parameters refer to parameters such as the position and posture of the camera relative to the object being photographed during the shooting process, mainly including the position, posture (rotation angle) and viewing direction of the camera.
[0069] When performing spatial mapping, the aforementioned internal and external parameters can be converted into a change matrix, thereby realizing spatial transformation. Specifically, the aforementioned S220 may include the following sub-steps:
[0070] S221. Determine the height of the detection object in the image coordinate system based on the internal parameters of the detection image and the human body detection frame.
[0071] S222: Determine a first height in real space based on external parameters of the detection image and the height of the detection object in the image coordinate system.
[0072] In the aforementioned S221, the image coordinate system of the detected object may refer to a coordinate system centered on the camera, and when performing the conversion, the distortion caused by the camera's own posture may not be considered, thereby mapping the image to the control. The specific method can be referred to in the related art, and will not be described in detail here.
[0073] In the aforementioned S222, the real space may refer to the real space. When mapping based on external parameters, the posture of the camera itself may be used as a parameter for spatial mapping, thereby adapting to the height recognition error caused by the abnormality of the camera itself. The specific method can be referred to in the relevant technology, which will not be described in detail here.
[0074] In some embodiments, based on the aforementioned first height, the first height and the aforementioned second height may be combined to determine the height information. For example, the height information may be determined by weighted processing. That is, the first height and the second height may be weighted to determine the height information, wherein the perception confidence configuration may be the weight of the second height.
[0075] Therefore, the height detection method provided by the present application can also be applied to the case where the detection scene of the detection image is abnormal, which improves the applicability of the height detection method provided by the present application. In addition, the aforementioned method can be triggered based on specific circumstances, ensuring the calculation speed of the present application under normal circumstances.
[0076] Vehicle-based height detection method
[0077] In order to further illustrate the execution of the aforementioned method in actual application scenarios, this application takes a vehicle as an example to illustrate the aforementioned height detection method. Figure 3 It is an exemplary flow chart of a vehicle-based height detection method provided by an exemplary embodiment of the present application.
[0078] like Figure 3 As shown, process P300 may include the following steps:
[0079] S310 , in response to a candidate target appearing within the field of view of an external camera device, acquiring a time-series image sequence including the candidate target.
[0080] S320: Determine at least one detection image of the detection object from the time-series image sequence of the candidate target based on the detection object.
[0081] S330: Determine that the detection object is in a human body detection frame of the detection image.
[0082] S340: Determine at least one positioning point based on the human body detection frame.
[0083] S350, inputting at least one positioning point into the space correction model, and determining the conversion ratio between the detection image at the bottom edge positioning point and the real space.
[0084] S360: Determine height information based on the pixel height of the human body detection frame in the detection image and the conversion ratio.
[0085] Based on the aforementioned P300, it can be known that in the vehicle-based height detection, it is mainly different from the aforementioned P100 in steps S310 and S320. S330 to S360 can refer to the relevant description of S120 to S150 in P100, which will not be repeated here.
[0086] In some embodiments, the aforementioned S610 can be used as a trigger condition for the aforementioned P300, that is, the height detection method in the vehicle may not be a permanent algorithm, and can be specifically triggered based on a specific scenario. Based on the aforementioned S610 description, the aforementioned P300 can generally be triggered when the vehicle is parked. Specifically, when executing P300, a person (recorded as a candidate target) should appear within the field of view of the external camera device, thereby recording a time-series image sequence of the candidate target.
[0087] In some embodiments, the aforementioned S620 may screen the candidate targets based on the requirements of the detection object to determine the detection image. In some embodiments, the detection object may be a candidate target moving toward the vehicle, that is, in the aforementioned S620, the motion trajectory of each candidate target may be determined, and when its motion trajectory is moving toward the vehicle, it is taken as the detection object, thereby calling the corresponding time-series image sequence as the detection image.
[0088] In some embodiments, the aforementioned detection object may be a pre-configured detection object, that is, during height detection, only a specific person is detected. Therefore, the aforementioned S620 may include the following steps:
[0089] S321, determining image features of candidate targets from a time-series image sequence.
[0090] S322: When the image features of the candidate target match the image features of the detection object, determine at least one detection image of the detection object from the time-series image sequence of the candidate target.
[0091] In some embodiments, the aforementioned S321 and S322 can be understood as candidate target screening based on image features, that is, when the image features (such as facial features) of the candidate target match the preset image features, it can be identified as a detection object, thereby calling the corresponding detection image.
[0092] In some embodiments, the aforementioned S620 may also be determined based on other authentication methods. For example, the detection object may be determined based on a short-range communication protocol (such as Bluetooth, NFC, WIFI, etc.).
[0093] In some embodiments, the aforementioned process of determining the detection object can also be performed after determining the height information of the candidate target, that is, the aforementioned P300 can temporarily ignore the identification of the detection object and directly determine the height information of the candidate target. When the door is opened, the object corresponding to the interactive behavior of opening the door is determined as the detection object, thereby calling the height information of the detection object. This process can be combined with subsequent cockpit adjustment. For details, please refer to Figure 4 and its related description.
[0094] In some embodiments, considering that the aforementioned detection image may be a partial image in a time series image, in order to improve the detection accuracy of the actual height, multiple detection images may be collected for the same detection object, and the actual height may be determined multiple times to determine the height information.
[0095] Therefore, the aforementioned S360 may further include the following steps:
[0096] S361, determining the detected height based on the pixel height of the human body detection frame in the detection image and the conversion ratio, so as to determine at least one detected height of the detection object in at least one detection image, wherein the detection image corresponds to the detected height one by one.
[0097] S362: Determine height information based on at least one detected height.
[0098] Specifically, in the aforementioned S230, considering that the zoom ratio is different when the distance between the human body and the camera is different, in order to improve the accuracy and precision of the detection results, the detection results of multiple detection images of the detection object (target person) at different positions can be obtained, that is, the height information obtained under different zoom ratios is obtained, and finally the obtained heights of the multiple objects (that is, the actual heights) are statistically processed to determine a more accurate actual height, and encapsulated as height information to reduce errors.
[0099] In some embodiments, each detection image determines the detected height and can also be adjusted according to the occlusion of the detection object in the detection image. For example, when the detection object is close to the vehicle, part of its body may be blocked by the vehicle or exceed the field of view of the detection device outside the vehicle, but when the detection object is close to the vehicle, the terrain where the detection object and the vehicle are located is close, and its confidence is high. Then the height of the detection object can be directly corrected based on the length of the part of the body of the detection object in this type of detection image, so as to determine the height information. Exemplarily, when the detection object is close to the vehicle, its lower limbs may be blocked by the vehicle, then the length of its upper limbs can be calculated. Thus, the height can be corrected based on the length of its upper limbs and body proportions to determine the corrected height as the height information.
[0100] In addition, considering the impact of complex situations on the model, the aforementioned method for determining height can also be used as a method for determining the second height in the aforementioned P200, thereby improving the accuracy of height recognition in complex scenarios.
[0101] In some embodiments, after determining the height information, the vehicle may perform adaptive adjustment based on the height information, that is, the P300 may further include the following steps:
[0102] S370: Adjust the target cabin based on the height information of the detected object.
[0103] The target cockpit may refer to the cockpit in which the detection object sits in the vehicle, that is, the detection object sits in the target cockpit. For example, if the detection object is a driver, the target cockpit may be the driver's cockpit. For another example, if the detection object is a passenger, the target cockpit may be the cockpit in which the detection object actually sits, such as the co-pilot cockpit, the left rear cockpit, and the right rear cockpit.
[0104] The aforementioned adjustment of the target cabin includes but is not limited to the adjustment of the seat position, the adjustment of the airbag position, the adjustment of the display screen position, etc. For example, the seat position can be adjusted based on the height of the detected object, that is, the seat position can be automatically adjusted without the need for manual setting by the passenger, thereby providing a good riding experience for the passenger.
[0105] It should be noted that the aforementioned cockpit may refer to a collection of seats in each vehicle and their related equipment. For example, the driver's cockpit may include a driver's seat and related equipment such as a seat belt, airbag, door, and display screen at the driver's seat.
[0106] In some embodiments, the aforementioned target cockpit may be determined based on riding habits, that is, the identity information of the detection object may be determined first, and then the target cockpit may be determined based on the historical riding habits of the identity information.
[0107] In some embodiments, the aforementioned target cockpit may also be determined based on the actual door opening behavior, that is, the correspondence between the detection target and the cockpit may be determined based on the door opening action, thereby executing S370 to achieve adaptive adjustment of the device.
[0108] To further illustrate the process of determining the target cabin by door opening behavior, Figure 4 It is an exemplary flow chart of a method for determining a target cockpit provided by an exemplary embodiment of the present application.
[0109] like Figure 4 As shown, P400 may include the following steps:
[0110] S410: In response to a door opening action of the vehicle, determine a door monitoring image of each door during the door opening action.
[0111] S420: Determine image features of a candidate object entering the vehicle through a corresponding door based on the door monitoring image.
[0112] S430: Determine a target cabin of the detection object based on the image features of the detection object and the image features of the candidate objects.
[0113] S440: Adjust the target cockpit based on the height information of the detected object.
[0114] The door opening action may refer to an interactive behavior of opening a cabin door. The interactive behavior may be triggered by an external user. For example, the door opening action may be an external user opening a door based on a door handle. The interactive behavior may also be triggered by an internal user or automatically. For example, the driver of the vehicle may open the door in advance.
[0115] The door monitoring image may refer to the monitoring image of the door that triggers the door opening action. Among them, the external camera device is often arranged around the vehicle, and the door monitoring image can be obtained by the camera device on the side of the external camera device and whose field of view includes the outside of the door. For example, it can be determined by a camera at the rearview mirror or an electronic rearview mirror.
[0116] In some embodiments, after determining the door monitoring image, the object in the door monitoring image can be identified to determine the image features of the candidate object in the door monitoring image. Then, the image features of the candidate object are compared with the image features of the aforementioned detection object to determine the detection object entering the vehicle through the door, so as to determine the target cabin of the detection object. Generally, there is a one-to-one correspondence between the door and the cabin, and the detection object can determine the cabin it is sitting in based on the door it opens / enters according to the corresponding relationship, as the target cabin.
[0117] Exemplary Spatial Correction Model Training Process
[0118] To illustrate the training process of the spatial correction model, a flowchart of the spatial correction model training process provided by an exemplary embodiment of the present application is shown in FIG. Figure 5 ) and schematic diagram ( Figure 6 ).
[0119] like Figure 5 As shown, the training process P500 may include the following steps:
[0120] S510, obtaining a plurality of image samples, wherein the image samples include at least two visual identifiers, and the at least two visual identifiers are longitudinally distributed at the same position based on a preset actual distance;
[0121] S520, determining multiple key points of the visual identifier in the image sample based on the image sample, and determining an image sample and a sample label of the image sample based on the multiple key points and the actual distances, wherein the sample label at least includes the actual distance between at least two visual identifiers;
[0122] S530: Train an initial spatial correction model based on the image samples and their sample labels to determine a spatial correction model.
[0123] The spatial correction model trained in the aforementioned P500 can be used to determine the conversion ratio of an image at a specific location to the real space. Considering its practical application, the same type of sensors at the same location can be configured with the same spatial correction model. For example, if the location of the external camera devices in the same / similar vehicles is the same, they can be trained based on a universal spatial correction model.
[0124] In some embodiments, the aforementioned spatial correction model can be executed based on the training process of a conventional machine learning model. Specifically, samples can be first input into the model to determine the model output, and then the model parameters are updated through a loss function based on the model output and sample labels until the training is completed.
[0125] To further illustrate the configuration process of the aforementioned image samples, Figure 6 Explain the above training process:
[0126] like Figure 6 As shown, the spatial correction model 610 can be obtained by training based on the initial spatial correction model 620 without setting parameters. That is, the initial spatial correction model 620 can be trained based on multiple sets of training data 630 until the training conditions of the initial spatial correction model 620 are completed (such as convergence, the number of training times reaches a threshold, etc.), and the trained initial spatial correction model 620 is used as the spatial correction model 610. Each set of training data 630 can include training samples 631 and sample labels 632.
[0127] In some embodiments, the determination process of the training samples 631 and the sample labels 632 may correspond to the actual input and output of the spatial correction model 610. Figure 6 As shown, when the trained spatial correction model 610 can be used to determine the conversion ratio 642 at the bottom edge positioning point based on the bottom edge positioning point 641 in the detection image, the training sample 631 can be the pixel coordinates of a specific key point in the corresponding sample image, and the sample label 632 can be the actual conversion ratio at the specific key point.
[0128] As mentioned above, the training data 630 may be determined based on image samples including at least two visual identifiers, that is, when determining the training data 630, a plurality of image samples may be first acquired through an external camera device, and then a plurality of key points of the visual identifier in the image sample may be determined based on the image sample, and the image sample and the sample label of the image sample may be determined based on the plurality of key points and the actual distance.
[0129] In some embodiments, the visual identifier is often configured as a rectangular image containing specific information. For example, the aforementioned visual identifier may be an April tag code, and the aforementioned key point may be a specific point with scale significance in the image sample. For example, the aforementioned key point may include an edge point of the visual identifier and / or other positions (such as the bottom midpoint) determined based on the edge point.
[0130] To further illustrate the process of determining training data 630 based on image samples, Figure 6 The schematic diagram also includes an image sample 651 and a real space 652 corresponding to the image sample. The training sample 631 can be determined based on the image sample 651, and the sample label 632 can be determined based on the real space 652.
[0131] like Figure 6 As shown, when acquiring the image sample 651, at least two visual identifiers in the real space 652 can be photographed by an external camera device to determine the image sample 651. That is, the image sample 651 includes visual identifiers corresponding to the real space 652, and the pixel distance between the visual identifiers satisfies a specific conversion ratio.
[0132] Specifically, in the image sample 651, the visual identifiers may be distributed longitudinally at the same position and the number is at least two. There are two visual identifiers in the image sample 651, and the number requirement of the visual identifiers is mainly used to avoid abnormal change parameters caused by distortion of a single identification identifier.
[0133] As mentioned above, the distance between the two visual identifiers can be a known value, that is, the distance between the two visual identifiers in the real space 652 has been determined before training and can be recorded as H1. During training, the pixel distance h1 between the two visual identifiers in the image sample 651 is determined, and the actual conversion ratio R=h1 / H1 in the sample label 632 can be determined.
[0134] In some embodiments, the aforementioned pixel distance and training sample 631 can be determined based on the key points of the visual identifier. Considering that the visual identifier is often configured as a rectangular representation, the edge points of the visual identifier can be determined from the image sample by an edge recognition algorithm and the pixel position of the edge point in the image sample can be determined. The pixel distance of at least two visual identifiers in the image sample is determined based on the edge points. The image sample and the sample label of the image sample are determined based on multiple key points, pixel distances and actual distances. Among them, the sample label includes at least an actual conversion ratio determined based on the pixel distance and the actual distance.
[0135] The aforementioned edge points may refer to the four corners of the rectangular visual identifier in the image sample 651. For each edge point in the image sample, the position of the edge point in the image sample 651 may be reflected by the pixel coordinates. Specifically, the edge points of the upper visual identifier near the upper part of the image may be respectively recorded as: t 1 =(tx 1 ,ty 1 ), t 2 =(tx 2 ,ty 2 ), t3=(tx 3 ,ty 3 ), t4=(tx 4 ,ty 4 ). The edge points of the lower visual representation identifier near the bottom of the image can be recorded as: b 1 =(bx 1 , by 1 ), b 2 =(bx 2 , by 2 ), b3=(bx 3 , by 3 ), b4=(bx 4 , by 4 ). In real space, there are actual points corresponding to each edge point, specifically T 1 、T 2 、T 3 、T 4 , B 1 , B 2 , B 3 and B 4 Each actual point corresponds to an edge point one by one, see Figure 6 .
[0136] The aforementioned pixel distance can be determined based on the pixel position of each key point. When the spacing of the visual identifiers is the distance between the key points at the same position in the two visual identifiers, the aforementioned pixel distance can be the distance between the corresponding key points. For example, the pixel distance h 1 It can be t 1 With b 1 The distance between 2 With b 2 The distance between the key points can reflect the corresponding positions, and can also be the average value of the distance.
[0137] In some embodiments, corresponding to the aforementioned bottom edge positioning point 641, when determining the image sample 651, the image sample 651 can also be constructed based on the bottom edge midpoint. Among them, the bottom edge midpoint and its pixel position in the image sample can be first determined based on the two bottom edge points in the key points to serve as the image sample. The bottom edge point can refer to the two edge points of the lower edge of the visual identifier below. That is, the bottom edge point can be the key points b3 and b4.
[0138] In some embodiments, the aforementioned bottom edge midpoint can be directly determined based on the pixel coordinates of the aforementioned bottom edge point. That is, the horizontal coordinate of the aforementioned bottom edge midpoint can be (bx 3 +bx 4 ) / 2, the vertical axis is (by 3 +by 4 ) / 2.
[0139] In some embodiments, considering that the visual identifier often needs a carrier, it is difficult for it to directly contact the ground. When determining the aforementioned bottom edge midpoint, the training sample 631 can be corrected based on the distance from the lower edge of the lower visual identifier to the ground. That is, the corrected distance from the lower edge of the lower visual identifier in the key point to the ground can be determined. Then, the bottom edge midpoint and its pixel position in the image sample are determined based on the corrected distance and the two bottom inflection points.
[0140] Specifically, the corrected distance from the lower edge of the visual identifier to the ground can be recorded as H2. When making corrections, the pixel distance h2 of the corrected distance in the image sample can be determined based on the actual conversion ratio R, and the pixel coordinates of the midpoint of the bottom edge can be adjusted based on the pixel distance. For example, the ordinate of the pixel coordinates of the midpoint of the bottom edge can be ((by 3 +by 4 ) / 2)-h 2 . Its horizontal axis generally does not need to be corrected.
[0141] The above process shows how to construct a set of training data 630 based on image samples 651. In actual training, multiple sets of training data 630 can be constructed based on different image samples 651. Specifically, the actual conversion ratio at each position within the field of view can be determined by adjusting the landing point position of the visual identifier and the spacing between the visual identifiers, thereby training the spatial correction model.
[0142] From the actual training results, in the spatial correction model, under the same ordinate, the relationship between the horizontal coordinate of the bottom edge positioning point and the conversion ratio is approximately linear. Under the same ordinate, the relationship between the ordinate of the bottom edge positioning point and the conversion ratio is nonlinear, specifically approximately a quadratic function relationship.
[0143] Therefore, the input and output of the spatial correction model are relatively simple, its response speed is fast, and the relevant conversion ratio (such as conversion ratio) can be determined quickly.
[0144] Exemplary systems and electronic devices
[0145] Combination of the above Figures 1 to 6 , describes the method embodiment of the present application in detail, and the device embodiment of the present application is described in detail below. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the part not described in detail can refer to the previous method embodiment.
[0146] The present application also provides a height detection system, including a module for implementing the height detection method provided in the present application. Figure 7 As shown, Figure 7 is a system module diagram of a height detection system provided by an exemplary embodiment of the present application. The vehicle-based height detection system 700 may include an image acquisition module 710 , a target recognition module 720 , an image positioning module 730 , a ratio determination module 740 , and a height determination module 750 .
[0147] The image acquisition module 710 may be used to acquire at least one detection image containing a detection object.
[0148] The target recognition module 720 may be used to determine a human body detection frame of a detection object in a detection image.
[0149] The image positioning module 730 may be configured to determine at least one positioning point based on the human body detection frame, wherein the at least one positioning point includes a bottom edge positioning point on the human body detection frame.
[0150] The ratio determination module 740 can be used to input at least one positioning point into the space correction model to determine the conversion ratio of the detection image at the bottom edge positioning point and the real space, wherein the space correction model is pre-trained based on the actual distance between at least two visual identifiers in the image sample.
[0151] The height determination module 750 can be used to determine the height information based on the pixel height and conversion ratio of the human body detection frame in the detection image.
[0152] The present application also provides a model training system, including a module for implementing the training space correction model provided by the present application. Figure 8 As shown, Figure 8 800 is a system module diagram of a model training system provided by an exemplary embodiment of the present application. The vehicle-based model training system 800 may include a sample acquisition module 810 , a sample calibration module 820 , and a model training module 830 .
[0153] The sample acquisition module 810 may be used to acquire a plurality of image samples, wherein the image samples include at least two visual identifiers, and the at least two visual identifiers are longitudinally distributed at the same position based on a preset actual distance.
[0154] The sample calibration module 820 can be used to determine multiple key points of the visual identifier in the image sample based on the image sample, and determine the image sample and the sample label of the image sample based on the multiple key points and the actual distance, wherein the sample label at least includes the actual distance between at least two visual identifiers.
[0155] The model training module 830 may be used to train an initial spatial correction model based on image samples and their sample labels to determine a spatial correction model.
[0156] The present application also provides an electronic device, such as Fig. 9 The electronic device 900 provided in the present application includes a memory 910, a processor 920, and an input / output interface 930. The memory 910, the processor 920, and the input / output interface 930 are connected through an internal connection path, the memory 910 is used to store instructions, and the processor 920 is used to execute the instructions stored in the memory 930 to control the input / output interface 930 to receive input data and information, and output data such as operation results.
[0157] It should be understood that in the embodiment of the present application, the processor 920 can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs to implement the technical solution provided in the embodiment of the present application.
[0158] The memory 910 may include a read-only memory and a random access memory, and provides instructions and data to the processor 920. A portion of the processor 920 may also include a nonvolatile random access memory. For example, the processor 920 may also store information on the device type.
[0159] During the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 920 or an instruction in the form of software. The vehicle-mounted air conditioning control or vehicle-mounted air conditioning control method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in the processor for execution. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 910, and the processor 920 reads the information in the memory 910 and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here. The present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction processor in the computer program product provided by the present application is executed, the height detection method and model training method provided by the present application can be implemented.
[0160] Based on the same technical concept, the present application also provides a computer program product, which includes a computer program / instruction. When the computer program / instruction processor is executed, the height detection method and model training method as described in any of the above embodiments are implemented.
[0161] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK).
[0162] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.
[0163] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0164] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0165] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0166] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A height detection method, characterized in that: The height detection includes: Acquire at least one detection image containing a detection object; Determine a human body detection frame of the detection object in the detection image; Determine at least one positioning point based on the human body detection frame, wherein the at least one positioning point includes a bottom edge positioning point on the human body detection frame; Inputting the at least one positioning point into a spatial correction model to determine a conversion ratio between the detection image at the bottom edge positioning point and the real space, wherein the spatial correction model is pre-trained based on an actual distance between at least two visual identifiers in an image sample; The height information is determined based on the pixel height of the human body detection frame in the detection image and the conversion ratio.
2. The height detection method according to claim 1, characterized in that: The method further comprises: determining a perceptual confidence of the spatial correction model based on a detection environment; In response to the perception confidence being lower than a threshold, determining a first height based on the human body detection frame and internal parameters and external parameters of the detection image; The determining of the height information based on the pixel height of the human body detection frame in the detection image and the conversion ratio includes: Determine a second height based on the pixel height of the human body detection frame in the detection image and the conversion ratio; The height information is determined based on the first height and the second height.
3. The height detection method according to claim 2, characterized in that: The determining the height information based on the first height and the second height includes: The first height and the second height are weighted to determine the height information, wherein the perception confidence is configured as the weight of the second height.
4. The height detection method according to claim 2, characterized in that: The determining the first height based on the internal parameters and external parameters of the human body detection frame and the detection image includes: Determine the height of the detection object in the image coordinate system based on the internal parameters of the detection image and the human body detection frame; A first height in real space is determined based on the external parameters of the detection image and the height of the detection object in the image coordinate system.
5. The height detection method according to claim 1, characterized in that: The determining of the height information based on the pixel height of the human body detection frame in the detection image and the conversion ratio includes: Determine the detected height based on the pixel height of the human body detection frame in the detection image and the conversion ratio, so as to determine at least one detected height of the detection object in the at least one detection image, wherein the detection image corresponds to the detected height in a one-to-one manner; The height information is determined based on the at least one detected height.
6. The height detection method according to any one of claims 1 to 5, characterized in that: The method is applied to a vehicle, and acquiring at least one detection image containing a detection object comprises: In response to a candidate target appearing within the field of view of the external camera device, acquiring a time-series image sequence including the candidate target; At least one detection image of the detection object is determined from the time-series image sequence of the candidate target based on the detection object.
7. The height detection method according to claim 6, characterized in that: The step of determining at least one detection image of the detection object from the time-series image sequence of the candidate target based on the detection object comprises: Determining image features of the candidate target from the time-series image sequence; When the image features of the candidate target match the image features of the detection object, at least one detection image of the detection object is determined from the time-series image sequence of the candidate target.
8. The height detection method according to any one of claims 1 to 5, characterized in that: The method is applied to a vehicle, and the method further comprises: In response to a door opening action of the vehicle, determining a door monitoring image of each door during the door opening action; determining image features of a candidate object entering the vehicle through a corresponding door based on the door monitoring image; Determine a target cabin of the detection object based on the image features of the detection object and the image features of the candidate objects; The target cabin is adjusted based on the height information of the detected object.
9. A model training method for a spatial correction model, characterized in that: The spatial correction model is used to determine the conversion ratio of the image at a specific position to the real space, and the method further includes: Acquire a plurality of image samples, wherein the image samples include at least two visual identifiers, and the at least two visual identifiers are longitudinally distributed at the same position based on a preset actual distance; Determine a plurality of key points of the visual identifier in the image sample based on the image sample, and determine an image sample and a sample label of the image sample based on the plurality of key points and the actual distance, wherein the sample label includes at least the actual distance between the at least two visual identifiers; An initial spatial correction model is trained based on the image samples and their sample labels to determine the spatial correction model.
10. The model training method according to claim 9, characterized in that: The method of determining a plurality of key points of the visual identifier in the image sample based on the image sample, and determining an image sample and a sample label of the image sample based on the plurality of key points and the actual distance comprises: Determine edge points of the visual identifier from the image sample by an edge recognition algorithm and determine pixel positions of the edge points in the image sample; Determining a pixel distance between the at least two visual identifiers in the image sample based on the edge point; The image sample and a sample label of the image sample are determined based on the multiple key points, the pixel distance, and the actual distance, wherein the sample label at least includes an actual conversion ratio determined based on the pixel distance and the actual distance.
11. The model training method according to claim 10, characterized in that: The determining the image sample and the sample label of the image sample based on the multiple key points, the pixel distance and the actual distance includes: Determine a bottom edge midpoint and its pixel position in the image sample based on two bottom edge points in the key points to serve as the image sample; Determining a corrected distance from a lower edge of a visual identifier below the key point to the ground; An actual conversion ratio at the midpoint of the bottom edge is determined based on the corrected distance adjustment, the multiple key points, the pixel distance, and the actual distance to serve as the sample label.
12. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the height detection method described in any one of claims 1-8 and / or the model training method described in any one of claims 9-11.
13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction processor is executed, the height detection method as described in any one of claims 1-8 and / or the model training method as described in any one of claims 9-11 are implemented.
