Position detection method and device, vehicle and storage medium

By aligning and fusing the feature points of the long-focus lens and the short-focus lens, the problem of poor image fusion in intelligent driving is solved, the chip load is reduced, and the detection efficiency is improved.

CN118628704APending Publication Date: 2024-09-10CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410803688.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

During intelligent driving, the image fusion effect output by the telephoto lens and the short-focus lens is poor, resulting in limited accuracy of long-distance object detection, and the existing technology requires additional similarity or intersection ratio calculations to increase the chip load.

Method used

By performing feature alignment on the feature points output by the telephoto lens and the short focus lens, image fusion is performed based on the alignment results to enhance the fusion effect without requiring additional similarity or intersection ratio calculations.

Benefits of technology

It improves the fusion effect of long-focus images and short-focus images, reduces the chip load, improves the efficiency of target object position detection, and can directly detect the target object position in the fused feature map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628704A
    Figure CN118628704A
Patent Text Reader

Abstract

The invention relates to a position detection method and device, a vehicle and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: carrying out feature alignment on feature points in a long-focus image output by a long-focus lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result, carrying out feature fusion on the long-focus image and the short-focus image based on the feature alignment result to obtain a fused feature map, and detecting the fused feature map to obtain a long-focus image and a short-focus image. And obtaining the position of at least one target object in the target scene. Therefore, the effect of fusing the long-focus image and the short-focus image can be effectively enhanced, and the detection efficiency 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 vehicle technology, in particular to the field of image processing technology, and specifically to a position detection method, device, vehicle and storage medium. Background Art

[0002] During the intelligent driving process, the images output by a short-focus lens for close objects can provide good perception results. However, due to the limitation of focal length, the pixel length and width of the images output by the short-focus lens for distant objects are not sufficient to support the accurate prediction of the prediction model. Therefore, a telephoto lens is needed to assist in the detection of distant objects.

[0003] In the process of using a telephoto camera to assist in the detection of distant objects, it is necessary to fuse the telephoto image and the short-focus image output by the telephoto camera so as to detect the category or position information of the target object based on the fused image.

[0004] Therefore, how to enhance the fusion effect of the long-focus image and the short-focus image is an urgent problem to be solved. Summary of the invention

[0005] The present application provides a position detection method, device, vehicle and storage medium, which can effectively enhance the effect of fusing long-focus images and short-focus images. The technical solution of the present application is as follows:

[0006] According to a first aspect of the present application, a position detection method is provided, comprising:

[0007] Feature alignment is performed on feature points in a telephoto image output by a telephoto lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result. Based on the feature alignment result, feature fusion is performed on the telephoto image and the short-focus image to obtain a fused feature map. The fused feature map is detected to obtain the position of at least one target object in the target scene.

[0008] Among them, the long-focus image and the short-focus image are obtained by shooting the target scene at the same time, and the fused feature map is used to detect the position of at least one target object in the target scene. The fused feature map contains multiple feature points; the fused feature map and the short-focus image have the same size.

[0009] By aligning the feature points in the telephoto image and the feature points in the short-focus image through the above technical solution, the problem of serious feature deviation caused by the difference in the field of view of the long-focus lens and the short-focus lens can be solved, and the effect of fusing the telephoto image and the short-focus image can be enhanced. In addition, in the above technical solution, no additional similarity or intersection-over-union calculation is required, so the chip load will not be increased. In summary, the embodiment of the present application can enhance the effect of fusing the telephoto image and the short-focus image.

[0010] In addition, after detecting the fused feature map, the present application can obtain the position of at least one target object in the target scene without performing a post-fusion step, thereby effectively improving the detection efficiency.

[0011] In a possible implementation, feature alignment is performed on feature points in a telephoto image output by a telephoto lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result, including: obtaining coordinates of each feature point in the telephoto image and coordinates of each feature point in the short-focus image, and based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain a feature alignment result.

[0012] In a possible implementation, based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image, including:

[0013] The intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens are obtained; for each feature point in the short-focus image, based on the intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens, the coordinates of the feature point in the pixel coordinate system of the short-focus image are converted into coordinates in the pixel coordinate system of the telephoto image; based on the coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image and the coordinates of each feature point in the telephoto image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image.

[0014] Through the above technical scheme, a technical scheme for feature alignment of feature points in a telephoto image and feature points in a short-focus image is provided, that is, based on the internal parameters of the telephoto lens and the short-focus lens, the transformation matrix between the telephoto lens and the short-focus lens, and the coordinates of the feature points in the short-focus image and the coordinates of the feature points in the telephoto image, feature alignment can be performed on the feature points in the telephoto image and the feature points in the short-focus image, so that subsequent image fusion can be performed based on the telephoto image and the short-focus image after feature alignment, thereby enhancing the image fusion effect.

[0015] In a possible implementation, based on the feature alignment result, feature fusion is performed on the long focus image and the short focus image to obtain a fused feature map, including:

[0016] When the feature alignment result indicates that the first feature point in the short-focus image and the second feature point in the long-focus image are aligned, feature fusion is performed on at least one feature point adjacent to the second feature point in the long-focus image and at least one feature point adjacent to the first feature point in the short-focus image to obtain a fused feature map.

[0017] The first feature point is any feature point in the short-focus image, the second feature point is any feature point in the long-focus image, and the coordinates of the first feature point and the second feature point in the pixel coordinate system of the long-focus image are the same.

[0018] Through the above technical solution, a technical solution for feature fusion of the long-focus image and the short-focus image after feature alignment is provided, which can enhance the feasibility of the present application.

[0019] In a possible implementation, the method further includes:

[0020] The feature extraction network is used to extract features of the long-focus image and the short-focus image respectively, so as to obtain feature points in the long-focus image and feature points in the short-focus image.

[0021] In a possible embodiment, the feature extraction network includes a first feature extraction network and a second feature extraction network, the first feature extraction network is used to extract feature points of each feature map from feature maps of different sizes corresponding to the telephoto image, and to extract feature points of each feature map from feature maps of different sizes corresponding to the short-focus image, and the second feature extraction network is used to fuse feature points of feature maps of different sizes corresponding to the telephoto image, and to fuse feature points of feature maps of different sizes corresponding to the short-focus image.

[0022] On this basis, the long-focus image and the short-focus image are respectively extracted through the feature extraction network to obtain the feature points in the long-focus image and the feature points in the short-focus image, including:

[0023] The telephoto image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and the short-focus image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the short-focus image; the feature points of feature maps of different sizes corresponding to the telephoto image are input into the second feature extraction network to obtain feature points in the telephoto image, and the feature points of feature maps of different sizes corresponding to the short-focus image are input into the second feature extraction network to obtain feature points in the short-focus image.

[0024] Through the above technical solution, the telephoto image and the short-focus image can be scaled to different sizes to obtain feature maps of different sizes, and then the feature points in the feature maps of different sizes can be fused to obtain richer feature points in the telephoto image and the short-focus image, so that subsequent image alignment and image fusion based on the feature points in the telephoto image and the short-focus image can be more accurate, thereby further enhancing the image fusion effect of the telephoto image and the short-focus image.

[0025] In a possible implementation, based on the feature alignment result, feature fusion is performed on the long focus image and the short focus image to obtain a fused feature map, including:

[0026] Based on the feature alignment result, the feature points in the telephoto image and the feature points in the short-focus image are spliced ​​to obtain spliced ​​feature points. Based on the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image, the spliced ​​feature points are position-encoded to obtain position-encoded feature points. Based on the position-encoded feature points and the spliced ​​feature points, the telephoto image and the short-focus image are feature fused to obtain a fused feature map.

[0027] Through the above technical solution, in the process of feature fusion of the telephoto image and the short-focus image after feature alignment, the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image can also be combined to improve the accuracy of the fusion of the telephoto image and the short-focus image.

[0028] In a possible implementation, the electronic device is a vehicle-mounted device.

[0029] According to a second aspect provided by the present application, a position detection device is provided, the device comprising: an alignment unit, a fusion unit and a detection unit, wherein:

[0030] The alignment unit is used to perform feature alignment on feature points in the telephoto image output by the telephoto lens and feature points in the short-focus image output by the short-focus lens to obtain a feature alignment result.

[0031] The fusion unit is used to perform feature fusion on the long-focus image and the short-focus image based on the feature alignment result to obtain a fused feature map.

[0032] The detection unit is used to detect the fused feature map to obtain the position of at least one target object in the target scene.

[0033] In a possible implementation manner, the alignment unit is specifically used to:

[0034] The coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image are obtained, and based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain a feature alignment result.

[0035] In a possible implementation manner, the alignment unit is specifically used to:

[0036] The intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens are obtained; for each feature point in the short-focus image, based on the intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens, the coordinates of the feature point in the pixel coordinate system of the short-focus image are converted into coordinates in the pixel coordinate system of the telephoto image; based on the coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image and the coordinates of each feature point in the telephoto image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image.

[0037] In a possible implementation manner, the fusion unit is specifically used for:

[0038] When the feature alignment result indicates that the first feature point in the short-focus image and the second feature point in the long-focus image are aligned, feature fusion is performed on at least one feature point adjacent to the second feature point in the long-focus image and at least one feature point adjacent to the first feature point in the short-focus image to obtain a fused feature map.

[0039] The first feature point is any feature point in the short-focus image, the second feature point is any feature point in the long-focus image, and the coordinates of the first feature point and the second feature point in the pixel coordinate system of the long-focus image are the same.

[0040] In a possible implementation, the device further includes an extraction unit, and the extraction unit is specifically used for:

[0041] The feature extraction network is used to extract features of the long-focus image and the short-focus image respectively, so as to obtain feature points in the long-focus image and feature points in the short-focus image.

[0042] In a possible implementation, the feature extraction network includes a first feature extraction network and a second feature extraction network, the first feature extraction network is used to extract feature points of each feature map from feature maps of different sizes corresponding to the telephoto image, and extract feature points of each feature map from feature maps of different sizes corresponding to the short-focus image, and the second feature extraction network is used to fuse feature points of feature maps of different sizes corresponding to the telephoto image, and fuse feature points of feature maps of different sizes corresponding to the short-focus image. On this basis, the extraction unit is specifically used to:

[0043] The telephoto image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and the short-focus image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the short-focus image; the feature points of feature maps of different sizes corresponding to the telephoto image are input into the second feature extraction network to obtain feature points in the telephoto image, and the feature points of feature maps of different sizes corresponding to the short-focus image are input into the second feature extraction network to obtain feature points in the short-focus image.

[0044] In a possible implementation manner, the fusion unit is specifically used for:

[0045] Based on the feature alignment result, the feature points in the telephoto image and the feature points in the short-focus image are spliced ​​to obtain spliced ​​feature points. Based on the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image, the spliced ​​feature points are position-encoded to obtain position-encoded feature points. Based on the position-encoded feature points and the spliced ​​feature points, the telephoto image and the short-focus image are feature fused to obtain a fused feature map.

[0046] In a possible implementation, the electronic device is a vehicle-mounted device.

[0047] According to a third aspect provided by the present application, a vehicle is provided, comprising: an electronic device for implementing the above-mentioned first aspect and any possible implementation manner thereof.

[0048] According to the fourth aspect provided by the present application, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the position detection method in the above-mentioned first aspect and any possible implementation manner thereof.

[0049] According to the fifth aspect provided by the present application, a computer program product is provided, the computer program product comprising computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the position detection method of the first aspect and any possible implementation manner thereof.

[0050] Therefore, the above technical features of the present application have the following beneficial effects:

[0051] (1) Aligning the feature points in the telephoto image and the feature points in the short-focus image can solve the problem of serious feature deviation caused by the difference in the field of view of the long and short focus lenses, and enhance the effect of fusing the telephoto image and the short focus image. In addition, in the above technical solution, no additional similarity or intersection-over-union calculation is required, so the chip load will not be increased. In summary, the embodiments of the present application can enhance the effect of fusing the telephoto image and the short focus image. In addition, after the fused feature map is detected, the position of at least one target object in the target scene can be obtained without performing a post-fusion step, thereby effectively improving the detection efficiency.

[0052] (2) Based on the internal parameters of the telephoto lens and the short-focus lens, the transformation matrix between the telephoto lens and the short-focus lens, and the coordinates of the feature points in the short-focus image and the coordinates of the feature points in the telephoto image, feature alignment can be performed on the feature points in the telephoto image and the feature points in the short-focus image, so that image fusion can be performed based on the telephoto image and the short-focus image after feature alignment, thereby enhancing the image fusion effect.

[0053] (3) A technical solution for feature fusion of the long-focus image and the short-focus image after feature alignment is provided, which can enhance the feasibility of the present application.

[0054] (4) The telephoto image and the short-focus image can be first scaled to different sizes to obtain feature maps of different sizes, and then the feature points in the feature maps of different sizes can be fused to obtain richer feature points in the telephoto image and the short-focus image. This can make subsequent image alignment and image fusion based on the feature points in the telephoto image and the short-focus image more accurate, thereby further enhancing the image fusion effect of the telephoto image and the short-focus image.

[0055] (5) In the process of feature fusion of the telephoto image and the short-focus image after feature alignment, the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image can also be combined to improve the accuracy of the fusion of the telephoto image and the short-focus image.

[0056] It should be noted that the technical effects brought about by any implementation method in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here.

[0057] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.

[0059] Figure 1 is a flow chart of a position detection method according to an exemplary embodiment;

[0060] Figure 2 is a schematic diagram showing the fusion of a long-focus image and a short-focus image according to an exemplary embodiment;

[0061] Figure 3 is a structural block diagram of a normalization process and a residual process according to an exemplary embodiment;

[0062] Figure 4 is a flowchart of a model training according to an exemplary embodiment;

[0063] Figure 5 is a block diagram of a position detection device according to an exemplary embodiment;

[0064] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0065] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0066] It should be noted that the terms "first", "second", etc. 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. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0067] With the development of technology in the field of vision, the improvement of the performance of chip lens industrial cameras, the vigorous development and application of new energy and artificial intelligence, the overall engineering application demand for multi-camera collaboration has become more urgent. Therefore, there are more and more industrial or intelligent business scenarios where long-focus and short-focus cameras collaborate to collect data. Therefore, the application of long (narrow-angle) and short (wide-angle) focus cameras has also emerged.

[0068] In the process of intelligent driving, the image output by the short-focus lens can provide good perception results for objects at close distances (e.g., less than 100 meters). However, due to the limitation of focal length, the pixel length and width of the image output by the short-focus lens for objects greater than 100 meters are not enough to support the accurate prediction of the prediction model. For example, when an object with a width of 2 meters is at a long distance of 100 meters, its pixel width in the image output by the short-focus lens is 40 pixels. Since directly inputting the original image will greatly increase the amount of calculation of the model, the image needs to be scaled 4 times before inputting it into the prediction model, so that the actual pixel width of the object in the image input to the model is about 10 pixels. Most of the current prediction models are deep learning network models, and most of the deep learning network models will downsample 32 times in the feature extraction stage, making it difficult to recall a 10-pixel target. Therefore, most current solutions will add a telephoto lens to assist in the detection of distant objects.

[0069] In the process of using a telephoto camera to assist in the detection of distant objects, it is necessary to fuse the telephoto image and the short-focus image output by the telephoto camera so as to detect the category or location information of the target object based on the fused image. Currently, the following methods can be used to fuse the telephoto image and the short-focus image:

[0070] Method 1: First, obtain the telephoto and short-focus images taken by the telephoto and short-focus cameras at the same time, and obtain the first perception frame of the target in the telephoto image and the second perception frame of the target in the short-focus image through target detection. Then, perform similarity calculation on the telephoto and short-focus images, and obtain the common field of view of the telephoto and short-focus cameras in the short-focus image. If the second perception frame of the target is within the common field of view, map the first perception frame of the target to the short-focus image, perform IOU calculation, obtain the maximum intersection-over-union (IoU) perception frame, and finally complete target fusion based on the information of the first perception frame and the maximum intersection-over-union (IoU) perception frame, and output the fused target frame information.

[0071] Method 2: Extract the features of the left and right images through a deep learning network, and then use the feature stitching method to fuse the feature information of the left and right images.

[0072] In the above method 1, the process of calculating the similarity between the long-focus image and the short-focus image is a relatively time-consuming operation, which will increase the load of the vehicle chip. In the above method 2, the features of the two cameras are directly spliced, which will cause serious deviation of the features when the fields of view of the two cameras are very different, and is not suitable for use with a combination of long-focus and short-focus cameras.

[0073] Therefore, how to enhance the fusion effect of the long-focus image and the short-focus image while reducing the chip load has become an urgent problem to be solved.

[0074] In order to solve the technical problems in the prior art, an embodiment of the present application provides a position detection method, which can first perform feature alignment on feature points in a telephoto image output by a telephoto lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result, and based on the feature alignment result, perform feature fusion on the telephoto image and the short-focus image to obtain a fused feature map, and detect the fused feature map to obtain the position of at least one target object in the target scene.

[0075] Among them, the long-focus image and the short-focus image are obtained by shooting the target scene at the same time, and the fused feature map is used to detect the position of at least one target object in the target scene. The fused feature map contains multiple feature points; the fused feature map and the short-focus image have the same size.

[0076] By aligning the feature points in the telephoto image and the feature points in the short-focus image through the above technical solution, the problem of serious feature deviation caused by the difference in the field of view of the long-focus lens and the short-focus lens can be solved, and the effect of fusing the telephoto image and the short-focus image can be enhanced. In addition, in the above technical solution, no additional similarity or intersection-over-union calculation is required, so the chip load will not be increased. In summary, the embodiment of the present application can enhance the effect of fusing the telephoto image and the short-focus image.

[0077] In addition, after detecting the fused feature map, the present solution can obtain the position of at least one target object in the target scene without performing a post-fusion step, thereby effectively improving the detection efficiency.

[0078] It should be noted that the position detection method provided in the embodiment of the present application can be performed by an electronic device equipped with a telephoto lens and a short focal lens, such as a vehicle-mounted device equipped with a telephoto lens and a short focal lens. The following takes a vehicle-mounted device as an example to describe the position detection method provided in the embodiment of the present application in detail.

[0079] Figure 1 is a flow chart of a position detection method according to an exemplary embodiment. Figure 1 As shown, the position detection method includes the following steps:

[0080] S101, performing feature alignment on feature points in a long-focus image output by a long-focus lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result.

[0081] In an optional embodiment, after obtaining the telephoto image output by the telephoto lens and the short-focus image output by the short-focus lens, the vehicle-mounted device can obtain the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, and based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, perform feature alignment on the telephoto image and the short-focus image to obtain a feature alignment result.

[0082] In the embodiment of the present application, the type of coordinates of each feature point is not limited. For example, the coordinates of each feature point can be the image coordinates of the feature point or the pixel coordinates of the feature point. The following description takes the coordinates of each feature point as pixel coordinates as an example.

[0083] Specifically, after obtaining the pixel coordinates of each feature point in the telephoto image and the pixel coordinates of each feature point in the short-focus image, the vehicle-mounted device can obtain the internal parameters of the telephoto lens, the internal parameters of the short-focus lens, and the conversion matrix between the telephoto lens and the short-focus lens. Afterwards, the vehicle-mounted device can use the following formula 1 to convert the pixel coordinates of each feature point in the short-focus image in the pixel coordinate system of the short-focus image into the pixel coordinates of the feature point in the pixel coordinate system of the telephoto image based on the internal parameters of the telephoto lens, the internal parameters of the short-focus lens, and the conversion matrix between the telephoto lens and the short-focus lens.

[0084]

[0085] Among them, xy l Represents the pixel coordinates in the pixel coordinate system of the telephoto image, xy o represents the pixel coordinates in the pixel coordinate system of the short-focus image, K l represents the internal parameter of the telephoto lens, T represents the transformation matrix between the telephoto lens and the short-focus lens, and K0 represents the internal parameter of the short-focus lens.

[0086] After obtaining the pixel coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image in the above manner, the vehicle-mounted equipment can perform feature alignment on the telephoto image and the short-focus image based on the pixel coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image and the coordinates of each feature point in the telephoto image to obtain a feature alignment result.

[0087] Specifically, when performing feature alignment on the telephoto image and the short-focus image based on the pixel coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image, and the pixel coordinates of each feature point in the telephoto image, the vehicle-mounted device may take each feature point in the short-focus image as a first feature point in turn, and when the pixel coordinates of the first feature point in the pixel coordinate system of the telephoto image are the same as the pixel coordinates of the second feature point in the telephoto image, the vehicle-mounted device may align the first feature point with the second feature point.

[0088] The second feature point is any feature point in the telephoto image.

[0089] For example, assuming that the pixel coordinates of feature point A in the short-focus image in the pixel coordinate system of the telephoto image are the same as the pixel coordinates of feature point B in the telephoto image, the vehicle-mounted device can align feature point A in the short-focus image with feature point B in the telephoto image.

[0090] S102, based on the feature alignment result, feature fusion is performed on the long-focus image and the short-focus image to obtain a fused feature map.

[0091] In an optional embodiment, the vehicle-mounted device can perform feature fusion on at least one feature point adjacent to the second feature point in the telephoto image and at least one feature point adjacent to the first feature point in the short-focus image when the feature alignment result indicates that the first feature point in the short-focus image and the second feature point in the telephoto image are aligned to obtain a fused feature map.

[0092] The first feature point is any feature point in the short-focus image, the second feature point is any feature point in the long-focus image, and the coordinates of the first feature point and the second feature point in the pixel coordinate system of the long-focus image are the same.

[0093] Specifically, after obtaining the feature alignment result through S101, the vehicle-mounted device can input the telephoto image and the short-focus image into a pre-trained image fusion network to take each feature point in the short-focus image as the first feature point in turn, and determine whether the telephoto image contains a second feature point aligned with the first feature point. If it is contained, the vehicle-mounted device can feature fuse at least one feature point adjacent to the second feature point in the telephoto image and at least one feature point adjacent to the first feature point in the short-focus image to obtain a feature point after the first feature point and the second feature point are fused. If not contained, the vehicle-mounted device can feature fuse at least one feature point adjacent to the first feature point in the short-focus image with multiple feature points set to 0, and finally the feature point after the first feature point is fused to obtain a fused feature map.

[0094] In the embodiment of the present application, there is no limitation on the number of at least one feature point adjacent to the second feature point and the number of at least one feature point adjacent to the first feature point. For example, the number of at least one feature point adjacent to the second feature point and the number of at least one feature point adjacent to the first feature point may be the same or different.

[0095] In the embodiment of the present application, there is no limitation on the number of at least one feature point adjacent to the first feature point and the number of multiple feature points set to 0. For example, the number of at least one feature point adjacent to the first feature point and the number of multiple feature points set to 0 may be the same or different.

[0096] Exemplarily, in one embodiment, assuming that the short-focus image contains feature point A and feature point C, and the pixel coordinates of feature point A in the pixel coordinate system of the telephoto image are consistent with the pixel coordinates of feature point B in the telephoto image, and the telephoto image does not contain a feature point aligned with feature point C, that is, feature point B is a second feature point contained in the telephoto image and aligned with feature point A in the short-focus image, the vehicle-mounted device can feature fuse at least one feature point adjacent to the short-focus image and feature point A with at least one feature point adjacent to the telephoto image and feature point B, and feature fuse at least one feature point adjacent to the short-focus image and feature point C with multiple feature points set to 0 to obtain a fused feature map.

[0097] S103, detecting the fused feature map to obtain the position of at least one target object in the target scene.

[0098] After obtaining the fused feature map, the fused feature map can be input into a preset detection model to obtain the position of at least one target object in the target scene.

[0099] The above detection model may be a detection head, such as the detection head in yolov8, and the detection head may use a non-anchor frame algorithm.

[0100] Through the above technical solution, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image, which can solve the problem of serious feature deviation caused by the difference in the field of view of the long and short focus lenses, and enhance the effect of fusing the telephoto image and the short focus image. In addition, in the above technical solution, no additional similarity or intersection-over-union calculation is required, so the chip load will not be increased. In summary, the embodiments of the present application can enhance the effect of fusing the telephoto image and the short-focus image. In addition, after detecting the fused feature map, the present solution can obtain the position of at least one target object in the target scene without performing a post-fusion step, so the detection efficiency can be effectively improved.

[0101] In an optional implementation, before executing S102, the vehicle-mounted device may further perform feature extraction on the long-focus image and the short-focus image respectively through a feature extraction network to obtain feature points in the long-focus image and feature points in the short-focus image.

[0102] Specifically, after acquiring the telephoto image and the short-focus image, the vehicle-mounted device can input the telephoto image and the short-focus image into a pre-trained feature extraction network respectively to extract features from the telephoto image and the short-focus image to obtain feature points in the telephoto image and feature points in the short-focus image.

[0103] In an optional embodiment, the feature extraction network may include a first feature extraction network and a second feature extraction network, and the first feature extraction network is used to extract feature points of each feature map from feature maps of different sizes corresponding to the telephoto image, and extract feature points of each feature map from feature maps of different sizes corresponding to the short-focus image, and the second feature extraction network is used to fuse feature points of feature maps of different sizes corresponding to the telephoto image, and fuse feature points of feature maps of different sizes corresponding to the short-focus image.

[0104] On this basis, in the process of extracting features from the telephoto image and the short-focus image respectively through the feature extraction network, the vehicle-mounted equipment can input the telephoto image into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and input the short-focus image into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the short-focus image, and then input the feature points of the feature maps of different sizes corresponding to the telephoto image into the second feature extraction network to obtain feature points in the telephoto image, and input the feature points of the feature maps of different sizes corresponding to the short-focus image into the second feature extraction network to obtain feature points in the short-focus image.

[0105] In an embodiment of the present application, the feature extraction network (including a first feature extraction network and a second feature extraction network) used to extract features of a telephoto image, and the feature extraction network used to extract features of a short-focus image may be the same network or different networks.

[0106] When the feature extraction network used for feature extraction of telephoto images and the feature extraction network used for feature extraction of short-focus images are different network models, the network type of the feature extraction network used for feature extraction of telephoto images and the network type of the feature extraction network used for feature extraction of short-focus images may be the same or different.

[0107] The following description takes as an example a feature extraction network for extracting features from a telephoto image as feature extraction network A, and a feature extraction network for extracting features from a short-focus image as feature extraction network B.

[0108] Specifically, Figure 2 As shown, after obtaining the telephoto image and the short-focus image, the vehicle-mounted device can input the telephoto image into the first feature extraction network 201 of the feature extraction network A to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and input the feature points of feature maps of different sizes corresponding to the telephoto image into the second feature extraction network 202 of the feature extraction network A to fuse the feature points of feature maps of different sizes corresponding to the telephoto image to obtain feature points in the telephoto image. At the same time, the vehicle-mounted device can input the short-focus image into the first feature extraction network 203 of the feature extraction network B to obtain feature points of feature maps of different sizes corresponding to the short-focus image, and input the feature points of feature maps of different sizes corresponding to the short-focus image into the second feature extraction network 204 of the feature extraction network B to fuse the feature points of feature maps of different sizes corresponding to the short-focus image to obtain feature points in the short-focus image.

[0109] Continue to see Figure 2 After obtaining the feature points in the telephoto image and the feature points in the short-focus image in the above manner, the feature points in the telephoto image and the feature points in the short-focus image can be feature aligned in the above feature alignment manner to obtain a feature alignment result, and then based on the feature alignment result, feature fusion is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain a fused feature map.

[0110] Optionally, in order to ensure that the data distribution and feature dimensions of the feature points in the telephoto image and the feature points in the short-focus image are as consistent as possible, the feature extraction network used to extract features from the telephoto image is feature extraction network A, and the feature extraction network used to extract features from the short-focus image is feature extraction network B, and the number of fully connected layers, convolution kernels, etc. should be consistent.

[0111] In an optional implementation, the position information of the telephoto lens and the short-focus lens may be introduced in the process of executing S102. Specifically, the vehicle-mounted device may splice the feature points in the telephoto image and the feature points in the short-focus image based on the feature alignment result to obtain spliced ​​feature points, and then position encode the spliced ​​feature points based on the position information of the feature points in the telephoto image in the telephoto image and the position information of the feature points in the short-focus image in the short-focus image to obtain position-encoded feature points, and then perform feature fusion on the feature points in the telephoto image and the feature points in the short-focus image based on the position-encoded feature points and the spliced ​​feature points to obtain a fused feature map.

[0112] Specifically, the vehicle-mounted device may first determine the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image by using the following formulas 2 and 3.

[0113]

[0114]

[0115] Among them, PE(pos,2i) represents the position information of the 2i-th feature point, PE(pos,2i+1) represents the position information of the 2i+1-th feature point, d represents the width of the telephoto image or the short-focus image, and i represents the i-th feature point.

[0116] After determining the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image in the short-focus image by the above formula, the vehicle-mounted equipment can splice each pair of aligned feature points in the telephoto image and the short-focus image to obtain spliced ​​feature points, and then position encode the spliced ​​feature points according to the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image to obtain position-encoded feature points. Finally, based on the position-encoded feature points and the spliced ​​feature points, feature fusion of the feature points in the telephoto image and the feature points in the short-focus image is achieved by the following formula 4 to obtain a fused feature map.

[0117]

[0118] Among them, Attention(Q,K,V) represents the fused feature points, Q and K represent the feature points after position encoding, V represents the spliced ​​feature points, and d k Represents the feature dimension of the target feature point.

[0119] Optionally, after obtaining the fused feature points in the above manner, such as Figure 3 As shown, the fused feature points can also be input into the ADD&Norm layer for feature normalization and residual processing. Specifically, the fused feature points can be first subjected to feature normalization to obtain normalized feature points, and residual processing can be performed on the normalized feature points and the fused feature points to obtain residual feature points, so as to change the data distribution to a state suitable for training without affecting the semantics of data expression.

[0120] Specifically, when the fused feature points are subjected to feature normalization, a LayerNormalization method may be used. Specifically, the normalized feature points may be obtained by the following formula 5.

[0121]

[0122] Among them, E(x), Var(x) represent the mean and variance of the fused feature points, ε is a very small data to prevent the divisor from being 0, and γ and β control the scaling ratio and offset of the sample distribution respectively.

[0123] After the above normalization and residual processing, the fully connected network (FFN) layer can be used to further linearly transform the feature points after residual processing to map the feature points after residual processing to a high-dimensional space for feature activation and screening. After that, the on-board equipment can also use the ADD&Norm layer to restore the feature dimensions of the feature points after residual processing to the feature dimensions before input.

[0124] The above process of performing feature normalization and residual processing on the fused feature points belongs to the execution process of the encoding layer of the feature fusion network. The specific implementation method can refer to the description in the relevant technology and will not be repeated here.

[0125] In addition, the execution process of the decoding layer of the feature fusion network can also refer to the description in the relevant technology, which will not be repeated here.

[0126] In the embodiment of the present application, when executing Figure 1 Before the position detection method shown in the figure, the feature extraction network, feature fusion network and detection model can also be trained. Specifically, Figure 4 As shown, the process of training the feature extraction network, feature fusion network and detection model may include Figure 4 The four stages shown are training data collection, model building, model training, and model quantization deployment. The following will explain the above four stages respectively.

[0127] Training data collection phase

[0128] The collected training data may include multiple image pairs, each image pair includes a telephoto image and a short-focus image taken at the same time by a telephoto lens and a short-focus lens for the same scene. In addition, the telephoto image and the short-focus image of each image pair should be annotated with multiple objects in the scene corresponding to the image pair, such as: cars, cyclists, pedestrians, traffic lights, traffic signs, road cones and road markings, etc.

[0129] Optionally, in order to ensure the robustness of the model, the collected training data can include data in different scenarios (such as highways, urban areas), different times (such as daytime, nighttime), and different weather conditions (such as rainy days, sunny days).

[0130] Optionally, in order to accelerate the convergence speed of the subsequent network, the training data in the present application may be image data in the ImageNet dataset.

[0131] Model building phase

[0132] In the embodiment of the present application, there is no limitation on the first feature extraction network and the second feature extraction network. For example, the first feature extraction network can be a scale invariant feature transform (SIFT) network or a histogram of oriented gradient (HOG) network, and the second feature extraction network can be a feature pyramid network or a single shot detector (SSD).

[0133] In an embodiment of the present application, the feature fusion network may be a self-attention network, and the detection model may be a detection head, such as the detection head in yolov8.

[0134] Model training phase

[0135] After the training data is collected and the model is constructed, the constructed model can be optimized and trained using the training data until the loss function shown in the following formula 6 is fully converged.

[0136]

[0137] in, is the GIoU loss function, which is used to supervise the quality of the target box output by the model. Its calculation method is as follows:

[0138]

[0139] Among them, mask ij Indicates whether the feature point is within the gt box. For feature points within the gt box, the mask will be set to 1, and the rest will be set to 0. It represents the overlap of two gt boxes. When they completely overlap, IoU is 1, and when they do not overlap at all, IoU is 0.

[0140] is the center loss function, which is calculated as follows:

[0141]

[0142] Among them, p(x) is the model prediction value, q(x) is calculated from the gt box, l, r, t, b are the pixel distances from the feature point to the left, right, top, and bottom of the gt box respectively.

[0143] is a classification loss function used to supervise the classification accuracy of the target. Its calculation method is the same as above, where q(x) is the one-hot vector of the target category.

[0144] Model quantization and deployment phase

[0145] Specifically, after the model is optimized and trained in the above manner, quantization and dequantization nodes can be added to perform quantization training on the model to ensure the quantization accuracy of the model.

[0146] In addition, after the model is quantized and trained, it can be deployed on a real vehicle so that the model can obtain the position of each object within the vehicle's forward viewing range based on the long-focus image and short-focus image output by the long- and short-focus lenses.

[0147] Optionally, before optimizing and training the model, the parameters of the normalization layer of the network may be fine-tuned.

[0148] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the position detection device or electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0149] The embodiments of the present application can exemplarily divide the functional modules of the position detection device or the electronic device according to the above method. For example, the position detection device or the electronic device may include various functional modules corresponding to the various functional divisions, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0150] Figure 5 is a block diagram of a position detection device 500 according to an exemplary embodiment. Figure 5 , the position detection device 500 comprises:

[0151] The alignment unit 501 is used to perform feature alignment on feature points in the telephoto image output by the telephoto lens and feature points in the short-focus image output by the short-focus lens to obtain a feature alignment result.

[0152] The fusion unit 502 is used to perform feature fusion on the long-focus image and the short-focus image based on the feature alignment result to obtain a fused feature map.

[0153] The detection unit 503 is used to detect the fused feature map to obtain the position of at least one target object in the target scene.

[0154] In a possible implementation manner, the alignment unit 501 is specifically configured to:

[0155] The coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image are obtained, and based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain a feature alignment result.

[0156] In a possible implementation manner, the alignment unit 501 is specifically configured to:

[0157] The intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens are obtained; for each feature point in the short-focus image, based on the intrinsic parameters of the telephoto lens, the intrinsic parameters of the short-focus lens, and the transformation matrix between the telephoto lens and the short-focus lens, the coordinates of the feature point in the pixel coordinate system of the short-focus image are converted into coordinates in the pixel coordinate system of the telephoto image; based on the coordinates of each feature point in the short-focus image in the pixel coordinate system of the telephoto image and the coordinates of each feature point in the telephoto image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image.

[0158] In a possible implementation manner, the fusion unit 502 is specifically configured to:

[0159] When the feature alignment result indicates that the first feature point in the short-focus image and the second feature point in the long-focus image are aligned, feature fusion is performed on at least one feature point adjacent to the second feature point in the long-focus image and at least one feature point adjacent to the first feature point in the short-focus image to obtain a fused feature map.

[0160] The first feature point is any feature point in the short-focus image, the second feature point is any feature point in the long-focus image, and the coordinates of the first feature point and the second feature point in the pixel coordinate system of the long-focus image are the same.

[0161] In a possible implementation, the device further includes an extraction unit, and the extraction unit is specifically used for:

[0162] The feature extraction network is used to extract features of the long-focus image and the short-focus image respectively, so as to obtain feature points in the long-focus image and feature points in the short-focus image.

[0163] In a possible implementation, the feature extraction network includes a first feature extraction network and a second feature extraction network, the first feature extraction network is used to extract feature points of each feature map from feature maps of different sizes corresponding to the telephoto image, and extract feature points of each feature map from feature maps of different sizes corresponding to the short-focus image, and the second feature extraction network is used to fuse feature points of feature maps of different sizes corresponding to the telephoto image, and fuse feature points of feature maps of different sizes corresponding to the short-focus image. On this basis, the extraction unit is specifically used to:

[0164] The telephoto image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and the short-focus image is input into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the short-focus image; the feature points of feature maps of different sizes corresponding to the telephoto image are input into the second feature extraction network to obtain feature points in the telephoto image, and the feature points of feature maps of different sizes corresponding to the short-focus image are input into the second feature extraction network to obtain feature points in the short-focus image.

[0165] In a possible implementation manner, the fusion unit 502 is specifically configured to:

[0166] Based on the feature alignment result, the feature points in the telephoto image and the feature points in the short-focus image are spliced ​​to obtain spliced ​​feature points. Based on the position information of the feature points in the telephoto image in the telephoto image and the position information of the feature points in the short-focus image in the short-focus image, the spliced ​​feature points are position-encoded to obtain position-encoded feature points. Based on the position-encoded feature points and the spliced ​​feature points, feature fusion is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain a fused feature map.

[0167] In a possible implementation, the electronic device is a vehicle-mounted device.

[0168] In the position detection device provided in the embodiment of the present application, the feature alignment of the telephoto image and the short-focus image can solve the problem of serious feature deviation caused by the difference in the field of view of the long-focus lens and the short-focus lens, and enhance the effect of fusing the telephoto image and the short-focus image. In addition, in the above technical solution, no additional similarity or intersection-over-union calculation is required, so the chip load will not be increased. In summary, the embodiment of the present application can enhance the effect of fusing the telephoto image and the short-focus image.

[0169] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0170] Figure 6FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Figure 6 As shown, the electronic device 600 includes but is not limited to: a processor 601 and a memory 602 .

[0171] The memory 602 is used to store executable instructions of the processor 601. It can be understood that the processor 601 is configured to execute instructions to implement the position detection method in the above embodiment.

[0172] It should be noted that those skilled in the art can understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include Figure 6 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0173] The processor 601 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 601 may include one or more processing units. Optionally, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.

[0174] The memory 602 may be used to store software programs and various data. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0175] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 602 including instructions, and the above instructions can be executed by a processor 601 of an electronic device 600 to implement the method in the above embodiment.

[0176] In actual implementation, Figure 5 The alignment unit 501, the fusion unit 502 and the detection unit 503 in the embodiment can all be composed of Figure 6 The processor 601 in the embodiment calls the computer program stored in the memory 602. The specific execution process can refer to the description of the method part in the above embodiment, which will not be repeated here.

[0177] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0178] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 601 of the electronic device to complete the method in the above embodiment.

[0179] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the electronic device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.

[0180] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0181] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0182] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0183] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0184] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.

[0185] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A position detection method, characterized in that: Applied to an electronic device, the electronic device is equipped with a telephoto lens and a short-focus lens, and the method comprises: Performing feature alignment on feature points in a telephoto image output by a telephoto lens and feature points in a short-focus image output by a short-focus lens to obtain a feature alignment result; the telephoto image and the short-focus image are obtained by photographing a target scene at the same time; Based on the feature alignment result, feature fusion is performed on the long-focus image and the short-focus image to obtain a fused feature map; the fused feature map is used to detect the position of at least one target object in the target scene; the fused feature map contains multiple feature points; the fused feature map has the same size as the short-focus image; The fused feature map is detected to obtain the position of at least one target object in the target scene.

2. The method according to claim 1, characterized in that The step of performing feature alignment on the feature points in the telephoto image output by the telephoto lens and the feature points in the short-focus image output by the short-focus lens to obtain a feature alignment result includes: Acquire the coordinates of each feature point in the long-focus image and the coordinates of each feature point in the short-focus image; Based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image, feature alignment is performed on the feature points in the telephoto image and the feature points in the short-focus image to obtain the feature alignment result.

3. The method according to claim 2, characterized in that The step of aligning the feature points in the telephoto image and the feature points in the short-focus image based on the coordinates of each feature point in the telephoto image and the coordinates of each feature point in the short-focus image comprises: Acquire the internal parameters of the telephoto lens, the internal parameters of the short-focus lens, and the conversion matrix between the telephoto lens and the short-focus lens; For each feature point in the short-focus image, based on an intrinsic parameter of the telephoto lens, an intrinsic parameter of the short-focus lens, and a transformation matrix between the telephoto lens and the short-focus lens, converting the coordinates of the feature point in the pixel coordinate system of the short-focus image into the coordinates in the pixel coordinate system of the telephoto image; Based on the coordinates of each feature point in the short-focus image in the pixel coordinate system of the long-focus image and the coordinates of each feature point in the long-focus image, feature alignment is performed on the feature points in the long-focus image and the feature points in the short-focus image.

4. The method according to claim 1, characterized in that: The step of performing feature fusion on the long focus image and the short focus image based on the feature alignment result to obtain a fused feature map includes: When the feature alignment result indicates that the first feature point in the short-focus image and the second feature point in the telephoto image are aligned, feature fusion is performed on at least one feature point adjacent to the second feature point in the telephoto image and at least one feature point adjacent to the first feature point in the short-focus image to obtain the fused feature map; the first feature point is any feature point in the short-focus image; the second feature point is any feature point in the telephoto image; the first feature point and the second feature point have the same coordinates in the pixel coordinate system of the telephoto image.

5. The method according to claim 1, characterized in that The method further comprises: The long-focus image and the short-focus image are respectively subjected to feature extraction through a feature extraction network to obtain feature points in the long-focus image and feature points in the short-focus image.

6. The method according to claim 5, characterized in that The feature extraction network includes a first feature extraction network and a second feature extraction network; the first feature extraction network is used to extract feature points of each feature map from feature maps of different sizes corresponding to the telephoto image, and to extract feature points of each feature map from feature maps of different sizes corresponding to the short-focus image; the second feature extraction network is used to fuse feature points of feature maps of different sizes corresponding to the telephoto image, and to fuse feature points of feature maps of different sizes corresponding to the short-focus image; The extracting features of the long-focus image and the short-focus image respectively through a feature extraction network to obtain feature points in the long-focus image and feature points in the short-focus image includes: Inputting the telephoto image into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the telephoto image, and inputting the short-focus image into the first feature extraction network to obtain feature points of feature maps of different sizes corresponding to the short-focus image; The feature points of the feature maps of different sizes corresponding to the telephoto image are input into the second feature extraction network to obtain the feature points in the telephoto image, and the feature points of the feature maps of different sizes corresponding to the short-focus image are input into the second feature extraction network to obtain the feature points in the short-focus image.

7. The method according to claim 1, characterized in that The step of performing feature fusion on the long focus image and the short focus image based on the feature alignment result to obtain a fused feature map includes: Based on the feature alignment result, the feature points in the long-focus image and the feature points in the short-focus image are spliced ​​to obtain spliced ​​feature points; Based on the position information of the feature points in the telephoto image and the position information of the feature points in the short-focus image, position-encoding the spliced ​​feature points to obtain the position-encoded feature points; Based on the position-encoded feature points and the spliced ​​feature points, feature fusion is performed on the long-focus image and the short-focus image to obtain a fused feature map.

8. The method according to claim 1, characterized in that The electronic device is a vehicle-mounted device.

9. A position detection device, characterized in that: The device comprises: an alignment unit, a fusion unit and a detection unit, wherein: The alignment unit is used to perform feature alignment on feature points in a telephoto image output by the telephoto lens and feature points in a short-focus image output by the short-focus lens to obtain a feature alignment result; the telephoto image and the short-focus image are obtained by photographing the target scene at the same time; The fusion unit is used to perform feature fusion on the long-focus image and the short-focus image based on the feature alignment result to obtain a fused feature map; the fused feature map is used to detect the position of at least one target object in the target scene; the fused feature map contains multiple feature points; the fused feature map has the same size as the short-focus image; The detection unit is used to detect the fused feature map to obtain the position of at least one target object in the target scene.

10. A vehicle, characterized in that: The vehicle includes the position detection device as claimed in claim 9.

11. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device executes the position detection method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product includes computer instructions; when part or all of the computer instructions are run on a computer, the computer executes the position detection method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Urban rail train autonomous obstacle detection method and system based on long and short focus image fusion

    CN119888679A

  • Urban rail train autonomous obstacle detection method and system based on long-short focus image fusion

    CN119888679B