Image-based target detection method and device, equipment, medium and product

By generating heat map areas and segmenting pictures to construct object element areas, determine key point coordinates, and optimize target detection methods, the problem of low target detection position accuracy in the existing technology is solved and higher position accuracy is achieved.

CN118609086AInactive Publication Date: 2024-09-06ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410699348.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing object detection methods only determine the location of a specific object by extracting image features, resulting in low location accuracy.

Method used

By generating a heat map area of ​​a specific object, segmenting the image according to the center point and offset within the heat map area, we obtain an object image including the specific object, and divide it into multiple rectangular areas, construct the object element area, and determine each coordinates of key points in each area, thereby optimizing the position of specific objects.

Benefits of technology

The accuracy of the location of a specific object is improved. Compared with the method of determining the location only by extracting image features, the accuracy of the location is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609086A
    Figure CN118609086A
Patent Text Reader

Abstract

The invention provides an image-based target detection method and device, equipment, a medium and a product, which can be applied to the technical field of image processing. In the method, after a heat map area corresponding to a specific object is generated according to a picture collected for the specific object, the picture is segmented according to a center point and offset in the heat map area to obtain an object picture comprising the specific object, and the object picture is divided into a plurality of rectangular areas. After a plurality of object element areas are constructed in combination with the specific object, key point coordinates of each object element area are determined; and optimizing the position of the specific object according to the determined key point coordinates to obtain the optimized position of the specific object. According to the scheme, the position of the specific object is optimized according to the key point coordinates, so that the accuracy of the position of the specific object is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image-based target detection method, device, equipment, medium and product. Background Art

[0002] With the development of science and technology, target detection has been widely used in various fields, such as high-precision map production, autonomous driving, and medical image analysis.

[0003] In the prior art, target detection usually uses a target detection algorithm to process a large number of pixels in an image, extract features, and then identify the location of a specific object in the image.

[0004] In summary, existing target detection methods determine the location of a specific object only by extracting image features, resulting in low accuracy of the location of the specific object. Summary of the invention

[0005] The present application provides an image-based target detection method, apparatus, device, medium and product, which are used to solve the problem that the existing target detection method determines the position of a specific object only by extracting image features, resulting in low accuracy of the obtained position of the specific object.

[0006] In a first aspect, an embodiment of the present application provides an image-based target detection method, the method comprising:

[0007] Generate a heat map region corresponding to a specific object based on the image collected for the specific object;

[0008] Segmenting the image according to the center point and the offset within the heat map area to obtain an object image, and dividing the object image into a plurality of rectangular areas, wherein the object image includes the specific object;

[0009] Constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions;

[0010] According to the centroid of each object element area, the key point coordinates of each object element area are determined;

[0011] The position of the specific object is optimized according to the determined key point coordinates to obtain an optimized specific object position.

[0012] In a specific embodiment, the specific object comprises an elongated object.

[0013] In a specific implementation, the specific object includes a map element.

[0014] In a specific implementation, the plurality of object element regions are determined by the boundary lines of each rectangular region and the outer lines of the specific object.

[0015] In a specific implementation, generating a heat map region corresponding to a specific object based on a picture collected for the specific object includes:

[0016] Converting the image into a heat map;

[0017] The area formed by the pixels in the heat map whose grayscale values ​​are less than a preset grayscale threshold is used as the heat map area corresponding to the specific object, wherein the preset grayscale threshold is set based on the specific object.

[0018] In a specific implementation, optimizing the position of the specific object according to the determined key point coordinates to obtain the optimized specific object position includes:

[0019] The centerline coordinates of the specific object are obtained according to the key point coordinates of the plurality of object element regions.

[0020] In a specific implementation, the specific object is segmented using a binarization method.

[0021] In a second aspect, an embodiment of the present application provides an image-based target detection device, comprising:

[0022] A generation module, used to generate a heat map area corresponding to a specific object based on a picture collected for the specific object;

[0023] Processing modules for:

[0024] Segmenting the image according to the center point and the offset within the heat map area to obtain an object image, and dividing the object image into a plurality of rectangular areas, wherein the object image includes the specific object;

[0025] Constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions;

[0026] According to the centroid of each object element area, the key point coordinates of each object element area are determined;

[0027] The position of the specific object is optimized according to the determined key point coordinates to obtain an optimized specific object position.

[0028] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0029] Processor, memory, communication interface;

[0030] The memory is used to store executable instructions of the processor;

[0031] Wherein, the processor is configured to perform the image-based target detection method described in any one of the first aspects by executing the executable instructions.

[0032] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the image-based target detection method described in any one of the first aspects is implemented.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the image-based target detection method described in any one of the first aspects.

[0034] The image-based target detection method, device, equipment, medium and product provided in the embodiments of the present application generate a heat map area corresponding to a specific object based on a picture collected for a specific object, and then segment the picture according to the center point and offset in the heat map area to obtain an object picture including the specific object, and divide the object picture into multiple rectangular areas. After constructing multiple object element areas in combination with the specific object, the key point coordinates of each object element area are determined; then, based on the determined key point coordinates, the position of the specific object is optimized to obtain an optimized specific object position. Compared with the prior art that only determines the position of a specific object by extracting picture features and does not optimize the position, this solution improves the accuracy of the position of the specific object by optimizing the position of the specific object according to the key point coordinates. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] Figure 1 A schematic diagram of an application scenario of the image-based object detection method provided in this application;

[0037] Figure 2 A schematic diagram of a picture obtained by a visual sensor provided in this application;

[0038] Figure 3 A schematic diagram of a specific object provided for this application;

[0039] Figure 4A schematic diagram of a flow chart of a first embodiment of an image-based target detection method provided in the present application;

[0040] Figure 5 Virtual box diagram provided for this application Figure 1 ;

[0041] Figure 6 Virtual box diagram provided for this application Figure 2 ;

[0042] Figure 7 Virtual box diagram provided for this application Figure 3 ;

[0043] Figure 8 Virtual box diagram provided for this application Figure 4 ;

[0044] Fig. 9 Virtual box diagram provided for this application Figure 5 ;

[0045] Fig.10 Virtual box diagram provided for this application Figure 6 ;

[0046] Fig.11 A schematic diagram of the process of obtaining an object image provided by this application;

[0047] Fig.12 A schematic diagram of the object image provided for this application;

[0048] Fig.13 Schematic diagram of the object element area provided for this application Figure 1 ;

[0049] Fig.14 Schematic diagram of the object element area provided for this application Figure 2 ;

[0050] Fig.15 Schematic diagram of the object element area provided for this application Figure 3 ;

[0051] Fig.16 Schematic diagram of the object element area provided for this application Figure 4 ;

[0052] Fig.17 A schematic diagram of the process of the image-based target detection method provided in this application;

[0053] Fig.18 Schematic diagram of the object element area provided for this application Figure 5 ;

[0054] Fig.19A schematic diagram of the structure of an embodiment of an image-based target detection device provided by the present application;

[0055] Fig. 20 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0057] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0058] With the development of science and technology, target detection has been widely used in various fields, such as high-precision map production, autonomous driving, and medical image analysis.

[0059] For example, a highly accurate semantic map can be constructed by using the Simultaneous Localization and Mapping (SLAM) technology. This process involves the recognition of map elements, which is a target detection process.

[0060] In the prior art, target detection usually uses a target detection algorithm to process a large number of pixels in an image, extract features, and then identify the location of a specific object in the image. Since the location of a specific object is determined only by extracting image features, the accuracy of the determined location of the specific object is low.

[0061] In view of the problems existing in the prior art, the inventors found in the process of studying the image-based target detection method that in order to improve the accuracy of the position of a specific object, an object picture including the specific object can be segmented from the picture, and then the object picture can be divided into multiple rectangular areas, and multiple object element areas are formed in combination with the specific object, and then the optimized position of the specific object is obtained according to the key point coordinates of each object element area. Based on the above inventive concept, the image-based target detection scheme in this application is designed.

[0062] The executor of the image-based target detection method in the present application may be a vehicle, or a camera, a server, etc. The present application does not limit it and the following description will be made using a vehicle as an example.

[0063] For example, Figure 1 A schematic diagram of an application scenario of the image-based target detection method provided in this application, such as Figure 1 As shown, the application scenario includes a vehicle 10 , as well as other vehicles and pedestrians.

[0064] The vehicle 10 has an intelligent driving function, which includes but is not limited to supporting L2 and above levels of automatic driving functions, which can be a driving function that supports lane-level navigation, and can also be automatic assisted navigation driving (Navigate on Autopilot, referred to as NOA).

[0065] The vehicle 10 is equipped with sensors, which may be visual sensors, such as cameras, for capturing video data and pictures; or radar sensors, including but not limited to ultrasonic and millimeter wave radar sensors. The vehicle 10 may include a laser sensor for measuring distance information, etc.; it may also include an inertial sensor, such as an inertial measurement unit (IMU), for measuring vehicle posture information; it may also include a positioning device, such as a device deploying a global navigation satellite system (GNSS), for measuring position information; it may also include a wheel meter, etc., for calculating vehicle speed. The above sensors may also be used in combination to achieve a certain function, such as an inertial sensor and a positioning device jointly realizing the measurement of vehicle posture information.

[0066] Figure 1 In the process of driving the vehicle 10, sensors can be used to detect various data. Taking the camera as an example, other vehicles around the vehicle, road settings, lane lines, pedestrians, street lights, road signs and other elements can be detected, and the detection results can be given to the vehicle system to realize functions such as decision-making.

[0067] It should be noted that the above-mentioned sensor detection process can be understood as a "map building" function. The elements on the road are obtained through sensors, combined with information such as position and vehicle posture, and the above information is processed and saved to build a "map" for use by the vehicle system.

[0068] It should be noted that the detection results of the above sensors and / or high-precision maps can be provided to the vehicle system to achieve high-precision positioning of the vehicle, which is also called fusion positioning.

[0069] It is also possible to implement corresponding decision-making functions based solely on the detection results of the above sensors. For example, when a visual sensor and / or radar sensor detects a pedestrian or an obstacle, lane changing or braking can be implemented.

[0070] It should be noted that the vehicle 10 can also be a professional data collection vehicle. Compared with ordinary vehicles, its sensor has higher accuracy. By acquiring the laser point cloud data of the elements, the point cloud data is automatically or manually converted into vector data for use by the vehicle system.

[0071] During the driving process, the vehicle 10 can continuously or in real time acquire pictures or videos of the surroundings of the vehicle through the visual sensor according to the demand. The acquired picture can be any frame of pictures acquired by the visual sensor at any time, and the picture is a picture collected for a specific object. For example, Figure 2 A schematic diagram of a picture obtained by a visual sensor provided in this application, such as Figure 2 As shown, the figure is a picture of the driving direction of the vehicle 10, and the picture includes lane lines, which are specific objects.

[0072] It should be noted that the specific object may include a slender object and / or a map element, and the map element includes lane lines, road indication information, etc. The slender object is a specific type of target with an extreme aspect ratio, including a rod-shaped object, a slender object, etc. The rod-shaped object may include facilities such as a telephone pole, a street lamp, and a rod-shaped object for placing road signs. The slender object includes a fruit knife, a banana, a flower petal, etc. The embodiments of the present application do not limit the specific objects, slender objects, and map elements, and they can be determined according to actual conditions.

[0073] It should be noted that the device for collecting images of specific objects can also be cameras installed on the roadside, drones, etc.

[0074] For example, Figure 3 A schematic diagram of a specific object provided for this application, such as Figure 3 As shown, the picture includes map elements such as pedestrians and vehicles, as well as pole-like objects such as vertical poles and telephone poles that carry speed limit signs.

[0075] Based on the pictures collected for the specific object, a heat map area corresponding to the specific object is generated, and then the picture is segmented according to the center point and offset in the heat map area to obtain an object picture including the specific object, and the object picture is divided into multiple rectangular areas. Combined with the edge of the specific object, multiple object element areas can be formed.

[0076] Then, the position of the specific object is optimized according to the key points of each object element area to obtain the optimized position of the specific object.

[0077] After acquiring the picture, the vehicle 10 can vectorize the specific object according to the optimized position of the specific object, which can form a high-precision map or be used for updating the high-precision map.

[0078] It should be noted that Figure 1 This is only a schematic diagram of an application scenario provided by the embodiment of the present application. Figure 1 The actual form of the various devices included in the Figure 1 The interaction mode between devices is limited, and in the specific application of the solution, it can be set according to actual needs.

[0079] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0080] Figure 4 This is a flow chart of the first embodiment of the image-based target detection method provided by the present application. The present embodiment of the present application describes the situation where a vehicle optimizes the position of a characteristic object based on a picture collected for a specific object. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. Figure 4 As shown, the image-based target detection method specifically includes the following steps:

[0081] S401: Generate a heat map region corresponding to the specific object based on a picture collected for the specific object.

[0082] In this step, after the vehicle obtains the image collected for a specific object, in order to identify the specific object, it needs to convert the image into a heatmap (also known as a heat map). A heatmap is a chart that uses color to represent data density or intensity. It maps data to different colors to show the distribution and changes of data.

[0083] Since the color corresponding to a specific object in the heat map is darker, that is, the grayscale value is smaller, the heat map area corresponding to the specific object can be determined based on the grayscale value of each pixel in the heat map and the preset grayscale threshold. That is, the area formed by the pixels whose grayscale value is less than the preset grayscale threshold is used as the heat map area corresponding to the specific object.

[0084] It should be noted that the preset grayscale threshold is set based on a specific object, and the preset grayscale threshold may be 30, 40, 60, etc. The embodiment of the present application does not limit the preset grayscale threshold, and it may be set according to actual conditions.

[0085] It should be noted that the heat map may be a Gaussian heat map or an activation class heat map generated by Grad-Cam. The present application embodiment does not limit the heat map, and it can be determined according to actual conditions.

[0086] When the heat map is a Gaussian heat map, the heat map area is a Gaussian heat map area. Gaussian heat maps use Gaussian kernel functions to smooth data, which can effectively reduce the impact of noise and outliers on the results, making the image smoother and clearer. Gaussian heat maps can show the continuity of data distribution, display the density changes of data through color gradients, and more intuitively present the distribution characteristics of data. Gaussian heat maps can intuitively display the distribution of data, allowing people to quickly understand the density distribution and trends of data, which is helpful for data analysis and decision-making. Gaussian heat maps are suitable for various data types and distributions, have good versatility and applicability, and can be used for data visualization and analysis in different fields. Therefore, using Gaussian heat maps to determine specific objects makes the determined heat map area more accurate.

[0087] It should be noted that the image collected for a specific object may have a first coordinate system, including a horizontal coordinate and a vertical coordinate, and each specific object has position information in the coordinate system; the image may also establish its first coordinate system according to the resolution. The first coordinate system may correspond to a second coordinate system in the real world, and the second coordinate system has a horizontal coordinate, a vertical coordinate and a height coordinate, and the height coordinate represents the height information of the object in the real world.

[0088] S402: Segment the image according to the center point and the offset in the heat map area to obtain an object image, and divide the object image into multiple rectangular areas.

[0089] In this step, after the vehicle determines the heat map area, the center point within the heat map area can be determined.

[0090] The method for determining the position of the center point may be: setting the weight of each pixel in the heat map area to 1, and then using the centroid calculation formula to solve the centroid of the heat map area, and using the centroid as the center point.

[0091] Another method for determining the position of the center point is to set the weight of each pixel in the heat map area to the gray value of the pixel, and then use the centroid calculation formula to solve the centroid of the heat map area, and use the centroid as the center point.

[0092] The position of the center point may also be determined by determining a circumscribed circle of the heat map area and then using the center of the circumscribed circle as the center point.

[0093] Another way to determine the position of the center point is to perform target recognition processing on the heat map area, determine the pixels corresponding to the specific objects therein, set the weights of these pixels as the grayscale values ​​of the pixels, and then use the centroid calculation formula to solve the centroid, and use the centroid as the center point.

[0094] The position of the center point may also be determined by performing target recognition processing on the heat map area, determining the pixel points corresponding to the specific object therein, and then determining the circumscribed circle of these pixel points, and then using the center of the circumscribed circle as the center point.

[0095] It should be noted that the embodiment of the present application does not limit the method of determining the position of the center point in the heat map area, and can be set according to actual conditions.

[0096] It should be noted that the centroid calculation formula can be but is not limited to: and in, n represents the total number of pixels, m i Indicates the weight of the i-th pixel, x i Represents the horizontal coordinate of the i-th pixel, y i Represents the ordinate of the i-th pixel, and (x0, y0) is the centroid.

[0097] After the vehicle determines the center point, the virtual box corresponding to the feature object can be determined in combination with the offset. The virtual box is also called bbox.

[0098] It should be noted that the offset may be preset or obtained during the target recognition process.

[0099] In one implementation, the offset includes a horizontal offset X and a vertical offset Y. After the center point is moved to the left by the horizontal offset X, a first pixel point is obtained, and a first vertical line passing through the first pixel point is drawn. After the center point is moved to the right by the horizontal offset X, a second pixel point is obtained, and a second vertical line passing through the second pixel point is drawn. After the center point is moved up by the vertical offset Y, a third pixel point is obtained, and a first horizontal line passing through the third pixel point is drawn. After the center point is moved down by the vertical offset Y, a fourth pixel point is obtained, and a second horizontal line passing through the fourth pixel point is drawn. The rectangular frame formed by the first horizontal line, the second horizontal line, the first vertical line, and the second vertical line is determined as a virtual frame corresponding to a specific object. The width of the virtual frame is 2X, and the height of the virtual frame is 2Y.

[0100] For example, Figure 5 Virtual box diagram provided for this application Figure 1 ,like Figure 5 As shown, the specific object in the figure is a pedestrian, the dotted box represents a virtual box, and the black dot represents a center point. The virtual box corresponding to the pedestrian can be determined based on the center point and the lateral offset X, as well as the longitudinal offset Y.

[0101] For example, Figure 6 Virtual box diagram provided for this application Figure 2 ,like Figure 6 As shown, the specific object in the figure is a vehicle, the dotted box represents the virtual box, and the black dot represents the center point. The virtual box corresponding to the vehicle can be determined based on the center point and the lateral offset X, as well as the longitudinal offset Y.

[0102] In another implementation, the offset includes a first transverse offset X1, a second transverse offset X2, a first longitudinal offset Y1, and a second longitudinal offset Y2. After the center point is shifted to the left by the first transverse offset X1, a fifth pixel point is obtained, and a third vertical line passing through the fifth pixel point is drawn. After the center point is shifted to the right by the second transverse offset X2, a sixth pixel point is obtained, and a fourth vertical line passing through the sixth pixel point is drawn. After the center point is shifted up by the first longitudinal offset Y1, a seventh pixel point is obtained, and a third transverse line passing through the seventh pixel point is drawn. After the center point is shifted down by the second longitudinal offset Y2, an eighth pixel point is obtained, and a fourth transverse line passing through the eighth pixel point is drawn. The rectangular frame formed by the third transverse line, the fourth transverse line, the third vertical line, and the fourth vertical line is determined as a virtual frame corresponding to a specific object. The width of the virtual frame is X1+X2, and the height of the virtual frame is Y1+Y2.

[0103] For example, Figure 7 Virtual box diagram provided for this application Figure 3 ,like Figure 7As shown, the specific object in the figure is a pedestrian, the dotted box represents a virtual box, and the black dot represents a center point. The virtual box corresponding to the pedestrian can be determined based on the center point and the first lateral offset X1, the second lateral offset X2, the first longitudinal offset Y1, and the second longitudinal offset Y2.

[0104] For example, Figure 8 Virtual box diagram provided for this application Figure 4 ,like Figure 8 As shown, the specific object in the figure is a vehicle, the dotted box represents the virtual box, and the black dot represents the center point. The virtual box corresponding to the vehicle can be determined based on the center point and the first lateral offset X1, the second lateral offset X2, the first longitudinal offset Y1, and the second longitudinal offset Y2.

[0105] Target recognition can be performed on the heat map area, and a detection frame can be determined. The detection frame is determined based on the horizontal offset X, the vertical offset Y, or the first horizontal offset X1, the second horizontal offset X2, the first vertical offset Y1, and the second vertical offset Y2. Target recognition can be achieved using a target recognition model. When training the target recognition model, the L2 loss or the Intersection over Union (IoU) loss can be used to train the model. Since the horizontal offset X and the vertical offset Y have less data than the first horizontal offset X1, the second horizontal offset X2, the first vertical offset Y1, and the second vertical offset Y2, the amount of calculation is halved and the training is faster.

[0106] It should be noted that the virtual frame may also be generated by performing target recognition on the heat map area, determining two virtual frame corner points, one being the upper left corner point and the other being the lower right corner point, and then generating the virtual frame based on the two corner points.

[0107] For example, Fig. 9 Virtual box diagram provided for this application Figure 5 ,like Fig. 9 As shown, the specific object in the figure is a pedestrian, the dotted box represents a virtual box, and the black dots represent corner points of the virtual box. The virtual box corresponding to the pedestrian can be determined based on the two virtual box corner points.

[0108] For example, Fig.10 Virtual box diagram provided for this application Figure 6 ,like Fig.10 As shown, the specific object in the figure is a vehicle, the dotted box represents the virtual box, and the black dots represent the corner points of the virtual box. The virtual box corresponding to the vehicle can be determined based on the two virtual box corner points.

[0109] After the vehicle determines the virtual box corresponding to the specific object, it determines the virtual box position in the heat map, and then extracts the pixel points of the virtual box position in the image collected for the specific object to obtain the object image, which includes map elements. In order to optimize the position of the specific object later, the object image needs to be divided into multiple rectangular areas, which can be divided into M*N rectangular areas, where M represents the number of rows and N represents the number of columns.

[0110] It should be noted that the object image can be divided into M*N rectangular areas by evenly dividing according to the preset M and N, or by dividing according to the size and resolution of the virtual frame, and different virtual frames and resolutions correspond to different numbers of rows and columns. The embodiment of the present application does not limit the method of dividing the rectangular area and the number of rows M and columns N, which can be set according to actual conditions.

[0111] The segmentation process can be understood as the process of cutting out the image. After the position of the virtual frame in the image is determined, it can be segmented from the original image so that specific objects can be processed separately.

[0112] It should be noted that the object image can be segmented by a binary method. The pixels in the virtual frame position in the image are marked as 1, and the remaining pixels are marked as 0. The vehicle can set the pixels marked as 0 to black, the pixels marked as 1 to white, and then take out the white pixels and restore them to their original colors to obtain the object image.

[0113] For example, Fig.11 The schematic diagram of the process of obtaining the object image provided by this application is as follows: Fig.11 As shown in the figure, the dotted box represents a virtual box. The pixels in the virtual box position in the picture are set to white, and the remaining pixels are set to black. The white pixels are then taken out and restored to their original colors to obtain the object picture.

[0114] S403: constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions.

[0115] In this step, after the vehicle obtains the object image and multiple rectangular areas, it can construct multiple object element areas in combination with specific objects.

[0116] Specifically, the object image is input into the mask network model, and the object image is binarized to determine the specific object therein. After binarization, some pixels in the object image are marked as 0, and some are marked as 1. The pixels marked as 1 are the pixels corresponding to the specific object, so that the specific object in the object image can be determined.

[0117] The object element region may be formed by determining the boundary line of each rectangular region and the outer lines of the specific object. That is, for each rectangular region, the region enclosed by the rectangular region and the outer lines of the specific object is taken as the object element region, and the object element region belongs to both the rectangular region and the region formed by the pixels corresponding to the specific object. Alternatively, for each rectangular region, the region formed by the pixels marked as 1 in the rectangular region is taken as the object element region.

[0118] It should be noted that after determining the specific object in the object image, the dilation algorithm can be used for smoothing, which can achieve hole filling and edge filling. Then, the M*N rectangular areas are combined to form multiple object element areas.

[0119] For example, Fig.12 A schematic diagram of an object image provided for this application, such as Fig.12 As shown, the specific object in the object picture is a rod-shaped object.

[0120] For example, in Fig.12 On the basis of Fig.13 Schematic diagram of the object element area provided for this application Figure 1 ,like Fig.13 As shown, the object image is divided into 13*12 rectangular areas. Each gray block in the figure represents an object element area. It can be seen that the object element area is determined by the boundary line of each rectangular area and the external lines of the specific object.

[0121] S404: Determine the key point coordinates of each object element region according to the centroid of each object element region.

[0122] In this step, after the vehicle determines multiple object element regions, in order to subsequently optimize the position of a specific object, it is necessary to determine the key point coordinates of each object element region and use the centroid of each object element region as the key point of the object element region.

[0123] The quality of each pixel in the object element area can be determined as the grayscale value of the pixel in the object image, and then the coordinates of the key points in the object element area can be determined using the centroid calculation formula.

[0124] S405: Optimizing the position of the specific object according to the determined key point coordinates to obtain an optimized position of the specific object.

[0125] In this step, after the vehicle determines the key point coordinates of each object element region, the position of the specific object can be optimized based on the key point coordinates of multiple object element regions to obtain an optimized specific object position.

[0126] For each row of object element regions, the object element regions that can be merged into a connected region are regarded as a region group. If an object element region cannot be merged with other object element regions in the same row to form a connected region, then this object element region is regarded as a region group. A connected region means that if any two pixels in a region can be connected by a polyline formed by pixels that completely belong to the region, then this region is called a connected region.

[0127] Furthermore, for each area group, the average coordinates of the key point coordinates of each object element area in the area group are used as the coordinates of the key point corresponding to the area group, and the coordinates of the key points of all area groups constitute the optimized specific object position.

[0128] In one implementation, the centerline coordinates of a specific object, that is, the position of the specific object, can be obtained based on the key point coordinates of multiple object element regions. The key points of the region group are sequentially connected in row order to form the centerline of the specific object.

[0129] For example, in Fig.13 On the basis of Fig.14 Schematic diagram of the object element area provided for this application Figure 2 ,like Fig.14 As shown, the object element regions of each row can constitute a region group, and the black dots in the figure represent the key points of the object element regions.

[0130] For example, in Fig.14 On the basis of Fig.15 Schematic diagram of the object element area provided for this application Figure 3 ,like Fig.15 As shown, the diamonds in the figure represent the key points of the regional group.

[0131] For example, in Fig.15 On the basis of Fig.16 Schematic diagram of the object element area provided for this application Figure 4 ,like Fig.16 As shown, the line formed by the diamond in the figure is the center line of the specific object, and the specific object in the figure is a rod-shaped object. It can be seen that the center line of the rod-shaped object is closer to the actual object.

[0132] For example, Fig.17 A flowchart of the image-based target detection method provided in this application is shown in FIG. Fig.17As shown in the figure, after the vehicle generates a heat map area corresponding to a specific object based on the image collected for the specific object, it determines the virtual frame corresponding to the specific object based on the center point and offset in the heat map area. Then, the object image is segmented from the image based on the virtual frame, and then the object image is divided into multiple rectangular areas, and multiple object element areas are formed in combination with the specific object. Then, based on the key point coordinates of the multiple object element areas, the position of the specific object is optimized to obtain the optimized specific object position.

[0133] The image-based target detection method provided in this embodiment generates a heat map area corresponding to a specific object based on a picture collected for the specific object, and then segments the picture according to the center point and offset in the heat map area to obtain an object picture including the specific object, and divides the object picture into multiple rectangular areas. After constructing multiple object element areas in combination with the specific object, the key point coordinates of each object element area are determined; then, based on the determined key point coordinates, the position of the specific object is optimized to obtain an optimized specific object position. Compared with the prior art that only determines the position of a specific object by extracting picture features and does not optimize the position, this solution improves the accuracy of the position of the specific object by optimizing the position of the specific object according to the key point coordinates.

[0134] The following describes the situation in which a vehicle merges object element areas and then optimizes the position of a specific object to obtain the optimized position of the specific object through the second embodiment provided by the present application.

[0135] After the vehicle obtains multiple object element regions, for each row of object element regions, the object element regions that can be merged into a connected region are regarded as a region group. If an object element region cannot be merged with other object element regions in the same row to form a connected region, then this object element region is regarded as a region group. A connected region means that if any two pixels in a region can be connected by a broken line formed by pixels that completely belong to the region, then this region is called a connected region.

[0136] Then, for each area group, the quality of each pixel in the area group is determined as the grayscale value of the pixel in the segmented image, and the coordinates of the key points of the area group can be determined using the centroid calculation formula. The coordinates of the key points of all area groups constitute the optimized specific object position.

[0137] For example, in Fig.13 On the basis of Fig.18 Schematic diagram of the object element area provided for this application Figure 5 ,like Fig.18As shown, taking the first row as an example, the target element region 11, the target element region 12, the target element region 13, and the target element region 14 may constitute one region group. Fig.18 In the figure, the object element regions of each row can form a region group. The circle in the figure represents the key point of the region group, which is the centroid of the region group.

[0138] The image-based target detection method provided in this embodiment merges the object element regions that can constitute connected regions in each row to form a region group, and then uses the coordinates of the centroid of the region group as the optimized specific object position, so that the optimized specific object position is more accurate.

[0139] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0140] Fig.19 This is a schematic diagram of the structure of an embodiment of an image-based target detection device provided by the present application. Fig.19 As shown, the image-based target detection device 190 includes:

[0141] A generating module 191, configured to generate a heat map region corresponding to a specific object according to a picture collected for the specific object;

[0142] The processing module 192 is used to:

[0143] Segmenting the image according to the center point and the offset within the heat map area to obtain an object image, and dividing the object image into a plurality of rectangular areas, wherein the object image includes the specific object;

[0144] Constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions;

[0145] According to the centroid of each object element area, the key point coordinates of each object element area are determined;

[0146] The position of the specific object is optimized according to the determined key point coordinates to obtain an optimized specific object position.

[0147] Further, the specific object includes an elongated object.

[0148] Furthermore, the specific object includes a map element.

[0149] Furthermore, the plurality of object element regions are determined by the boundary lines of each rectangular region and the outer lines of the specific object.

[0150] Furthermore, the generating module 191 is specifically used for:

[0151] Converting the image into a heat map;

[0152] The area formed by the pixels in the heat map whose grayscale values ​​are less than a preset grayscale threshold is used as the heat map area corresponding to the specific object, wherein the preset grayscale threshold is set based on the specific object.

[0153] Furthermore, the processing module 192 is specifically configured to obtain the centerline coordinates of the specific object according to the key point coordinates of the plurality of object element regions.

[0154] Furthermore, a binarization method is used to segment the specific object.

[0155] The image-based target detection device provided in this embodiment is used to execute the technical solution in any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0156] Fig. 20 This is a schematic diagram of the structure of an electronic device provided in this application. Fig. 20 As shown, the electronic device 2000 includes:

[0157] Processor 2001, memory 2002, and communication interface 2003;

[0158] The memory 2002 is used to store executable instructions of the processor 2001;

[0159] The processor 2001 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.

[0160] Optionally, the memory 2002 may be independent or integrated with the processor 2001 .

[0161] Optionally, when the memory 2002 is a device independent of the processor 2001, the electronic device 2000 may further include:

[0162] The bus 2004, the memory 2002 and the communication interface 2003 are connected to the processor 2001 via the bus 2004 and communicate with each other. The communication interface 2003 is used to communicate with other devices.

[0163] Optionally, the communication interface 2003 can be implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0164] The bus 2004 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0165] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0166] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.

[0167] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the technical solution provided by any of the aforementioned method embodiments is implemented.

[0168] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the aforementioned method embodiments when executed by a processor.

[0169] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An image-based target detection method, characterized in that: The method comprises: Generate a heat map region corresponding to a specific object based on the image collected for the specific object; Segmenting the image according to the center point and the offset within the heat map area to obtain an object image, and dividing the object image into a plurality of rectangular areas, wherein the object image includes the specific object; Constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions; According to the centroid of each object element area, the key point coordinates of each object element area are determined; The position of the specific object is optimized according to the determined key point coordinates to obtain an optimized specific object position.

2. The method according to claim 1, characterized in that The specific object comprises an elongated object.

3. The method according to claim 1, characterized in that The specific object includes a map element.

4. The method according to any one of claims 1 to 3, characterized in that: The plurality of object element regions are determined by the boundary lines of each rectangular region and the outer lines of the specific object.

5. The method according to any one of claims 1 to 3, characterized in that: The step of generating a heat map region corresponding to a specific object according to a picture collected for the specific object includes: Converting the image into a heat map; The area formed by the pixels in the heat map whose grayscale values ​​are less than a preset grayscale threshold is used as the heat map area corresponding to the specific object, wherein the preset grayscale threshold is set based on the specific object.

6. The method according to any one of claims 1 to 3, characterized in that: The step of optimizing the position of the specific object based on the determined key point coordinates to obtain the optimized position of the specific object includes: The centerline coordinates of the specific object are obtained according to the key point coordinates of the plurality of object element regions.

7. The method according to any one of claims 1 to 3, characterized in that: The specific object is segmented by a binarization method.

8. An image-based target detection device, characterized in that: include: A generation module, used to generate a heat map area corresponding to a specific object based on a picture collected for the specific object; Processing modules for: Segmenting the image according to the center point and the offset within the heat map area to obtain an object image, and dividing the object image into a plurality of rectangular areas, wherein the object image includes the specific object; Constructing a plurality of object element regions according to the specific object and the plurality of rectangular regions; According to the centroid of each object element area, the key point coordinates of each object element area are determined; The position of the specific object is optimized according to the determined key point coordinates to obtain an optimized specific object position.

9. An electronic device, characterized in that: include: Processor, memory, communication interface; The memory is used to store executable instructions of the processor; The processor is configured to perform the image-based target detection method according to any one of claims 1 to 7 by executing the executable instructions.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image-based target detection method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that It comprises a computer program, which is used to implement the image-based target detection method according to any one of claims 1 to 7 when executed by a processor.