Object type identification method, device and equipment
By calculating the rectangular width and length ratio of the object to be measured and the matching degree with the target type template, and performing secondary classification with the target feature information, the problems of insufficient accuracy of object type recognition and high leakage detection rate in the prior art are solved, and higher recognition accuracy and lower leakage detection rate are achieved.
Patent Information
- Application Number
- CN202411987143.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
The existing method of object type recognition needs to be improved in terms of accuracy, resulting in a high leakage detection rate.
By obtaining the outline image of the object to be measured, the rectangle width and length ratio is calculated, and based on the matching degree of the ratio to the preset range, the matching degree of the object to be measured and the target type template is determined. At the same time, the target feature information is used for secondary classification to improve the accuracy of the detection results.
It effectively reduces the leakage detection rate, improves the accuracy of object type recognition, and realizes accurate identification of objects to be measured through multi-level classification methods.
Smart Images

Figure CN120014289A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method, device and equipment for identifying the type of an object. Background Art
[0002] With the development of 3D laser scanning technology, 3D laser imaging systems have been widely used. 3D laser imaging system is an advanced long-distance measurement technology that can quickly and accurately obtain the spatial coordinate information of an object, and can store the collected data in a computer, and then quickly reconstruct the 3D model of the object for analysis and processing. The data information collected by the laser scanner is a point cloud composed of the 3D information and reflectivity of discrete data points. Each data point in the point cloud contains the distance value, angle value, reflectivity, etc. of the scanning point. This technology can be used to achieve the complete collection of various large, complex, and irregular entity 3D data, and then quickly obtain various geometric data such as entity target points, lines, surfaces, and bodies for a variety of post-processing tasks.
[0003] The three-dimensional laser imaging technology can be used to identify the type of objects, such as pedestrians. However, the accuracy of the existing object type recognition methods needs to be improved. Summary of the invention
[0004] In view of this, embodiments of the present application provide a method, apparatus, and device for identifying the type of an object, so as to reduce the missed detection rate during the object identification process.
[0005] In a first aspect, an embodiment of the present application provides a method for identifying a type of an object, comprising:
[0006] Acquire a contour image of the object to be measured;
[0007] According to the contour image of the object to be measured, obtaining the width-to-length ratio of the rectangle corresponding to the contour image;
[0008] Based on the fact that the width-to-length ratio of the rectangle is outside a first preset range, determining the degree of matching between the object to be tested and the target type template, and determining whether the object to be tested is the target type based on the degree of matching between the object to be tested and the target type template; wherein the first preset range is the width-to-length ratio range corresponding to the target type;
[0009] Based on the width-to-length ratio of the rectangle being within the first preset range, the degree of match between the object to be tested and the target feature information is determined, and based on the degree of match between the object to be tested and the target feature information, it is determined whether the object to be tested is the target type; wherein the target feature information is feature information of the target type.
[0010] In a possible implementation manner of the first aspect, before the step of determining the degree of match between the object to be detected and the target type template based on the aspect ratio of the rectangle being outside the first preset range, and determining whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target type template, the step includes:
[0011] The target type is determined.
[0012] In a possible implementation manner of the first aspect, acquiring a contour image of the object to be measured includes:
[0013] Acquire a first image, wherein the first image includes the image of the object to be measured;
[0014] Based on the first image, a contour image of the object to be measured is obtained.
[0015] In a possible implementation manner of the first aspect, obtaining a contour image of the object to be measured based on the first image includes:
[0016] Preprocessing the first image;
[0017] Based on a binary segmentation algorithm, the preprocessed first image is segmented to obtain a contour image of the object to be measured.
[0018] In a possible implementation manner of the first aspect, the step of determining a degree of match between the object to be detected and a target type template, and determining whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target type template includes:
[0019] Based on the first image, obtaining a DT image of the object to be measured;
[0020] Based on the DT image of the object to be tested and the feature points of the target type template, obtaining an average chamfer distance between each target pixel point in the DT image of the object to be tested and the pixel point corresponding to the feature point;
[0021] When the minimum distance among all the average chamfer distances is greater than or equal to the first threshold, the object to be measured is the target type.
[0022] In a possible implementation manner of the first aspect, the target type is a person; and the target feature information includes a head contour feature.
[0023] In a possible implementation manner of the first aspect, the step of determining a degree of match between the object to be detected and the target feature information, and determining whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target feature information includes:
[0024] Based on the contour map of the object to be measured, obtaining a local contour map corresponding to the target feature information;
[0025] Based on the local contour map, an actual feature value corresponding to the target feature information is obtained;
[0026] When the actual characteristic value is within the second preset range, the object to be detected is the target type.
[0027] In a second aspect, an embodiment of the present application provides an object type recognition device, comprising: an acquisition unit and a processing unit. The acquisition unit is used to acquire a contour image of the object to be detected; the processing unit is used to obtain the rectangular width-to-length ratio corresponding to the contour image according to the contour image of the object to be detected; the processing unit is also used to determine the matching degree between the object to be detected and the target type template based on the rectangular width-to-length ratio being outside a first preset range, and to determine whether the object to be detected is the target type based on the matching degree between the object to be detected and the target type template; wherein the first preset range is the width-to-length ratio range corresponding to the target type; the processing unit is also used to determine the matching degree between the object to be detected and the target feature information based on the rectangular width-to-length ratio being within the first preset range, and to determine whether the object to be detected is the target type based on the matching degree between the object to be detected and the target feature information; wherein the target feature information is feature information of the target type.
[0028] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device executes the method provided in the first aspect.
[0029] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method provided in the first aspect.
[0030] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes the method provided in the first aspect.
[0031] In a sixth aspect, an embodiment of the present application further provides a vehicle, wherein the vehicle includes the device for identifying the type of an object provided in the second aspect, or includes the electronic device provided in the third aspect.
[0032] In the embodiment of the present application, the rectangular width-to-length ratio corresponding to the object to be tested is firstly used for preliminary screening. When the rectangular width-to-length ratio is within the first preset range, the degree of matching between the object to be tested and the target feature information is used to determine whether the object to be tested is of the target type, thereby improving the accuracy of the detection result; when the rectangular width-to-length ratio is outside the first preset range, the degree of matching between the object to be tested and the target type template is used to determine whether the object to be tested is of the target type, thereby achieving re-detection of the object to be tested, thereby reducing the missed detection rate. Therefore, the embodiment of the present application implements two-level classification, firstly performing preliminary classification by the aspect ratio, and then performing secondary classification by the target feature information. This multi-level classification method can effectively reduce the missed detection rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A schematic diagram of a method for identifying the type of an object provided in an embodiment of the present application;
[0035] Figure 2 A flowchart of a method for identifying the type of an object provided in an embodiment of the present application;
[0036] Figure 3 A contour diagram of an object to be measured provided in an embodiment of the present application;
[0037] Figure 4 A local contour map of an object to be measured provided in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of a device for identifying the type of an object provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0040] Description of symbols
[0041] 100. Object type recognition device; 101. Acquisition unit; 102. Processing unit; 200. Electronic device; 201. Processor; 202. Memory; 203. Communication unit. DETAILED DESCRIPTION
[0042] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0043] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0044] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0045] It should be understood that the term "and / or" used in this article is only a description of the association relationship of 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.
[0046] The inventors have found that in the existing object type recognition methods, most of them use single-line laser radar for recognition. Since the single-line laser radar can only obtain a cross-section of the object, it is impossible to obtain more complete three-dimensional information, which leads to a high missed detection rate in the object type recognition method. Among them, the recognition of object type refers to the ability to identify the type of the object to be detected. The types of objects include: people, plants, buildings, vehicles, roads, driving signs, traffic lights, etc. Missed detection means that the type of the object to be detected is actually the target type, but the recognition result of the detection system is no.
[0047] like Figure 1 and Figure 2 As shown, the embodiment of the present application provides a method for identifying the type of an object, including:
[0048] S100, obtaining a contour image of the object to be measured.
[0049] Contour image Figure 3 As shown in Figure 2. The contour image includes the contour edge and all the pixels inside the contour edge. The structure of the contour image belongs to a surface structure enclosed by the contour edge.
[0050] In the specific implementation process of step S100, the image of the object to be tested can be extracted from the image including the object to be tested and its surrounding objects, so as to obtain the contour image of the object to be tested. The contour image of the object to be tested can facilitate the width-to-length ratio test of the circumscribed rectangle in the subsequent steps, thus laying a good foundation for the subsequent steps.
[0051] In a possible implementation, obtaining a contour image of the object to be measured includes:
[0052] S110, acquiring a first image, where the first image includes an image of an object to be measured.
[0053] In step S110, a laser radar may be used for image acquisition. In one possible implementation, the first image is directly generated by the laser radar. In another possible implementation, the laser radar generates point cloud data, which can generate a three-dimensional model after image processing, and the three-dimensional model can be converted into a two-dimensional first image after conversion. In step S110, the first image is a complete image detected, including the object to be measured and other objects located around the object to be measured. The laser radar is a multi-line laser radar, for example, a 128-line laser radar.
[0054] S120: Obtain a contour image of the object to be measured based on the first image.
[0055] In step S120, the contour image of the object to be detected can be extracted from the first image using an image processing algorithm, wherein the image processing algorithm includes an image segmentation algorithm, such as a threshold segmentation algorithm and an edge detection algorithm.
[0056] In a possible implementation manner, obtaining a contour image of the object to be measured based on the first image includes:
[0057] S121, preprocessing the first image.
[0058] The preprocessing of the first image includes: performing enhancement processing, noise filtering and edge detection processing on the first image. The preprocessing of the first image can facilitate the implementation of the segmentation algorithm in the subsequent steps, thereby facilitating the acquisition of a contour image with higher accuracy.
[0059] S122, based on a binary segmentation algorithm, segment the preprocessed first image to obtain a contour image of the object to be measured.
[0060] For ease of description, the image obtained after the first image is preprocessed is named the first intermediate image. In the specific implementation of step S122, after the first image is preprocessed, a selection threshold is determined based on the needs of the actual application scenario, and the first intermediate image is segmented using a binary segmentation algorithm based on the selection threshold to segment the object to be measured from the first image, thereby obtaining a contour map of the object to be measured.
[0061] S200, obtaining a width-to-length ratio of a rectangle corresponding to the contour image according to the contour image of the object to be measured.
[0062] In step S200, the rectangle corresponding to the contour image refers to the circumscribed rectangle of the contour image. It can be understood that the contour image is surrounded by the circumscribed rectangle, and the topmost boundary point, the bottommost boundary point, the leftmost boundary point and the rightmost boundary point of the contour image are located on the four sides of the circumscribed rectangle in a one-to-one correspondence. The rectangle aspect ratio refers to the ratio of the width to the length of the circumscribed rectangle.
[0063] In this step, the aspect ratio W / H can be calculated according to the height H (the number of pixels in the vertical direction) and the width W (the number of pixels in the horizontal direction) of the circumscribed rectangle of the target outline.
[0064] In a possible implementation of the present invention, the object type recognition method further includes: determining the target type. This step is performed before step S300 / S400. For example, this step can be performed after step S200 and before step S300 / S400; this step can also be performed before step S100.
[0065] In a possible implementation, the target type may be determined in a specified manner. For example, in the process of identifying whether the object to be detected is a person or a pedestrian, the target type may be specified as a person or a pedestrian, thereby determining the target type.
[0066] In a possible implementation, a round-robin method can be used, that is, in a first detection cycle, whether the object to be detected is a first target type, and in a next detection cycle, whether the object to be detected is a second target type, ..., until the type of the object to be detected is identified or all target types are detected.
[0067] In a possible implementation, the target type can also be determined by comparing the target image with the target types in the target type library. For example, the object to be tested is first determined by box recognition, and the object to be tested is matched one by one with each target type in the target type library, and the target type with the highest matching degree is the target type.
[0068] After determining the target type, a target type template corresponding to the target type can be obtained. In a possible implementation, a target type model corresponding to the target type can be obtained based on the features and sample set corresponding to the target type and then through learning and classification. For example, the target type is a person, and the target type model is a posture model. In a possible implementation, the posture model acquisition process can be:
[0069] The human body features and low-frequency postures of pedestrian profiles are collected, defined, and classified to establish a posture template. Human body features include the roundness of the head and the width-to-length ratio of the rectangle corresponding to the profile.
[0070] In a possible implementation, the target type is a person or an animal, and the target feature information includes a head contour feature.
[0071] The target type is a person or an animal. During the recognition process of a person or an animal, its head is most likely not blocked. Therefore, detection can be performed using the head contour features to improve the accuracy of the detection results.
[0072] In a possible implementation, the target type is a person, and the head contour features include roundness. In this implementation, the roundness of the head is used as a second-level classification feature, which helps to avoid system misidentification and improve the pedestrian recognition rate; using the roundness of the human head as a recognition feature is an innovative recognition indicator because the head shape is relatively fixed and is not easily affected by posture changes.
[0073] Among them, the circularity e satisfies:
[0074]
[0075] In formula (1), * represents a multiplication sign, S represents the head area of the object to be measured corresponding to the head outline image, and L represents the head circumference of the object to be measured corresponding to the head outline image.
[0076] After obtaining the rectangular width-to-length ratio corresponding to the contour image, determine whether the rectangular width-to-length ratio is within the first preset range by data comparison. If the rectangular width-to-length ratio is outside the first preset range, execute step S300. If the rectangular width-to-length ratio is within the first preset range, execute step S400.
[0077] In a possible implementation, the target type is a person. The first preset range is (0.2, 0.7) or [0.2, 0.7] or [0.2, 0.7) or (0.2, 0.7].
[0078] S300, based on the rectangle width-to-length ratio being outside a first preset range, determining the degree of matching between the object to be tested and the target type template, and determining whether the object to be tested is of the target type based on the degree of matching between the object to be tested and the target type template. The first preset range is the width-to-length ratio range corresponding to the target type.
[0079] When the width-to-length ratio of the rectangle is outside the first preset range, whether the object to be tested is of the target type is determined by the matching degree between the object to be tested and the target type template, thereby achieving re-detection of the object to be tested, thereby reducing the missed detection rate.
[0080] In a possible implementation, the steps of determining a degree of matching between the object to be detected and the target type template, and determining whether the object to be detected is of the target type based on the degree of matching between the object to be detected and the target type template include:
[0081] S310, obtaining a DT (Distance Transform) image of the object to be measured based on the first image.
[0082] In a possible implementation manner, obtaining a DT image of the object to be measured based on the first image includes:
[0083] The edge detection algorithm is used to perform edge detection on the first image. The first image is subjected to the edge detection algorithm to obtain a binary pixel (i.e., 0 and 255, representing black and white, respectively) containing only the edge information of the object. The edge image is distance-converted by Euclidean distance, and the distance from each non-edge pixel (i.e., background pixel located inside the edge line) to its nearest edge pixel is calculated. During the conversion process, the edge pixels themselves are usually assigned a specific value of 0, indicating that their distance to themselves is 0. The background pixels are assigned a value representing their distance to the nearest edge pixel. The image obtained after the distance conversion is a DT image, in which the value of each pixel represents the Euclidean distance from the pixel to its nearest edge pixel. Therefore, the DT image is actually a grayscale image, in which the grayscale value of the pixel corresponds to the distance information.
[0084] S320, based on the DT image of the object to be tested and the feature points of the target type template, obtain the average chamfer distance between each target pixel point in the DT image of the object to be tested and the pixel point corresponding to the feature point. In a possible implementation, the target pixel point may be a point in the DT image other than the point corresponding to the feature point in the target type module. Or in a possible implementation, the target pixel point may be each pixel point in the DT image.
[0085] In a possible implementation, the DT image is convolved with the feature point f in the target type template F one by one, and the distances from the coordinates of the feature point f in the target type template F to the DT image are added, and then the average value is calculated (normalizing the size of the template), that is, the chamfer distance, and the calculation formula is:
[0086]
[0087] in, This is the average chamfer distance. Each pixel has its own corresponding average chamfer distance.
[0088] After obtaining the average chamfer distance of each target pixel, the minimum average chamfer distance is obtained. In order to facilitate understanding of the solution, the minimum average chamfer distance can be named as the first distance.
[0089] S330, determine whether the minimum distance among all the average chamfer distances is greater than or equal to the first threshold. That is, determine whether the first distance is greater than or equal to the first threshold. The first threshold is a threshold corresponding to the target type template and is used to characterize the matching accuracy. When the minimum distance among all the average chamfer distances is greater than or equal to the first threshold, the object to be measured is of the target type. When the minimum distance among all the average chamfer distances is less than the first threshold, the object to be measured is not of the target type. In a possible implementation, when the minimum distance among all the average chamfer distances is less than the first threshold, the object to be measured is of other types.
[0090] In the embodiment of the present application, the target type model matching is used as a supplementary recognition of the first level classification (i.e., the width-to-length ratio), thereby enhancing the recognition capability of pedestrians with special characteristics.
[0091] S400, based on the rectangle width-to-length ratio being in a first preset range, determining the matching degree between the object to be detected and the target feature information, and determining whether the object to be detected is a target type based on the matching degree between the object to be detected and the target feature information, wherein the target feature information is feature information of the target type.
[0092] When the width-to-length ratio of the rectangle is within the first preset range, determining whether the object to be detected is of the target type is performed based on the degree of matching between the object to be detected and the target feature information, which helps to improve the accuracy of the detection result.
[0093] In a possible implementation, the steps of determining a degree of match between the object to be detected and the target feature information, and determining whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target feature information include:
[0094] S410, based on the contour map of the object to be measured, obtaining a local contour map corresponding to the target feature information.
[0095] In step S410, the local contour map corresponding to the target feature information is segmented using a threshold segmentation algorithm to obtain a local contour map. Figure 4 As shown in , the local contour image includes the local edge and all the pixels inside the edge. Figure 4 A profile diagram of a head and shoulders is shown.
[0096] Taking the target feature information including the head contour feature as an example, based on the contour map of the object to be measured, a local contour map corresponding to the target feature information is obtained, that is, based on the contour map of the object to be measured, a head contour map is obtained. The specific implementation method can be:
[0097] S411, extracting the coordinates of each pixel point in the target contour, wherein the extraction of the pixel point coordinates is performed by scanning in a pre-set scanning order, for example, scanning from left to right and from top to bottom.
[0098] S412, defining the leftmost coordinate of the head contour binary image as (0, 0).
[0099] S413, defining the leftmost pixel point coordinates of the first row of head contour boundary pixels as (1, j), and the rightmost pixel point boundary coordinates as (l, k);
[0100] S414, defining the boundary coordinates of the leftmost pixel point of the mth row as (m, n), and the boundary coordinates of the rightmost pixel point as (m, h);
[0101] S415, the leftmost pixel boundary coordinates of the m+5th row are (m+5, x), and the rightmost pixel boundary coordinates are (m+5, y);
[0102] S415, based on the coordinate relationship, the following relationship is satisfied:
[0103] yx≥k*(hk) (2)
[0104] The m+1th row is determined as the lower boundary of the head contour. Wherein, k is a preset coefficient, 1.2≤k≤1.4, and in a possible implementation manner, k=1.3.
[0105] From formula (2), it can be concluded that the coordinate values corresponding to the pixel points at the lower boundary of the head contour and the pixel points at the shoulder should vary greatly. Therefore, when the coordinate relationship of the pixels satisfies the above formula, the m+1th row is determined as the lower boundary of the head contour.
[0106] In a possible implementation, if the coordinate relationship of the pixels does not satisfy the above formula, the next row is scanned continuously, and the m value is updated to the row sequence of the next row, that is, the m value is updated to the current m value+1.
[0107] S420, based on the local contour map, obtaining actual feature values corresponding to the target feature information.
[0108] Based on the calculation method of the target feature information, the actual feature value corresponding to it is calculated.
[0109] Taking the case where the target feature information includes a head contour feature, and the head contour feature includes circularity as an example, based on the local contour map, the actual feature value corresponding to the target feature information is obtained as follows: based on the head contour map, the circularity of the head of the object to be measured is obtained, and the specific steps may include:
[0110] The roundness of the head of the object to be measured is calculated based on formula (1). The specific calculation process is:
[0111] The head area S of the object to be measured corresponding to the head outline in formula (1) satisfies:
[0112]
[0113] Among them, At in formula (3) i Represents the total area of the target object corresponding to all pixels in the i-th row in the head contour image.
[0114] The circumference L of the head of the object to be measured corresponding to the head outline in formula (1) satisfies:
[0115] L=L1+L2 (4)
[0116]
[0117] L2=(kj)+(hn) (6)
[0118] Among them, L1 represents the vertical circumference of the head of the object to be measured, C st is the length between two adjacent rows of pixels, and L2 is the sum of the lengths of the upper and lower boundaries of the contour in the horizontal direction.
[0119] S430, when the actual characteristic value is within the second preset range, the object to be measured is of the target type. When the actual characteristic value is outside the second preset range, the object to be measured is not of the target type. In a possible implementation, when the actual characteristic value is outside the second preset range, the object to be measured is of other types.
[0120] The second preset range is used to characterize the range of target characteristic information of the target type. In a possible implementation, the second preset range is (0.7, 1) or [0.7, 1] or [0.7, 1) or (0.7, 1].
[0121] In this implementation, the area and perimeter are calculated by sequentially scanning the coordinate points within the boundary, which improves the calculation efficiency. In addition, this implementation can accurately identify the pedestrian's head through precise contour extraction and subsequent head contour boundary recognition, and then calculate its circularity, providing strong technical support for pedestrian recognition.
[0122] In the embodiment of the present application, the rectangular width-to-length ratio corresponding to the object to be tested is firstly used for preliminary screening. When the rectangular width-to-length ratio is within the first preset range, the degree of matching between the object to be tested and the target feature information is used to determine whether the object to be tested is of the target type, thereby improving the accuracy of the detection result; when the rectangular width-to-length ratio is outside the first preset range, the degree of matching between the object to be tested and the target type template is used to determine whether the object to be tested is of the target type, thereby achieving re-detection of the object to be tested, thereby reducing the missed detection rate. Therefore, the embodiment of the present application implements two-level classification, firstly performing preliminary classification by the aspect ratio, and then performing secondary classification by the target feature information. This multi-level classification method can effectively reduce the missed detection rate.
[0123] In summary, in the embodiments of the present application, the advantage of the human head and shoulders and the upper and lower legs being difficult to be blocked at the same time is utilized to avoid the system being unable to recognize pedestrians with special features and reduce the problem of being unable to recognize due to occlusion. As a non-rigid target, the human body may present various postures. The features in existing pedestrian recognition methods are often blocked during posture changes or undergo large changes, which makes it difficult to make a unified description. However, the human head rarely changes in shape, which meets the requirement of easy unified description. Therefore, the method provided in the embodiments of the present application improves the accuracy and robustness of recognition.
[0124] like Figure 5 As shown, the embodiment of the present application further provides an object type recognition device 100, including: an acquisition unit 101 and a processing unit 102.
[0125] The acquisition unit 101 is used to acquire a contour image of the object to be measured.
[0126] The acquisition unit 102 includes a multi-line laser radar, for example, a 128-line laser radar.
[0127] The processing unit 102 is used to obtain the width-to-length ratio of a rectangle corresponding to the contour image according to the contour image of the object to be measured.
[0128] The specific implementation process of the processing unit 102 obtaining the width-to-length ratio of the rectangle corresponding to the contour image according to the contour image of the object to be measured can refer to the implementation process of step S200, which will not be described in detail here.
[0129] The processing unit 102 is further configured to determine the degree of match between the object to be detected and the target type template based on the rectangle width-to-length ratio being outside a first preset range, and determine whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target type template. The first preset range is the width-to-length ratio range corresponding to the target type.
[0130] The specific implementation process of the processing unit 102 determining the matching degree between the object to be tested and the target type template and determining whether the object to be tested is of the target type based on the matching degree between the object to be tested and the target type template can refer to the implementation process of step S300 and will not be repeated here.
[0131] The processing unit 102 is further configured to determine the matching degree between the object to be detected and the target feature information based on the rectangle width-to-length ratio being in the first preset range, and determine whether the object to be detected is a target type based on the matching degree between the object to be detected and the target feature information, wherein the target feature information is feature information of the target type.
[0132] The specific implementation process of the processing unit 102 determining the matching degree between the object to be detected and the target feature information, and determining whether the object to be detected is of the target type based on the matching degree between the object to be detected and the target feature information, can refer to the implementation process of step S400, which is not repeated here.
[0133] The object type recognition device provided in the embodiment of the present application realizes two-level classification, firstly performing preliminary classification based on aspect ratio, and then performing secondary classification based on target feature information. This multi-level classification method can effectively reduce the missed detection rate.
[0134] An embodiment of the present application also provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device executes the method provided in any of the aforementioned embodiments.
[0135] like Figure 6 As shown, in a possible implementation, the electronic device 200 may include: a processor 201, a memory 202, and a communication unit 203. These components communicate via one or more buses. Those skilled in the art will appreciate that the structure of the electronic device shown in the figure does not limit the embodiments of the present invention. It may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0136] The communication unit 203 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0137] The processor 201 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs, instructions, and / or modules stored in the memory 202, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of a plurality of packaged ICs with the same or different functions. For example, the processor 201 can include only a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0138] The memory 202 is used to store the execution instructions of the processor 201. The memory 202 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0139] When the execution instructions in the memory 202 are executed by the processor 201, the electronic device 200 can execute Figure 1 Some or all of the steps in the illustrated embodiments.
[0140] The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method provided in any of the above embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0141] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes the method provided in any of the aforementioned embodiments.
[0142] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0143] An embodiment of the present application further provides a vehicle, the vehicle comprising the device for identifying the type of an object provided by any of the aforementioned embodiments, or comprising the electronic device provided by the aforementioned embodiments.
[0144] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A method for identifying the type of an object, characterized in that: include: Acquire a contour image of the object to be measured; According to the contour image of the object to be measured, obtaining the width-to-length ratio of the rectangle corresponding to the contour image; Based on the fact that the width-to-length ratio of the rectangle is outside a first preset range, determining the degree of matching between the object to be tested and the target type template, and determining whether the object to be tested is the target type based on the degree of matching between the object to be tested and the target type template; wherein the first preset range is the width-to-length ratio range corresponding to the target type; Based on the width-to-length ratio of the rectangle being within the first preset range, the degree of match between the object to be tested and the target feature information is determined, and based on the degree of match between the object to be tested and the target feature information, it is determined whether the object to be tested is the target type; wherein the target feature information is feature information of the target type.
2. The method according to claim 1, characterized in that Before the step of determining the degree of matching between the object to be detected and the target type template based on the width-to-length ratio of the rectangle being outside the first preset range, and determining whether the object to be detected is of the target type based on the degree of matching between the object to be detected and the target type template, the step includes: The target type is determined.
3. The method according to claim 1, characterized in that The step of obtaining a contour image of the object to be measured comprises: Acquire a first image, wherein the first image includes the image of the object to be measured; Based on the first image, a contour image of the object to be measured is obtained.
4. The method according to claim 3, characterized in that The step of obtaining a contour image of the object to be measured based on the first image includes: Preprocessing the first image; Based on a binary segmentation algorithm, the preprocessed first image is segmented to obtain a contour image of the object to be measured.
5. The method according to claim 3, characterized in that: The step of determining the degree of matching between the object to be detected and the target type template, and determining whether the object to be detected is of the target type based on the degree of matching between the object to be detected and the target type template comprises: Based on the first image, obtaining a DT image of the object to be measured; Based on the DT image of the object to be tested and the feature points of the target type template, obtaining an average chamfer distance between each target pixel point in the DT image of the object to be tested and the pixel point corresponding to the feature point; When the minimum distance among all the average chamfer distances is greater than or equal to the first threshold, the object to be measured is the target type.
6. The method according to claim 1, characterized in that The target type is a person; the target feature information includes a head contour feature.
7. The method according to claim 1, characterized in that The step of determining the degree of matching between the object to be detected and the target feature information, and determining whether the object to be detected is of the target type based on the degree of matching between the object to be detected and the target feature information comprises: Based on the contour map of the object to be measured, obtaining a local contour map corresponding to the target feature information; Based on the local contour map, an actual feature value corresponding to the target feature information is obtained; When the actual characteristic value is within the second preset range, the object to be detected is the target type.
8. A device for identifying the type of an object, characterized in that: include: An acquisition unit, used for acquiring a contour image of the object to be measured; A processing unit, configured to obtain, according to the contour image of the object to be measured, a width-to-length ratio of a rectangle corresponding to the contour image; The processing unit is further configured to determine the degree of match between the object to be detected and the target type template based on the fact that the width-to-length ratio of the rectangle is outside a first preset range, and determine whether the object to be detected is of the target type based on the degree of match between the object to be detected and the target type template; wherein the first preset range is the width-to-length ratio range corresponding to the target type; The processing unit is also used to determine the matching degree between the object to be tested and the target feature information based on the width-to-length ratio of the rectangle being within the first preset range, and to determine whether the object to be tested is the target type based on the matching degree between the object to be tested and the target feature information; wherein the target feature information is feature information of the target type.
9. An electronic device, characterized in that: The electronic device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.
12. A vehicle, characterized in that: The vehicle includes the object type identification device according to claim 8, or includes the electronic device according to claim 9.