Fisheye image cutting method, electronic equipment, vehicle and storage medium

By setting the first coordinate and the second coordinate in the fisheye diagram and adjusting the cutting area, the problem of deviation in the fisheye diagram content caused by changes in the external parameters of the fisheye camera is solved, ensuring the accuracy of the panoramic display image, and improving the driving safety of the vehicle.

CN119762498AActive Publication Date: 2025-04-04BYD CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411162407.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-04-04
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Changes in external parameters of the fisheye camera lead to deviations in the content of the fisheye image, affecting the accuracy of the panoramic display image, and thus affecting the safe driving of the vehicle.

Method used

By setting the first coordinate and the second coordinate, the cutting area of ​​the fisheye image is adjusted to ensure that the photographed object is always at the center of the cut image, thereby maintaining the accuracy of the panoramic display image.

Benefits of technology

It effectively solves the problem of fisheye image content deviation caused by changes in external parameters of the fisheye camera, ensures the accuracy of the panoramic display image, and improves the driving safety of the vehicle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762498A_ABST
    Figure CN119762498A_ABST
Patent Text Reader

Abstract

The invention provides a fisheye image cutting method, electronic equipment, a vehicle and a storage medium, and the method comprises the steps: determining a first fisheye coordinate and a second fisheye coordinate corresponding to a first coordinate and a second coordinate in a fisheye image; cutting the fisheye image according to the cutting area to obtain a cut image; whether the cutting area needs to be adjusted according to the first fisheye coordinate and the second fisheye coordinate is determined by judging whether the difference between the vertical distance from the first fisheye coordinate to the central axis of the cut image and the vertical distance from the second fisheye coordinate to the central axis of the cut image is within a preset range. By implementing the method, when the external parameters of the fisheye camera are changed, the cutting area is adjusted through the first fisheye coordinates and the second fisheye coordinates, so that the shot object is still located at the central position of the cut image, thereby ensuring that the panoramic display image generated according to the cut image does not have deviation, and improving the image quality. And the safety of vehicle driving is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of panoramic display technology, and in particular to a fisheye image cutting method, electronic equipment, vehicle and storage medium. Background Art

[0002] With the development of automobile intelligence, panoramic display has gradually become a standard feature of automobiles. Global display is an auxiliary driving technology for automobiles, which aims to improve the driver's field of vision and driving safety. Specifically, the display device in the vehicle obtains multiple fisheye images taken by multiple fisheye cameras (usually installed in the front, back, left, and right positions of the vehicle), and cuts out a fixed-size cut image at the center of each fisheye image. Finally, a panoramic display image is generated based on the multiple cut images and displayed to the driver, so that the driver can see the environment around the vehicle more clearly, such as obstacles, pedestrians, other vehicles, etc., thereby improving driving safety.

[0003] However, due to the installation error of the fisheye camera, the deformation of the vehicle body, the structural aging of the fisheye camera and other issues, the external parameters of the fisheye camera (such as the position of the fisheye camera and the shooting direction of the fisheye camera) gradually change, and the deviation between the content of the fisheye image taken by the fisheye camera and the content of the fisheye image that the fisheye camera at that position should take is also getting larger and larger. For example, before the external parameters of the fisheye camera change, the photographed object is located at the center of the fisheye image, and after the external parameters of the fisheye camera change, the photographed object is located at a non-central position of the fisheye image. The change in the content of the fisheye image causes a deviation in the panoramic display image generated by the display device in the vehicle according to the fisheye image, which in turn affects the safe driving of the vehicle. Summary of the invention

[0004] The present application provides a fisheye image cutting method, an electronic device, a vehicle and a storage medium. When the external parameters of a fisheye camera change, the cutting area for the fisheye image is adjusted by a first coordinate point and a second coordinate point to ensure that the photographed object is still located at the center of the cut image, thereby ensuring that the panoramic display image generated according to the cut image will not have deviations, thereby ensuring the safety of vehicle driving.

[0005] In a first aspect, the present application provides a fisheye image cutting method, the method comprising: determining a first fisheye coordinate of a first coordinate in the fisheye image, and a second fisheye coordinate of a second coordinate in the fisheye image, wherein the first coordinate and the second coordinate remain unchanged relative to the photographed object, and the vertical distance between the first coordinate and the central axis of the photographed object and the vertical distance between the second coordinate and the central axis of the photographed object are the same, and the first coordinate and the second coordinate are located on different sides of the central axis of the photographed object; acquiring a first cutting image of the fisheye image according to a cutting area, and determining whether the difference between a first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and a second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within a first range; if the difference between the first vertical distance and the second vertical distance is not within the first range, adjusting the cutting area to acquire a second cutting image of the fisheye image according to the first fisheye coordinate and the second fisheye coordinate, so that the difference between the vertical distance between the first fisheye coordinate and the central axis of the second cutting image and the vertical distance between the second fisheye coordinate and the central axis of the second cutting image is within the first range.

[0006] After the external parameters of the fisheye camera change, the position of the photographed object in the fisheye image also changes. The above scheme is implemented by setting the first coordinate and the second coordinate. Since the first coordinate and the second coordinate remain unchanged with the vehicle, the first coordinate and the corresponding first fisheye coordinate and the second fisheye coordinate in the fisheye image taken by the fisheye camera remain unchanged with the vehicle. The position of the cut image in the fisheye image can be determined by the first fisheye coordinate and the second fisheye coordinate. For example, assuming that the first coordinate and the second coordinate are respectively located in front of the vehicle and are symmetrical about the central axis of the vehicle, the first fisheye coordinate and the second fisheye coordinate are both located in the cut image in the center area of ​​the fisheye image, and the vertical distances of the first fisheye coordinate and the second fisheye coordinate to the central axis of the cut image are When the shooting direction of the fisheye camera changes from the front of the vehicle to the right front of the vehicle, the first fisheye coordinate and the second fisheye coordinate in the fisheye image will move to the left. At this time, if the cutting image is continued to be collected in the center area of ​​the fisheye image, due to the movement of the first fisheye coordinate and the second fisheye coordinate, the vertical distances from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cutting image are different. By adjusting the cutting area (moving the cutting area to the left), the difference in the vertical distances from the first fisheye coordinate and the second fisheye coordinate to the central axis of the new cutting image is within a preset range, thereby ensuring that the photographed object is still in the center of the cutting image, and then the panoramic image generated by the display device in the vehicle according to the fisheye image will not have deviations, thereby ensuring the safety of vehicle driving.

[0007] It should be understood here that due to errors in image processing, when adjusting the cutting area, it is only necessary to make the difference in the vertical distance between the first fisheye coordinate and the second fisheye coordinate to the central axis of the cutting image within a preset range, and the preset range can be determined according to the actual application scenario.

[0008] In a possible implementation manner of the first aspect, the method further includes: when a difference between the first vertical distance and the second vertical distance is within a first range, determining that the photographed object is located at a center position of the first cutting image.

[0009] In a possible implementation of the first aspect, adjusting the cutting area according to the first fisheye coordinate and the second fisheye coordinate includes: when the first vertical distance is greater than the second vertical distance, expanding one side of the first edge and the second edge of the cutting area close to the first fisheye coordinate outward by one or more pixel units, or reducing one side of the first edge and the second edge of the cutting area close to the second fisheye coordinate inward by one or more pixel units; or, when the first vertical distance is less than the second vertical distance, reducing one side of the first edge and the second edge of the cutting area close to the first fisheye coordinate inward by one or more pixel units, or expanding one side of the first edge and the second edge of the cutting area close to the second fisheye coordinate outward by one or more pixel units, the first edge and the second edge are edges parallel to the central axis of the first cutting image.

[0010] In a possible implementation of the first aspect, adjusting the cutting area according to the first fisheye coordinate and the second fisheye coordinate includes: when the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is greater than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, expanding the second edge of the cutting area outward as a whole by one or more pixel units, or shrinking the first edge of the cutting area inward as a whole by one or more pixel units; or, when the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is less than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, expanding the first edge of the cutting area outward as a whole by one or more pixel units, or shrinking the second edge of the cutting area inward as a whole by one or more pixel units, and the first edge and the second edge are sides parallel to the central axis of the first cutting image.

[0011] In implementing the above scheme, taking the first edge as the left edge and the second edge as the right edge as an example, the cutting area is adjusted to the left or right so that the vertical distances from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cutting image are within the first range, thereby ensuring that the position of the photographed object in the cutting image corresponding to the fisheye image does not change. When determining the adjustment direction of the cutting area, it can be based on the relationship between the difference in vertical distances from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cutting image and a preset threshold, or it can be based on the relationship between the difference in vertical distances from the first fisheye coordinate and the second fisheye coordinate to the left and right edges of the cutting image and a preset threshold.

[0012] In a possible implementation of the first aspect, the method also includes: determining a third fisheye coordinate of the third coordinate in the fisheye image, wherein the third coordinate remains unchanged relative to the photographed object; determining whether a vertical distance from the third fisheye coordinate to a third edge of the second cutting image is within a second range, the third edge being an edge perpendicular to a central axis of the second cutting image; in a case where the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is outside the second range, adjusting the cutting area to obtain the third cutting image of the fisheye image according to the third fisheye coordinate so that the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is within the second range.

[0013] Implementing the above solution, taking the first edge as the left edge, the second edge as the right edge, and the third edge as the upper edge as an example, since only the left and right directions of the cutting area can be adjusted through the first fisheye coordinates and the second fisheye coordinates, when the fisheye camera still has an upward or downward offset, the cutting area also needs to be adjusted in the up and down directions.

[0014] By setting the third coordinate and judging whether the vertical distance from the third fisheye coordinate in the fisheye image to the upper edge of the cut image is within the second range, when the vertical distance from the third fisheye coordinate to the upper edge of the cut image is outside the second range, adjusting the cut area according to the third fisheye coordinate, so that after the fisheye camera is offset in the up and down directions, the position of the photographed object in the cut image corresponding to the fisheye camera remains unchanged.

[0015] It should be understood here that due to errors in image processing, when adjusting the cutting area, it is only necessary to make the vertical distance from the third fisheye coordinate to the upper edge of the cutting image within the second range, and the second range can be determined according to the actual application scenario.

[0016] In a possible implementation of the first aspect, according to the third fisheye coordinate, adjusting the cutting area to obtain the third cutting image of the fisheye image includes: when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is greater than the second range, the third edge of the cutting area is reduced inward by one or more pixel units as a whole; when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is less than the second range, the third edge of the cutting area is expanded outward by one or more pixel units as a whole. In implementing the above scheme, taking the third edge as the upper edge as an example, by adjusting the cutting area upward or downward so that the vertical distance from the third fisheye coordinate to the third edge of the cutting image is within the second range, it is ensured that the position of the photographed object in the cutting image corresponding to the fisheye image does not change.

[0017] In a possible implementation manner of the first aspect, after acquiring a first cutting image of the fisheye image according to the cutting area, the method further includes: scaling the first cutting image to acquire the first scaled image, determining a first scaled coordinate of the first fisheye coordinate in the first scaled image, a second scaled coordinate of the second fisheye coordinate in the first scaled image, and a third scaled coordinate of the third fisheye coordinate in the first scaled image; determining whether a difference between a third vertical distance between the first scaled coordinate and a central axis of the first scaled image and a fourth vertical distance between the second scaled coordinate and the central axis of the first scaled image is within a third range; determining whether a vertical distance from the third scaled coordinate to a third edge of the first scaled image is within a fourth range; and when it is determined that the difference between the third vertical distance between the first scaled coordinate and the central axis of the first scaled image and the fourth vertical distance between the second scaled coordinate and the central axis of the first scaled image is outside the third range, or the vertical distance from the third scaled coordinate to the third edge of the first scaled image is outside the fourth range, adjusting the cutting area to acquire a fourth cutting image of the fisheye image so that the difference between the third vertical distance and the fourth vertical distance is within the third range, and the vertical distance from the third scaled coordinate to the third edge of the first scaled image is within the fourth range.

[0018] Since there is a difference between the size of the cut image and the size of the fisheye image, in most scenarios, the cut image needs to be scaled by a certain ratio before it can be put into subsequent use. When scaling the cut image, if it is not scaled in equal proportion, the position of its internal structure may change, that is, the vertical distance from each fisheye coordinate to the edge of the cut image will change. Therefore, when the cut image needs to be scaled, the display device in the vehicle needs to determine whether the cutting area needs to be adjusted based on the scaled coordinates of the first fisheye coordinate, the second fisheye coordinate and the third fisheye coordinate (that is, the above-mentioned first scaled coordinate, the second scaled coordinate and the third scaled coordinate) and the scaled cut image. For example, assuming that the difference in the vertical distance from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cut image is between -1 and 1 (including -1 and 1), after the cut image is enlarged, the difference in the vertical distance from the first scaled coordinate and the second scaled coordinate to the central axis of the scaled cut image can be between -2 and 2 (including -2 and 2).

[0019] In a second aspect, the present application provides a fisheye image cutting device, which includes: an acquisition unit, used to determine a first fisheye coordinate of a first coordinate in the fisheye image, and a second fisheye coordinate of a second coordinate in the fisheye image, wherein the first coordinate and the second coordinate remain unchanged relative to the photographed object, and the vertical distance between the first coordinate and the central axis of the photographed object and the vertical distance between the second coordinate and the central axis of the photographed object are the same, and the first coordinate and the second coordinate are located on different sides of the central axis of the photographed object; a processing unit, used to acquire a first cutting image of the fisheye image according to a cutting area, and determine whether the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within a first range; an adjustment unit, used to adjust the cutting area to acquire a second cutting image of the fisheye image according to the first fisheye coordinate and the second fisheye coordinate when the difference between the first vertical distance and the second vertical distance is not within the first range, so that the difference between the vertical distance between the first fisheye coordinate and the central axis of the second cutting image and the vertical distance between the second fisheye coordinate and the central axis of the second cutting image is within the first range.

[0020] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing computer program instructions, the processor executing the computer program instructions to implement the method in the first aspect and any possible implementation manner of the first aspect.

[0021] In a fourth aspect, the present application provides a vehicle, the vehicle comprising the electronic device as in the third aspect.

[0022] In a fifth aspect, the present application provides a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed by a processor, the method in the first aspect and any possible implementation manner of the first aspect is implemented.

[0023] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 work.

[0025] Figure 1 It is a set of fisheye images provided by this application;

[0026] Figure 2 is another set of fisheye images provided by this application;

[0027] Figure 3 It is a schematic diagram of a fisheye image cutting method provided by the present application;

[0028] Figure 4 is a schematic diagram of a cutting image provided by the present application;

[0029] Figure 5 It is a structural schematic diagram of a fisheye image cutting device provided by the present application;

[0030] Figure 6 It is a structural schematic diagram of an electronic device provided by the present application;

[0031] Figure 7 It is a structural schematic diagram of a vehicle provided by the present application. DETAILED DESCRIPTION

[0032] The technical solutions involved in this application are clearly and completely described below in conjunction with the accompanying drawings. The embodiments described below are only part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0033] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0034] It should be noted that the terms of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" of the present application are also intended to include plural forms, unless the context clearly indicates other meanings.

[0035] With the development of automobile intelligence, panoramic display has gradually become a standard feature of automobiles. Global display is an auxiliary driving technology for automobiles, which aims to improve the driver's field of vision and driving safety. Specifically, the display device in the vehicle obtains multiple fisheye images taken by multiple fisheye cameras (usually installed in the front, back, left, and right positions of the vehicle), and cuts out a fixed-size cut image at the center of each fisheye image. Finally, a panoramic display image is generated based on the multiple cut images and displayed to the driver, so that the driver can see the environment around the vehicle more clearly, such as obstacles, pedestrians, other vehicles, etc., thereby improving driving safety.

[0036] However, due to the installation error of the fisheye camera, the deformation of the vehicle body, the aging of the fisheye camera structure and other issues, the external parameters of the fisheye camera (such as the position of the fisheye camera and the shooting direction of the fisheye camera) gradually change, and the deviation between the content of the fisheye image taken by the fisheye camera and the content of the fisheye image that the fisheye camera at that position should take is getting larger and larger, which eventually leads to deviations in the panoramic display image generated by the display device in the vehicle based on the fisheye image, thus affecting the safe driving of the vehicle. Please refer to Figure 1 , Figure 1 This application provides a set of fisheye images, such as Figure 1 As shown, (A) represents the picture taken before the external parameters of the fisheye camera are changed; (B) represents the picture taken after the external parameters of the fisheye camera are changed; by comparing Figure 1 From (A) and (B) in the figure, it can be found that after the external parameters of the fisheye camera change, the position of the photographed object in the fisheye image will also change. At this time, if the cutting area of ​​the fisheye image remains unchanged, the photographed object will be located in a non-central position of the cutting area. The change in the position of the photographed object in the cutting image will affect the accuracy of the vehicle's panoramic display image, and thus affect the safety of vehicle driving.

[0037] To solve the above problems, the present application provides a fisheye image cutting method, which includes: setting a first coordinate and a second coordinate, wherein the first coordinate and the second coordinate are fixed relative to the position of the vehicle, the first coordinate and the second coordinate have the same vertical distance to the central axis of the vehicle, and are located on both sides of the central axis; the electronic device determines the first fisheye coordinate corresponding to the first coordinate in the fisheye image and the second fisheye coordinate corresponding to the second coordinate in the fisheye image; the electronic device cuts the fisheye image according to the cutting area, and determines whether the photographed object is located at the center of the cut image according to the first fisheye coordinate and the second fisheye coordinate; when the photographed object is not located at the center of the cut image, the electronic device adjusts the cutting area according to the first fisheye coordinate and the second fisheye coordinate, and re-cuts the fisheye image according to the adjusted cutting area, and the electronic device performs the above judgment on the cut image again until the photographed object is located at the center of the cut image.

[0038] It should be understood that although the external parameters of the fisheye camera will gradually change over time, the content of the fisheye image taken by the fisheye camera will not change significantly in a short period of time (that is, the deviation between the content of the fisheye image taken by the fisheye camera this time and the content of the fisheye image taken last time is small). Therefore, in the above method, when the external parameters of the fisheye camera change, the first fisheye coordinates and the second fisheye coordinates are still in the original cutting area.

[0039] By implementing the above method, when the external parameters of the fisheye camera change, the cutting area is adjusted through the first fisheye coordinates and the second fisheye coordinates, thereby ensuring that the position of the photographed object in the cut image remains unchanged, and further ensuring that the panoramic display image generated according to the cut image will not have deviations, thereby ensuring the driving safety of the vehicle.

[0040] See also Figure 2 , Figure 2 is another set of fisheye images provided by this application, such as Figure 2 As shown, in the fisheye image cutting method provided in the present application, by setting a plurality of coordinate points around the photographed object, and projecting the plurality of coordinate points onto the fisheye image taken by the fisheye camera, since the relative positions of the coordinate points and the photographed object are fixed, after the plurality of coordinate points are projected onto the fisheye image through the external parameters of the fisheye camera, the relative positions of the corresponding fisheye coordinates and the photographed object in the fisheye image are also fixed. Therefore, the fisheye coordinates corresponding to the plurality of coordinate points on the fisheye image can be used to determine the position of the photographed object, and the cutting area of ​​the fisheye image is adjusted according to the above-mentioned fisheye coordinate points. When the external parameters of the fisheye camera change, the position of the photographed object in the cut image remains unchanged.

[0041] Combine the following Figure 3 To introduce a fisheye image cutting method provided by this application, Figure 3In this example, the object to be photographed is a vehicle. Figure 3 , Figure 3 is a schematic diagram of a fisheye image cutting method provided by the present application, such as Figure 3 As shown, the method includes:

[0042] S301: Determine the first fisheye coordinate of the first coordinate in the fisheye image, and the second fisheye coordinate of the second coordinate in the fisheye image. The above-mentioned first coordinate and second coordinate are points around the vehicle, and their relative positions to the vehicle are constant, that is, during the driving of the vehicle, the positions of the first coordinate and the second coordinate are unchanged relative to the vehicle. The first coordinate and the second coordinate are symmetrical about the central axis of the vehicle, that is, the vertical distance from the first coordinate to the central axis of the vehicle is the same as the vertical distance from the second coordinate to the central axis of the vehicle, and the first coordinate and the second coordinate are located on both sides of the central axis of the vehicle. The specific positions of the first coordinate and the second coordinate can be determined by establishing a coordinate system. For example, a coordinate system is established with the top view of the vehicle as a plane, the center of the vehicle as the origin, and the central axis of the vehicle as the longitudinal axis. The first coordinate and the second coordinate are two coordinate points symmetrical about the longitudinal axis in the coordinate system.

[0043] The above-mentioned first fisheye coordinates and second fisheye coordinates are points on the fisheye image. By establishing a coordinate system for the fisheye image, the specific positions of the first fisheye coordinates and the second fisheye coordinates can be determined. For example, a coordinate system is established with the center of the fisheye image as the origin and the central axis of the fisheye image as the vertical axis. The first fisheye coordinates and the second fisheye coordinates are two coordinate points on the coordinate system.

[0044] The electronic device determines the first fisheye coordinate of the first coordinate in the fisheye image and the second fisheye coordinate of the second coordinate in the fisheye image specifically including: the electronic device converts the first coordinate into the first fisheye coordinate in the fisheye image according to the intrinsic parameters of the fisheye camera and the calibrated extrinsic parameters; the electronic device converts the second coordinate into the second fisheye coordinate in the fisheye image according to the intrinsic parameters of the fisheye camera and the calibrated extrinsic parameters. It is explained here that the electronic device can obtain the intrinsic parameters of the fisheye camera at any time, and the extrinsic parameters of the fisheye camera will change continuously with the environment, so the electronic device uses the calibrated values ​​of the extrinsic parameters of the fisheye camera, that is, the above-mentioned calibrated extrinsic parameters.

[0045] In a possible embodiment, the first coordinate and the second coordinate may be coordinate points corresponding to a certain part of the vehicle in the coordinate system. For example, the first coordinate and the second coordinate may be coordinate points corresponding to the center of the left front wheel and the center of the right front wheel of the vehicle in the coordinate system, or the first coordinate and the second coordinate may be coordinate points corresponding to the center of the left rear wheel and the center of the right rear wheel of the vehicle in the coordinate system.

[0046] In a possible embodiment, the electronic device further determines a third fisheye coordinate of the third coordinate in the fisheye image.

[0047] The above-mentioned third coordinate is a point around the vehicle, and its relative position to the vehicle is constant. The specific position of the third coordinate can be determined by establishing a specific coordinate system. For example, a coordinate system is established with the top view of the vehicle as the plane, the center of the vehicle as the origin, and the central axis of the vehicle as the longitudinal axis. The third coordinate is a point in the coordinate system that is different from the first coordinate and the second coordinate.

[0048] The third fisheye coordinate is a coordinate point on the fisheye image. By determining the third fisheye coordinate corresponding to the third coordinate in the fisheye image, the subsequent adjustment of the cutting area is more comprehensive, for example, the cutting area is adjusted left and right according to the first fisheye coordinate and the second fisheye coordinate; the cutting area is adjusted up and down according to the third fisheye coordinate.

[0049] It should be understood that since the positions of the above-mentioned first coordinates, second coordinates and third coordinates remain unchanged relative to the vehicle, in the fisheye image taken by the fisheye camera, the positions of the fisheye coordinates corresponding to the first coordinates, the second coordinates and the third coordinates are also unchanged relative to the vehicle. Therefore, the electronic device can determine whether the external parameters of the fisheye camera (i.e., the position and shooting direction of the fisheye camera) have changed through the fisheye coordinates, and can also timely modulate the cutting area of ​​the fisheye image corresponding to the fisheye camera through the fisheye coordinates, thereby ensuring that the position of the photographed object in the cutting image corresponding to the fisheye camera remains consistent. For example, assuming that the original cutting area is a square area with 25 pixels at the center of the fisheye image, the center of the cutting area is the photographed object, the first fisheye coordinate and the second fisheye coordinate are respectively located one pixel unit to the left and one pixel unit to the right of the center of the fisheye image, and the third fisheye coordinate is located one pixel unit below the center of the fisheye image. After the external parameters of the fisheye camera change, the position of the photographed object in the fisheye image changes, and the electronic device determines the position of the photographed object through the positions of the first fisheye coordinate, the second fisheye coordinate and the third fisheye coordinate, and adjusts the cutting position according to the first fisheye coordinate, the second fisheye coordinate and the third fisheye coordinate, so that the photographed object is located at the center of the new cutting position.

[0050] S302: Acquire a first cutting image of the fisheye image according to the cutting area.

[0051] The above-mentioned cutting area can be understood as a certain area that the electronic device will cut out from the fisheye image. The area is usually located at the center or near the center of the fisheye image. For example, the cutting area can be a square area containing 25 pixels constructed with the center of the fisheye image as the center. The cutting area is generally determined by the staff, but it can also be adjusted by the electronic device. It is explained here that since the cutting area will be adjusted later, the cutting images of the fisheye image obtained according to different cutting areas are also different. The above-mentioned first cutting image is a cutting image obtained from the fisheye image according to the initial cutting area.

[0052] S303: Determine whether the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within the first range. In the case where it is determined that the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is not within the first range, the electronic device determines that the cutting area needs to be adjusted and executes step S304; in the case where it is determined that the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within the first range, the electronic device determines that the cutting area does not need to be adjusted and executes step S305.

[0053] Since the first fisheye coordinate and the second fisheye coordinate remain unchanged with the vehicle, the electronic device can determine the position of the first cut image in the fisheye image through the first fisheye coordinate and the second fisheye coordinate. For example, assuming that the first coordinate and the second coordinate are respectively located in front of the vehicle and are symmetrical about the central axis of the vehicle, the first fisheye coordinate and the second fisheye coordinate are both located in the first cut image in the center area of ​​the fisheye image, and the vertical distances of the first fisheye coordinate and the second fisheye coordinate to the central axis of the first cut image are the same. When the shooting direction of the fisheye camera changes from the front of the vehicle to the right front of the vehicle, the first fisheye coordinate and the second fisheye coordinate in the fisheye image will move to the left. At this time, if the first cut image is continued to be collected in the center area of ​​the fisheye image, due to the movement of the first fisheye coordinate and the second fisheye coordinate, the vertical distances of the first fisheye coordinate and the second fisheye coordinate to the central axis of the first cut image are different. The electronic device determines that the cutting area needs to be adjusted, and adjusts the cutting area according to the first fisheye coordinate and the second fisheye coordinate.

[0054] In a possible embodiment, the electronic device may also determine whether the cutting area needs to be adjusted by determining whether the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is greater than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image. Similarly, the electronic device may also determine whether the cutting area needs to be adjusted by determining whether the vertical distance from the first fisheye coordinate to the second edge of the first cutting image is less than the vertical distance from the second fisheye coordinate to the first edge of the first cutting image.

[0055] The above-mentioned first edge and second edge are two different edges. Since in this embodiment, the photographed object is a vehicle, the first coordinate and the second coordinate are symmetrical about the central axis of the vehicle. Therefore, the first edge and the second edge should be two edges parallel to the central axis of the vehicle in the fisheye image, for example, the first edge is the left edge and the second edge is the right edge, or the first edge is the right edge and the second edge is the left edge.

[0056] In a possible embodiment, the electronic device further determines whether the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is within the second range; when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is outside the second range, the cutting area is adjusted according to the third fisheye coordinate to obtain the third cutting image of the fisheye image, so that the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is within the second range. It should be understood here that the second cutting image is the cutting image of the fisheye image obtained according to the adjusted cutting area after the electronic device adjusts the cutting area according to the first fisheye coordinate and the second fisheye coordinate.

[0057] The above-mentioned third edge is two edges on the cutting area that are different from the first edge and the second edge. Since the first edge and the second edge are parallel to the central axis of the vehicle in the fisheye image, the third edge can be one of the two edges perpendicular to the central axis of the vehicle in the fisheye image, and can be the upper edge or the lower edge.

[0058] Since the cutting area can only be adjusted in a single direction by using the first fisheye coordinate and the second fisheye coordinate, when the fisheye camera is offset in other directions, the electronic device also needs to adjust the cutting area in other directions. For example, when the first fisheye coordinate and the second fisheye coordinate are used to adjust the cutting area in the left and right directions, and the fisheye camera is offset in the up and down directions, the cutting area also needs to be adjusted in the up and down directions. By setting the third coordinate and the second range, the cutting area can be adjusted in more directions to meet the center cutting requirements of the fisheye image in more scenarios.

[0059] It should be understood here that due to the error in image processing, the electronic device needs to set an error range when comparing the vertical distance. For example, when the electronic device calculates the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cut image and the second vertical distance between the second fisheye coordinate and the central axis of the first cut image, the first range is set. When the difference between the first vertical distance and the second vertical distance is within the first range, it means that the parameters of the fisheye camera have not changed significantly, and the current cutting area is still in the center of the fisheye image. The fisheye image can be cut in the center through the cutting area. When the difference between the first vertical distance and the second vertical distance is not within the first range, it means that the parameters of the fisheye camera have changed significantly and the cutting area needs to be readjusted. Wherein, the interval range of the first range is [a, b], a can be either a positive number or a negative number, and b can be greater than a. For example, the first range can be [-1, 1], [0, 1], [0, 2] or [-5, 10]. The present application does not specifically limit the interval of the first range. The same is true for the second range, which will not be repeated here.

[0060] In a possible embodiment, after the electronic device cuts the fisheye image according to the cutting area to obtain the first cutting image, it also scales the first cutting image to obtain the first scaling image; then determines the first scaling coordinate corresponding to the first fisheye coordinate in the first scaling image, the second scaling coordinate corresponding to the second fisheye coordinate in the first scaling image, and the third scaling coordinate corresponding to the third fisheye coordinate in the first scaling image; after obtaining the first scaling coordinate, the second scaling coordinate, and the third scaling coordinate, the electronic device determines whether the difference between the third vertical distance between the first scaling coordinate and the central axis of the first scaling image and the fourth vertical distance between the second scaling coordinate and the central axis of the first scaling image is within a third range, and determines whether the vertical distance from the third scaling coordinate to the third edge of the first scaling image is within a fourth range; when it is determined that the difference between the third vertical distance and the fourth vertical distance is outside the third range, or the vertical distance from the third scaling coordinate to the third edge of the first scaling image is outside the fourth range, the cutting area is adjusted to obtain the fourth cutting image of the fisheye image, so that the difference between the third vertical distance and the fourth vertical distance is within the third range, and the vertical distance from the third scaling coordinate to the third edge of the first scaling image is within the fourth range. It should be understood here that the fourth cutting image is a cutting image of the fisheye image obtained according to the adjusted cutting area after the electronic device adjusts the cutting area according to the first scaling coordinate, the second scaling coordinate, and the third scaling coordinate.

[0061] The selection of the third range and the fourth range is similar to that of the first range, but the specific values ​​are different from those of the first range, and this application will not elaborate on them here.

[0062] It should be understood that due to the difference between the size of the cutting area and the size of the fisheye image, in most scenarios, the cutting image obtained based on the cutting area needs to be scaled by a certain proportion before it can be put into subsequent use. When scaling the cutting image, if it is not scaled proportionally, its internal structure position may change, that is, the vertical distance from each fisheye coordinate to each edge of the cutting image will also change. Therefore, when the cutting image needs to be scaled, the electronic device needs to determine whether the cutting area needs to be adjusted based on the scaled coordinates of the first fisheye coordinates, the second fisheye coordinates and the third fisheye coordinates and the scaled cutting image.

[0063] Below, we will introduce how electronic devices determine whether the cutting area needs to be adjusted, using a specific fisheye image example. Figure 4 , Figure 4 is a schematic diagram of a cutting image provided by the present application, such as Figure 4 As shown, in the cut image, the photographed object is located at a left position in the cut image (assuming that in the cut image corresponding to the fisheye camera, the photographed object should be located at the center of the cut image), and there are three fisheye coordinates in the cut image, including fisheye coordinate 1, fisheye coordinate 2 and fisheye coordinate 3, and the vertical distance from fisheye coordinate 1 to the left edge of the cut image is L1, the vertical distance from fisheye coordinate 2 to the lower edge of the cut image is L2, and the vertical distance from fisheye coordinate 3 to the right edge of the cut image is L3, wherein fisheye coordinate 1 and fisheye coordinate 2 are symmetrical about the central axis of the photographed object.

[0064] The electronic device cuts the fisheye image according to the cutting area to obtain Figure 4 After the cutting image is shown, the electronic device determines whether the cutting area needs to be adjusted according to the fisheye coordinate 1, the fisheye coordinate 2 and the fisheye coordinate 3, including:

[0065] The electronic device determines whether the difference between L1 and L3 is within the first range. For example, when the first range is [-2, 2], L1 is 2, and L3 is 7, since the difference between L1 and L3, -5, is outside the first range [-2, 2], the electronic device determines Figure 4 The cut area shown requires adjustment;

[0066] The electronic device determines whether L2 is within the second range. For example, when the second range is [2, 4] and L2 is 1, since L2 is outside the second range [2, 4], the electronic device determines Figure 4 The cutting area shown requires adjustment.

[0067] When the electronic device determines that the difference between L1 and L3 is within the first range and L2 is within the second range, the electronic device determines Figure 4The cutting area shown does not need to be adjusted. For example, in the first range [-2, 2], L1 is 5, L2 is 3, L3 is 6, and the second range is [2, 4]. Since the difference between L1 and L3 -1 is in the first range [-2, 2], and L2 is in the second range [2, 4], the electronic device determines Figure 4 The cut area shown does not require adjustment.

[0068] S304: According to the first fisheye coordinates and the second fisheye coordinates, the cutting area is adjusted to obtain a second cutting image of the fisheye image.

[0069] After the electronic device determines that the cutting area needs to be adjusted according to the first fisheye coordinate and the second fisheye coordinate, it adjusts the cutting area according to the first fisheye coordinate and the second fisheye coordinate, and cuts the fisheye image according to the adjusted cutting area to obtain a new cutting image (i.e., the second cutting image). After obtaining the second cutting image, the electronic device returns to execute step S303. It should be understood that when the electronic device obtains the second cutting image and executes step S303, the electronic device determines whether the difference between the vertical distance between the first fisheye coordinate and the central axis of the second cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the second cutting image is within the first range, that is, after the electronic device adjusts the cutting area, it will make the judgment in step S303 on the cutting image corresponding to the adjusted cutting area.

[0070] In a possible embodiment, the electronic device adjusts the cutting area according to the first fisheye coordinates and the second fisheye coordinates in the following two ways:

[0071] Method 1: When the vertical distance from the first fisheye coordinate to the central axis of the cut image is greater than the vertical distance from the second fisheye coordinate to the central axis of the cut image, the first edge and the second edge of the cut area close to the first fisheye coordinate are expanded outward by one or more pixel units, or the first edge and the second edge of the cut area close to the second fisheye coordinate are reduced inward by one or more pixel units.

[0072] Method 2: When the vertical distance from the first fisheye coordinate to the central axis of the cut image is smaller than the vertical distance from the second fisheye coordinate to the central axis of the cut image, one side of the first edge and the second edge of the cut area close to the first fisheye coordinate is reduced inward by one or more pixel units, or one side of the first edge and the second edge of the cut area close to the second fisheye coordinate is expanded outward by one or more pixel units.

[0073] In another possible embodiment, the electronic device may adjust the cutting area according to the first fisheye coordinates and the second fisheye coordinates in the following manner:

[0074] When the vertical distance from the first fisheye coordinate to the second edge of the cut image is greater than the vertical distance from the second fisheye coordinate to the first edge of the cut image, the first edge of the cut area is expanded outward as a whole by one or more pixel units, or the second edge of the cut area is reduced inward as a whole by one or more pixel units; or, when the vertical distance from the first fisheye coordinate to the second edge of the cut image is less than the vertical distance from the second fisheye coordinate to the first edge of the cut image, the second edge of the cut area is expanded outward as a whole by one or more pixel units, or the first edge of the cut area is reduced inward as a whole by one or more pixel units.

[0075] In a possible embodiment, the electronic device further adjusts the cutting area according to the third fisheye coordinates, and the adjustment method may be:

[0076] When the vertical distance from the third fisheye coordinate to the third edge of the cut image is greater than the second range, the third edge of the cut area is reduced inwardly by one or more pixel units as a whole.

[0077] When the vertical distance from the third fisheye coordinate to the third edge of the cut image is smaller than the second range, the third edge of the cut area is expanded outward as a whole by one or more pixel units.

[0078] It should be understood that the cutting area can also be adjusted by other means such as moving the position. For example, when the vertical distance from the first fisheye coordinate to the second edge of the cutting image is greater than the vertical distance from the second fisheye coordinate to the first edge of the cutting image, the first edge of the cutting area can be expanded outward as a whole by one or more pixel units, and the second edge of the cutting area can be reduced inward as a whole by one or more pixel units. This application does not make any specific limitations on this.

[0079] By adjusting the edges of the cutting area as described above, the position of the cutting area in the fisheye image is changed, and through continuous adjustment, the position of the photographed object in the cutting area is finally made consistent with the position of the photographed object in the cutting area before the external parameters of the fisheye camera are changed.

[0080] S305: Determine whether the cut image of the fisheye image meets the requirement.

[0081] Since the difference between the first vertical distance and the second vertical distance is within the first range, it means that the photographed object is already at the center of the cut image. The electronic device determines that the photographed object is at the center position of the cut image and sends the cut image to the display device in the vehicle. The display device generates an unbiased panoramic display image based on the cut image.

[0082] To summarize, by implementing the fisheye image cutting method provided in the present application, when the external parameters of the fisheye camera change, the cutting area of ​​the fisheye image is adjusted through the first fisheye coordinates and the second fisheye coordinates, thereby ensuring that the photographed object is still in the center of the cut image, and further ensuring that the panoramic display image generated according to the cut image will not have deviations, thereby ensuring the driving safety of the vehicle.

[0083] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of a fisheye image cutting device provided by the present application. The fisheye image cutting device 500 includes an acquisition unit 501, a processing unit 502 and an adjustment unit 503. The fisheye image cutting device 500 can be implemented by hardware, software or a combination of hardware and software.

[0084] The acquisition unit 501 is used to determine a first fisheye coordinate of the first coordinate in the fisheye image, and a second fisheye coordinate of the second coordinate in the fisheye image, wherein the first coordinate and the second coordinate remain unchanged relative to the photographed object, and the vertical distance between the first coordinate and the central axis of the photographed object is the same as the vertical distance between the second coordinate and the central axis of the photographed object, and the first coordinate and the second coordinate are located on different sides of the central axis of the photographed object.

[0085] The processing unit 502 is used to obtain a first cutting image of the fisheye image according to the cutting area, and determine whether the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and the second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within a first range.

[0086] The adjustment unit 503 is used to adjust the cutting area to obtain the second cutting image of the fisheye image according to the first fisheye coordinate and the second fisheye coordinate when the difference between the first vertical distance and the second vertical distance is not within the first range, so that the difference between the vertical distance between the first fisheye coordinate and the central axis of the second cutting image and the vertical distance between the second fisheye coordinate and the central axis of the second cutting image are within the first range.

[0087] In a possible embodiment, the processing unit 502 is further configured to determine that the photographed object is located at a center position of the first cutting image when a difference between the first vertical distance and the second vertical distance is within a first range.

[0088] In a possible embodiment, the adjustment unit 503 is specifically used to: when the first vertical distance is greater than the second vertical distance, expand one side of the first edge and the second edge of the cutting area close to the first fisheye coordinate outward by one or more pixel units, or reduce one side of the first edge and the second edge of the cutting area close to the second fisheye coordinate inward by one or more pixel units; or, when the first vertical distance is less than the second vertical distance, reduce one side of the first edge and the second edge of the cutting area close to the first fisheye coordinate inward by one or more pixel units, or expand one side of the first edge and the second edge of the cutting area close to the second fisheye coordinate outward by one or more pixel units, and the first edge and the second edge are edges parallel to the central axis of the first cutting image.

[0089] In a possible embodiment, the adjustment unit 503 is specifically used to: when the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is greater than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, expand the second edge of the cutting area outward as a whole by one or more pixel units, or shrink the first edge of the cutting area inward as a whole by one or more pixel units; or, when the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is less than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, expand the first edge of the cutting area outward as a whole by one or more pixel units, or shrink the second edge of the cutting area inward as a whole by one or more pixel units, and the first edge and the second edge are edges parallel to the central axis of the first cutting image.

[0090] In a possible embodiment, the acquisition unit 501 is also used to determine a third fisheye coordinate of the third coordinate in the fisheye image, wherein the third coordinate remains unchanged relative to the photographed object; the processing unit 502 is also used to determine whether a vertical distance from the third fisheye coordinate to a third edge of the second cutting image is within a second range, and the third edge of the cutting area is an edge perpendicular to the central axis of the second cutting image; the adjustment unit 503 is also used to adjust the cutting area to obtain the third cutting image of the fisheye image according to the third fisheye coordinate when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is outside the second range, so that the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is within the second range.

[0091] In a possible embodiment, the adjustment unit 503 is specifically used to: when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is greater than the second range, reduce the third edge of the cutting area as a whole inward by one or more pixel units; when the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is less than the second range, expand the third edge of the cutting area as a whole outward by one or more pixel units.

[0092] In a possible embodiment, the fisheye image cutting device 500 further includes a scaling unit, which is used to: scale the first cutting image to obtain the first scaled image, determine a first scaled coordinate of the first fisheye coordinate in the first scaled image, a second scaled coordinate of the second fisheye coordinate in the first scaled image, and a third scaled coordinate of the third fisheye coordinate in the first scaled image; determine whether the difference between the third vertical distance between the first scaled coordinate and the central axis of the first scaled image and the fourth vertical distance between the second scaled coordinate and the central axis of the first scaled image is within a third range; determine whether the vertical distance from the third scaled coordinate to the third edge of the first scaled image is within a fourth range; when it is determined that the difference between the third vertical distance between the first scaled coordinate and the central axis of the first scaled image and the fourth vertical distance between the second scaled coordinate and the central axis of the first scaled image is outside the third range, or the vertical distance from the third scaled coordinate to the third edge of the first scaled image is outside the fourth range, adjust the cutting area to obtain a fourth cutting image of the fisheye image, so that the difference between the third vertical distance and the fourth vertical distance is within the third range, and the vertical distance from the third scaled coordinate to the third edge of the first scaled image is within the fourth range.

[0093] Each functional unit of the fisheye image cutting device 500 can be used to implement Figure 3 A method performed by an electronic device in Figure 3 For example, the acquisition unit 501 may be used to execute Figure 3 In step S301, the processing unit 502 may be used to execute Figure 3 In step S302, the adjustment unit 503 may be used to perform Figure 3 Step S303 and step S304 in .

[0094] Here it is explained, Figure 5 The acquisition unit 501, the processing unit 502 and the adjustment unit 503 in the fisheye image cutting device 500 are only examples provided by the present application. In a specific implementation, the fisheye image cutting device 500 may also include more or fewer units. For example, the fisheye image cutting device 500 may also include a scaling unit, which is used to scale the cut image, obtain the scaled fisheye coordinates, and send the scaled fisheye coordinates to the adjustment unit 503. Since the size of the cut image is different from the size of the original fisheye image, in most scenarios, the cut image needs to be scaled by a certain ratio before it can be put into subsequent use.

[0095] See also Figure 6 , Figure 6600 includes a processor 601, a memory 602, a communication interface 603, and a bus 604. The processor 601, the memory 602, and the communication interface 603 can be interconnected through an internal bus 604, or can communicate through wireless transmission or other means.

[0096] The processor 601 may be composed of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 601 is used to execute various types of digital storage instructions. The processor 601 may implement the following by executing corresponding instructions: Figure 3 The method shown.

[0097] The memory 602 may be a volatile memory, such as a random access memory (RAM), a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous dynamic RAM (SDRAM), a double data rate RAM (DDR), a cache, etc. The memory 602 may also include a combination of the above types. The memory 602 may include programs and data. The processor 601 may execute program codes to execute Figure 3 The method shown.

[0098] The communication interface 603 can be used for data exchange between the electronic device 600 and the fisheye camera. For example, the electronic device 600 can receive a fisheye image taken by the fisheye camera through the communication interface 603. The specific communication process is not specifically limited in this application.

[0099] Need to explain, Figure 6This is only a possible implementation of the embodiment of the present application. In actual applications, the electronic device 600 may also include more or fewer components, which is not limited here.

[0100] See also Figure 7 , Figure 7 It is a structural schematic diagram of a vehicle provided by this application, such as Figure 7 As shown, the vehicle is equipped with the electronic device 600, and the electronic device 600 can be used to implement the above Figure 3 The method shown.

[0101] The present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a single-chip microcomputer to execute part or all of the steps of any method recorded in the above method embodiments.

[0102] The present application also provides a computer program product, the computer program product comprising a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to execute some or all of the steps of any method described in the above method embodiment. The computer program product may be a software installation package, and the computer comprises an electronic device.

[0103] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0104] 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 the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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.

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

[0106] 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.

[0107] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions to enable a device (which can be a personal computer, server, or network device, robot, single-chip microcomputer, chip, robot, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.

[0108] The above is a detailed introduction to the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A fisheye image cutting method, characterized in that: The method comprises: Determine a first fisheye coordinate of a first coordinate in the fisheye image, and a second fisheye coordinate of a second coordinate in the fisheye image, wherein the first coordinate and the second coordinate remain unchanged relative to the photographed object, and a vertical distance between the first coordinate and the central axis of the photographed object is the same as a vertical distance between the second coordinate and the central axis of the photographed object, and the first coordinate and the second coordinate are located on different sides of the central axis of the photographed object; Acquire a first cutting image of the fisheye image according to the cutting area, and determine whether a difference between a first vertical distance between the first fisheye coordinate and the central axis of the first cutting image and a second vertical distance between the second fisheye coordinate and the central axis of the first cutting image is within a first range; When the difference between the first vertical distance and the second vertical distance is not within the first range, the cutting area is adjusted according to the first fisheye coordinate and the second fisheye coordinate to obtain a second cutting image of the fisheye image, so that the difference between the vertical distance between the first fisheye coordinate and the central axis of the second cutting image and the vertical distance between the second fisheye coordinate and the central axis of the second cutting image are within the first range.

2. The method according to claim 1, characterized in that The method further includes: when the difference between the first vertical distance and the second vertical distance is within the first range, determining that the photographed object is located at a center position of the first cutting image.

3. The method according to claim 1 or 2, characterized in that: The adjusting the cutting area according to the first fisheye coordinates and the second fisheye coordinates includes: When the first vertical distance is greater than the second vertical distance, one of the first edge and the second edge of the cutting area close to the first fisheye coordinate is expanded outward by one or more pixel units, or one of the first edge and the second edge of the cutting area close to the second fisheye coordinate is reduced inward by one or more pixel units; or When the first vertical distance is smaller than the second vertical distance, one side of the first edge and the second edge of the cutting area close to the first fisheye coordinate is reduced inward by one or more pixel units, or one side of the first edge and the second edge of the cutting area close to the second fisheye coordinate is expanded outward by one or more pixel units, and the first edge and the second edge are parallel to the central axis of the first cutting image.

4. The method according to claim 1 or 2, characterized in that: The adjusting the cutting area according to the first fisheye coordinates and the second fisheye coordinates includes: When the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is greater than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, the second edge of the cutting area is expanded outward by one or more pixel units as a whole, or the first edge of the cutting area is reduced inward by one or more pixel units as a whole; or When the vertical distance from the first fisheye coordinate to the first edge of the first cutting image is smaller than the vertical distance from the second fisheye coordinate to the second edge of the first cutting image, the first edge of the cutting area is expanded outward as a whole by one or more pixel units, or the second edge of the cutting area is reduced inward as a whole by one or more pixel units, and the first edge and the second edge are edges parallel to the central axis of the first cutting image.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determining a third fisheye coordinate of a third coordinate in the fisheye image, wherein the third coordinate remains unchanged relative to the photographed object; Determine whether a vertical distance from the third fisheye coordinate to a third edge of the second cutting image is within a second range, the third edge being an edge perpendicular to a central axis of the second cutting image; When the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is outside the second range, the cutting area is adjusted according to the third fisheye coordinate to obtain the third cutting image of the fisheye image so that the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is within the second range.

6. The method according to claim 5, characterized in that The step of adjusting the cutting area according to the third fisheye coordinates to obtain a third cutting image of the fisheye image includes: When the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is greater than the second range, the third edge of the cutting area is reduced inward by one or more pixel units as a whole; When the vertical distance from the third fisheye coordinate to the third edge of the second cutting image is smaller than the second range, the third edge of the cutting area is expanded outward as a whole by one or more pixel units.

7. The method according to claim 5 or 6, characterized in that: After acquiring the first cutting image of the fisheye image according to the cutting area, the method further includes: Scaling the first cut image to obtain a first scaled image, determining a first scaled coordinate of the first fisheye coordinate in the first scaled image, a second scaled coordinate of the second fisheye coordinate in the first scaled image, and a third scaled coordinate of the third fisheye coordinate in the first scaled image; determining whether a difference between a third vertical distance between the first zoom coordinate and the central axis of the first zoom image and a fourth vertical distance between the second zoom coordinate and the central axis of the first zoom image is within a third range; determining whether a vertical distance from the third zoom coordinate to a third edge of the first zoom image is within a fourth range; When it is determined that a difference between a third vertical distance between the first zoom coordinate and the central axis of the first zoom image and a fourth vertical distance between the second zoom coordinate and the central axis of the first zoom image is outside the third range, or a vertical distance from the third zoom coordinate to the third edge of the first zoom image is outside the fourth range, the cutting area is adjusted to obtain a fourth cutting image of the fisheye image so that the difference between the third vertical distance and the fourth vertical distance is within the third range, and the vertical distance from the third zoom coordinate to the third edge of the first zoom image is within the fourth range.

8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores computer program instructions, and the processor implements the method according to any one of claims 1 to 7 by executing the computer program instructions.

9. A vehicle, characterized in that: The vehicle comprises the electronic device as claimed in claim 8.

10. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Camera tilt calibration method and device, equipment and storage medium

    CN113822941A

  • Camera control method and device, computer equipment and storage medium

    CN115250329A

  • Method for calibrating external parameters of fisheye lens

    CN116664683A

  • Method, device and equipment for determining pitch angle of vehicle-mounted fisheye camera and medium

    CN117115269A

  • Computer-implemented method for modeling projection of scene in three-dimensional space into composite image

    CN118525295A