Fish-eye map cutting method, electronic device, vehicle and storage medium

CN119762498BActive Publication Date: 2026-09-04BYD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0003]但是,由于存在鱼眼相机的安装误差,车辆的车身形变、鱼眼相机的结构老化等问题,导致鱼眼相机的外参数(例如鱼眼相机的位置和鱼眼相机的拍摄方向)逐渐发生变化,鱼眼相机拍摄的鱼眼图的内容与该位置的鱼眼相机应拍摄的鱼眼图的内容之间的偏差也越来越大,例如,在鱼眼相机的外参数未发生变化之前,拍摄物体位于鱼眼图的中心位置,在鱼眼相机的外参数发生变化之后,该拍摄物体位于鱼眼图的非中心位置

Benefits of technology

[0023] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762498B_ABST
    Figure CN119762498B_ABST
Patent Text Reader

Abstract

The application provides a fisheye image cutting method, an electronic device, a vehicle and a storage medium. The method comprises the following steps: determining first fisheye coordinates and second fisheye coordinates corresponding to first coordinates and second coordinates in a fisheye image; cutting the fisheye image according to a cutting region to obtain a cut image; and determining whether the cutting region needs to be adjusted according to the first fisheye coordinates and the second fisheye coordinates by judging whether the difference between the perpendicular distance from the first fisheye coordinates to the central axis of the cut image and the perpendicular distance from the second fisheye coordinates to the central axis of the cut image is within a preset range. The above method is implemented, when the external parameters of the fisheye camera change, the cutting region is adjusted through the first fisheye coordinates and the second fisheye coordinates, so that the photographed object is still located at the center position of the cut image, thereby ensuring that the panoramic display image generated according to the cut image will not be deviated, and the safety of the vehicle driving is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of panoramic display technology, and more particularly to a fisheye image cutting method, electronic devices, vehicles, and storage media. Background Technology

[0002] With the development of automotive intelligence, panoramic displays have gradually become a standard feature in automobiles. Panoramic display is a driver assistance technology designed to improve the driver's field of vision and driving safety. Specifically, the display device in the vehicle acquires multiple fisheye images captured by multiple fisheye cameras (usually installed at the front, rear, left, and right of the vehicle). A fixed-size segment is then cut from the center of each fisheye image. Finally, a panoramic image is generated based on these segmented images and displayed to the driver, allowing them to see the surrounding environment more clearly, such as obstacles, pedestrians, and other vehicles, thereby improving driving safety.

[0003] However, due to installation errors of the fisheye camera, vehicle body deformation, and structural aging of the fisheye camera, the external parameters of the fisheye camera (such as its position and shooting direction) gradually change. The deviation between the content of the fisheye image captured by the fisheye camera and the content that the fisheye camera should capture at that location becomes increasingly larger. For example, before the external parameters of the fisheye camera changed, the object was located in the center of the fisheye image; after the external parameters changed, the object is located in a non-center position. This change in the content of the fisheye image causes deviations in the panoramic display image generated by the vehicle's display device based on the fisheye image, thus affecting the safe driving of the vehicle. Summary of the Invention

[0004] This application provides a fisheye image cropping method, an electronic device, a vehicle, and a storage medium. When the external parameters of the fisheye camera change, the cropping 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 in the center of the cropped image, thereby ensuring that the panoramic display image generated based on the cropped image will not have any deviation and ensuring the safety of vehicle driving.

[0005] In a first aspect, this application provides a fisheye image cropping method, the method comprising: determining a first fisheye coordinate in a fisheye image and a second fisheye coordinate in a 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 cropped image of the fisheye image based on a cropping region, and determining whether the difference between the first vertical distance between the first fisheye coordinate and the central axis of the first cropped image and the second vertical distance between the second fisheye coordinate and the central axis of the first cropped 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 cropping region based on the first fisheye coordinate and the second fisheye coordinate to acquire a second cropped 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 cropped image and the second vertical distance between the second fisheye coordinate and the central axis of the second cropped image is within the first range.

[0006] When the extrinsic parameters of a fisheye camera change, the position of the object in the fisheye image also changes. Implementing the above scheme, by setting a first coordinate and a second coordinate, since the first and second coordinates remain constant relative to the vehicle, their corresponding first and second fisheye coordinates in the fisheye image captured by the fisheye camera also remain constant relative to the vehicle. The position of the cut image in the fisheye image can be determined using the first and second fisheye coordinates. For example, assuming the first and second coordinates are located in front of the vehicle and are symmetrical about the vehicle's central axis, both the first and second fisheye coordinates are located in the cut image within the center region of the fisheye image, and the perpendicular distances from the first and second fisheye coordinates to the central axis of the cut image are... Similarly, when the shooting direction of the fisheye camera changes from directly in front of the vehicle to the right front, the first and second fisheye coordinates in the fisheye image will shift to the left. If the center area of ​​the fisheye image is still captured and the image is cut, the vertical distances from the first and second fisheye coordinates to the central axis of the cut image will be different due to the shift of the first and second fisheye coordinates. By adjusting the cutting area (moving the cutting area to the left), the difference in the vertical distances from the first and second fisheye coordinates to the central axis of the newly cut image is kept within a preset range. This ensures that the object being photographed is still in the center of the cut image, and thus ensures that the panoramic image generated by the display device in the vehicle based on the fisheye image will not be deviated, thus ensuring the safety of driving the vehicle.

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

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

[0009] In one possible implementation of the first aspect, adjusting the cutting region 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 the side of the first edge and the second edge of the cutting region closer to the first fisheye coordinate outward by one or more pixel units, or reducing the side of the first edge and the second edge of the cutting region closer 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 the side of the first edge and the second edge of the cutting region closer to the first fisheye coordinate inward by one or more pixel units, or expanding the side of the first edge and the second edge of the cutting region closer to the second fisheye coordinate outward by one or more pixel units, wherein the first edge and the second edge are edges parallel to the central axis of the first cut image.

[0010] In one possible implementation of the first aspect, adjusting the cutting region according to the first fisheye coordinates and the second fisheye coordinates includes: if the vertical distance from the first fisheye coordinates to the first edge of the first cut image is greater than the vertical distance from the second fisheye coordinates to the second edge of the first cut image, expanding the second edge of the cutting region outward by one or more pixel units, or reducing the first edge of the cutting region inward by one or more pixel units; or, if the vertical distance from the first fisheye coordinates to the first edge of the first cut image is less than the vertical distance from the second fisheye coordinates to the second edge of the first cut image, expanding the first edge of the cutting region outward by one or more pixel units, or reducing the second edge of the cutting region inward by one or more pixel units, wherein the first edge and the second edge are edges parallel to the central axis of the first cut image.

[0011] Implementing the above scheme, taking the first edge as the left edge and the second edge as the right edge as an example, by adjusting the cutting area to the left or right, the vertical distance from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cut image is kept within a first range, thereby ensuring that the position of the object in the cut 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 between the vertical distances from the first fisheye coordinate and the second fisheye coordinate to the central axis of the cut image and a preset threshold, or it can be based on the relationship between the difference between the vertical distances from the first fisheye coordinate and the second fisheye coordinate to the left and right edges of the cut image and a preset threshold.

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

[0013] Implementing the above scheme, taking the first edge as the left edge, the second edge as the right edge, and the third edge as the top edge as an example, since only the first and second fisheye coordinates can be used to adjust the cutting area in the left and right directions, when the fisheye camera also has an upward or downward offset, it is also necessary to adjust the cutting area in the up and down directions.

[0014] By setting a third coordinate and determining whether the vertical distance from the third fisheye coordinate 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, the cutting area is adjusted according to the third fisheye coordinate so that after the fisheye camera shifts in the vertical direction, 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 the errors in image processing, when adjusting the cutting area, it is only necessary to ensure that the vertical distance from the third fisheye coordinate to the upper edge of the cut image is within the second range. This second range can be determined according to the actual application scenario.

[0016] In one possible implementation of the first aspect, adjusting the cutting region to obtain the third cut image of the fisheye image based on the third fisheye coordinates includes: if the vertical distance from the third fisheye coordinates to the third edge of the second cut image is greater than a second range, reducing the entire third edge of the cutting region inward by one or more pixel units; if the vertical distance from the third fisheye coordinates to the third edge of the second cut image is less than the second range, expanding the entire third edge of the cutting region outward by one or more pixel units. Implementing the above scheme, taking the third edge as the upper edge as an example, by adjusting the cutting region upward or downward, the vertical distance from the third fisheye coordinates to the third edge of the cut image is made to be within the second range, thereby ensuring that the position of the captured object in the cut image corresponding to the fisheye image does not change.

[0017] In one possible implementation of the first aspect, after obtaining a first segmented image of the fisheye image based on the segmented region, the method further includes: scaling the first segmented 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 the difference between the third vertical distance of the first scaled coordinate and the central axis of the first scaled image and the fourth vertical distance of the second scaled coordinate and the central axis of the first scaled image is within a third range; determining whether the vertical distance from the third scaled coordinate to the third edge of the first scaled image is within a fourth range; if it is determined that the difference between the third vertical distance of the first scaled coordinate and the central axis of the first scaled image and the fourth vertical distance of 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 segmented region to obtain a fourth segmented 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] Because the size of the cut image differs from the size of the fisheye image, in most scenarios, the cut image needs to be scaled by a certain proportion before it can be used later. When scaling the cut image, if it is not scaled proportionally, 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 first fisheye coordinate, the second fisheye coordinate, and the third fisheye coordinate after scaling (i.e., the aforementioned first scaling coordinate, second scaling coordinate, and third scaling coordinate) and the scaled cut image. For example, assuming that the difference between the vertical distances of the first and second fisheye coordinates to the central axis of the cut image is between -1 and 1 (inclusive), after the cut image is enlarged, the difference between the vertical distances of the first and second scaling coordinates to the central axis of the scaled cut image can be between -2 and 2 (inclusive).

[0019] Secondly, this application provides a fisheye image cutting device, comprising: an acquisition unit, configured to determine a first fisheye coordinate in a fisheye image and a second fisheye coordinate in a 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, configured to acquire a first cut 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 cut image and the second vertical distance between the second fisheye coordinate and the central axis of the first cut image is within a first range; and an adjustment unit, configured to adjust the cutting area to acquire a second cut 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 cut image and the second vertical distance between the second fisheye coordinate and the central axis of the second cut image is within the first range.

[0020] Thirdly, this application provides an electronic device including a memory and a processor. The memory stores computer program instructions, and the processor executes the computer program instructions to implement the methods as described in the first aspect and any possible implementation thereof.

[0021] Fourthly, this application provides a vehicle that includes electronic devices as described in the third aspect.

[0022] Fifthly, this application provides a computer-readable storage medium including computer instructions that, when executed by a processor, implement the method as described in the first aspect and any possible implementation thereof.

[0023] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a set of fisheye images provided in this application;

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

[0027] Figure 3 This is a schematic diagram of a fisheye image cutting method provided in this application;

[0028] Figure 4 This is a schematic diagram of a sliced ​​image provided in this application;

[0029] Figure 5 This is a schematic diagram of the structure of a fisheye pattern cutting device provided in this application;

[0030] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application;

[0031] Figure 7 This is a structural schematic diagram of a vehicle provided in this application. Detailed Implementation

[0032] The technical solutions involved in this application will be clearly and completely described below with reference to the accompanying drawings. The embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0034] It should be noted that the terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms "a," "the," and "the" in this application are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0035] With the development of automotive intelligence, panoramic displays have gradually become a standard feature in automobiles. Panoramic display is a driver assistance technology designed to improve the driver's field of vision and driving safety. Specifically, the display device in the vehicle acquires multiple fisheye images captured by multiple fisheye cameras (usually installed at the front, rear, left, and right of the vehicle). A fixed-size segment is then cut from the center of each fisheye image. Finally, a panoramic image is generated based on these segmented images and displayed to the driver, allowing them to see the surrounding environment more clearly, such as obstacles, pedestrians, and other vehicles, thereby improving driving safety.

[0036] However, due to installation errors of the fisheye camera, vehicle body deformation, and structural aging of the fisheye camera, the external parameters of the fisheye camera (such as its position and shooting direction) gradually change. The deviation between the content of the fisheye image captured by the fisheye camera and the content that the fisheye camera should capture at that location increases, ultimately leading to discrepancies in the panoramic image generated by the vehicle's display device based on the fisheye image, thus affecting safe driving. Please see... Figure 1 , Figure 1 This application provides a set of fisheye images, such as... Figure 1 As shown, (A) represents an image taken before the extrinsic parameters of the fisheye camera changed; (B) represents an image taken after the extrinsic parameters of the fisheye camera changed. By comparing... Figure 1 As can be seen from (A) and (B) in the figure, 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 cut area of ​​the fisheye image remains unchanged, the photographed object will be located in a non-central position of the cut area. The change in the position of the photographed object in the cut image will affect the accuracy of the panoramic display image of the vehicle, and thus affect the safety of driving the vehicle.

[0037] To address the aforementioned problems, this application provides a fisheye image cropping method. The method includes: setting a first coordinate and a second coordinate, wherein the positions of the first and second coordinates relative to the vehicle are fixed, the vertical distances of the first and second coordinates to the vehicle's centerline are the same, and they are located on opposite sides of the centerline; an 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 crops the fisheye image according to a cropping area and determines whether the photographed object is located at the center of the cropped image based on the first and second fisheye coordinates; if the photographed object is not located at the center of the cropped image, the electronic device adjusts the cropping area according to the first and second fisheye coordinates, and re-crops the fisheye image according to the adjusted cropping area; the electronic device performs the above determination on the cropped image again until the photographed object is located at the center of the cropped image.

[0038] It should be understood that although the external parameters of a fisheye camera will gradually change over time, the content of the fisheye image captured 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 captured by the fisheye camera in the current capture and the content of the fisheye image captured in the previous capture is small). Therefore, in the above method, when the external parameters of the fisheye camera change, the first fisheye coordinate and the second fisheye coordinate are still within 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 coordinate and the second fisheye coordinate, thereby ensuring that the position of the photographed object in the cutting image remains unchanged, and thus ensuring that the panoramic display image generated based on the cutting image will not have any deviation, thus ensuring the driving safety of the vehicle.

[0040] Please see Figure 2 , Figure 2 This is another set of fisheye images provided in this application, such as Figure 2 As shown, in the fisheye image segmentation method provided in this application, multiple coordinate points are set around the object being photographed, and these coordinate points are projected onto the fisheye image captured by the fisheye camera. Since the relative positions of the coordinate points and the object being photographed are fixed, the relative positions of the corresponding fisheye coordinates of the multiple coordinate points and the object being photographed in the fisheye image are also fixed after the extrinsic parameters of the fisheye camera are projected onto the fisheye image. Therefore, the fisheye coordinates corresponding to the multiple coordinate points on the fisheye image can be used to determine the position of the object being photographed. The segmentation area of ​​the fisheye image is adjusted according to the above-mentioned fisheye coordinate points. Even if the extrinsic parameters of the fisheye camera change, the position of the object being photographed in the segmented image remains unchanged.

[0041] The following is combined Figure 3 This application introduces a fisheye image segmentation method. Figure 3In the example below, the subject of the photograph is a vehicle; please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of a fisheye image cutting method provided in this application, such as... Figure 3 As shown, the method includes:

[0042] S301: Determine the first fisheye coordinates of the first coordinate in the fisheye diagram, and the second fisheye coordinates of the second coordinate in the fisheye diagram. The first and second coordinates are points around the vehicle, and their relative positions to the vehicle are constant; that is, the positions of the first and second coordinates remain unchanged relative to the vehicle during its movement. The first and second coordinates are symmetrical about the vehicle's central axis, meaning the perpendicular distances from the first and second coordinates to the vehicle's central axis are the same, and the first and second coordinates are located on opposite sides of the vehicle's central axis. The specific positions of the first and second coordinates can be determined by establishing a coordinate system. For example, a coordinate system can be established with the vehicle's top view as the plane, the vehicle's center as the origin, and the vehicle's central axis as the vertical axis. The first and second coordinates are two coordinate points symmetrical about the vertical axis within this coordinate system.

[0043] The first and second fisheye coordinates mentioned above are points on the fisheye image. By establishing a coordinate system on the fisheye image, the specific locations of the first and second fisheye coordinates can be determined. For example, if 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 and second fisheye coordinates are two coordinate points on this coordinate system.

[0044] The electronic device determines the first fisheye coordinates of the first coordinate in the fisheye image and the second fisheye coordinates of the second coordinate in the fisheye image, specifically by: the electronic device converting the first coordinate into the first fisheye coordinates in the fisheye image based on the intrinsic parameters of the fisheye camera and the calibrated extrinsic parameters; and the electronic device converting the second coordinate into the second fisheye coordinates in the fisheye image based on the intrinsic parameters of the fisheye camera and the calibrated extrinsic parameters. It should be noted that the electronic device can acquire the intrinsic parameters of the fisheye camera at any time. Since the extrinsic parameters of the fisheye camera change continuously with the environment, the electronic device uses the calibrated values ​​of the extrinsic parameters of the fisheye camera, i.e., the aforementioned calibrated extrinsic parameters.

[0045] In one possible embodiment, the first coordinate and the second coordinate can be coordinate points corresponding to a certain part of the vehicle in the coordinate system. For example, the first coordinate and the second coordinate can 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, respectively. Alternatively, the first coordinate and the second coordinate can 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, respectively.

[0046] In one possible embodiment, the electronic device will also determine the third fisheye coordinates in the fisheye diagram.

[0047] The third coordinate mentioned above refers to points around the vehicle, and their relative positions to the vehicle are constant. The specific location of the third coordinate can be determined by establishing a specific coordinate system. For example, a coordinate system can be 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 vertical axis. The third coordinate is a point in this coordinate system that is different from the first and second coordinates.

[0048] The aforementioned third fisheye coordinates are coordinate points on the fisheye diagram. By determining the corresponding third fisheye coordinates in the fisheye diagram, subsequent adjustments to the cutting area become more comprehensive. For example, the cutting area can be adjusted left and right based on the first and second fisheye coordinates; and the cutting area can be adjusted up and down based on the third fisheye coordinates.

[0049] It should be understood that since the positions of the first, second, and third coordinates remain unchanged relative to the vehicle, the positions of the corresponding fisheye coordinates in the fisheye image captured by the fisheye camera 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. Furthermore, the fisheye coordinates can be used to adjust the cut area of ​​the fisheye image corresponding to the fisheye camera in a timely manner, thereby ensuring that the position of the object being photographed in the cut image corresponding to the fisheye camera remains consistent. For example, suppose the original cut area is a square area with 25 pixels at the center of the fisheye image, and the object being photographed is at the center of this cut area. The first and second fisheye coordinates are located one pixel to the left and one pixel to the right of the center of the fisheye image, respectively, and the third fisheye coordinate is located one pixel to the right of the center of the fisheye image. After the external parameters of the fisheye camera change, the position of the object being photographed in the fisheye image changes. The electronic device determines the position of the object being photographed by using the positions of the first, second, and third fisheye coordinates, and adjusts the cut position according to the first, second, and third fisheye coordinates so that the object being photographed is located at the center of the new cut position.

[0050] S302: Obtain the first cut image of the fisheye image based on the cut area.

[0051] The aforementioned cut area can be understood as a region that the electronic device will cut out from the fisheye image. This region is usually located at or near the center of the fisheye image. For example, the cut area can be a square region containing 25 pixels, centered on the center of the fisheye image. The cut area is generally determined by the operator, but can also be adjusted by the electronic device. It should be noted that since the cut area will be adjusted subsequently, the cut image obtained from the fisheye image will be different depending on the cut area. The first cut image mentioned above is the cut image obtained from the fisheye image based on the initial cut area.

[0052] S303: Determine whether 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 is within a first range. If 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 is not within the first range, the electronic device determines that the cut area needs to be adjusted and executes step S304; if 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 is within the first range, the electronic device determines that the cut area does not need to be adjusted and executes step S305.

[0053] Since the first and second fisheye coordinates remain constant relative to the vehicle, the electronic device can determine the position of the first cut image in the fisheye image using the first and second fisheye coordinates. For example, assuming the first and second coordinates are located in front of the vehicle and are symmetrical about the vehicle's centerline, both the first and second fisheye coordinates are located in the first cut image within the center region of the fisheye image, and the vertical distances from the first and second fisheye coordinates to the centerline of the first cut image are the same. When the shooting direction of the fisheye camera changes from directly in front of the vehicle to the right front of the vehicle, the first and second fisheye coordinates in the fisheye image will shift to the left. If the first cut image continues to be captured in the center region of the fisheye image at this time, due to the shift of the first and second fisheye coordinates, the vertical distances from the first and second fisheye coordinates to the centerline of the first cut image will be different. The electronic device determines that the cut area needs to be adjusted and adjusts the cut area according to the first and second fisheye coordinates.

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

[0055] The first edge and the second edge mentioned above are two different edges. Since the object being photographed in this embodiment is a vehicle, and the first coordinate and the second coordinate are symmetrical about the central axis of the vehicle, 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 one possible embodiment, the electronic device further determines whether the vertical distance from the third fisheye coordinates to the third edge of the second cut image is within a second range; if the vertical distance from the third fisheye coordinates to the third edge of the second cut image is outside the second range, the cutting area is adjusted according to the third fisheye coordinates to obtain a third cut image of the fisheye image, so that the vertical distance from the third fisheye coordinates to the third edge of the second cut image is within the second range. It should be understood that the second cut image is a cut image of the fisheye image obtained by the electronic device based on the adjusted cutting area after adjusting the cutting area according to the first and second fisheye coordinates.

[0057] The aforementioned third edge is one of 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 centerline of the vehicle in the fisheye image, the third edge can be one of the two edges that are perpendicular to the centerline of the vehicle in the fisheye image, and it can be the upper edge or the lower edge.

[0058] Since only the first and second fisheye coordinates can be used to adjust the cutting area in a single direction, when the fisheye camera is offset in other directions, the electronic device also needs to adjust the cutting area in other directions. For example, if the first and second fisheye coordinates are used to adjust the cutting area horizontally, and the fisheye camera is offset vertically, then the cutting area also needs to be adjusted vertically. By setting a third coordinate and a second range, the cutting area can be adjusted in more directions, meeting the centering cutting requirements of fisheye images in more scenarios.

[0059] It should be understood here that due to image processing errors, electronic devices need to set an error range when comparing vertical distances. 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, a first range is set. When the difference between the first and second vertical distances is within the first range, it indicates that the parameters of the fisheye camera have not changed significantly, and the current cutting area is still at the center of the fisheye image. Centering the fisheye image can be achieved through this cutting area. When the difference between the first and second vertical distances is not within the first range, it indicates that the parameters of the fisheye camera have changed significantly, and the cutting area needs to be readjusted. The interval of the first range is [a, b], where a can be a positive or negative number, and b must be greater than a. For example, the first range can be [-1, 1], [0, 1], [0, 2], or [-5, 10]. This application does not specifically limit the interval of the first range. The same applies to the second range, which will not be elaborated here.

[0060] In one possible embodiment, after the electronic device cuts the fisheye image according to the cutting area to obtain a first cut image, it also scales the first cut image to obtain a first scaled image. Then, it determines the first scaling coordinates corresponding to the first fisheye coordinates in the first scaled image, the second scaling coordinates corresponding to the second fisheye coordinates in the first scaled image, and the third scaling coordinates corresponding to the third fisheye coordinates in the first scaled image. After obtaining the first scaling coordinates, the second scaling coordinates, and the third scaling coordinates, the electronic device further determines whether the difference between the third vertical distance between the first scaling coordinates and the central axis of the first scaled image and the fourth vertical distance between the second scaling coordinates and the central axis of the first scaled image is within a third range, and whether the vertical distance from the third scaling coordinates to the third edge of the first scaled image is within a fourth range. If 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 coordinates to the third edge of the first scaled image is outside the fourth range, the cutting area is adjusted to obtain a fourth cut 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 coordinates to the third edge of the first scaled image is within the fourth range. It should be understood here that the fourth cut image is a fisheye image obtained by the electronic device after adjusting the cut area according to the first scaling coordinate, the second scaling coordinate, and the third scaling coordinate.

[0061] The selection of the third and fourth ranges is similar to that of the first range, but the specific values ​​are different from those of the first range. This application will not elaborate further on these points.

[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 from the cutting area needs to be scaled by a certain proportion before it can be used later. When scaling the cutting image, if it is not scaled proportionally, the position of its internal structure 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 first fisheye coordinate, the second fisheye coordinate, the third fisheye coordinate, the scaled coordinates, and the scaled cutting image.

[0063] Below, using a specific fisheye image example, we will explain how electronic devices determine whether the cut area needs adjustment. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a sliced ​​image provided in this application, such as... Figure 4 As shown, in this cut image, the object being photographed is located slightly to the left (assuming that the object should be located in the center of the cut image corresponding to the fisheye camera). There are three fisheye coordinates in this cut image, including fisheye coordinate 1, fisheye coordinate 2 and fisheye coordinate 3. 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. Fisheye coordinate 1 and fisheye coordinate 2 are symmetrical about the central axis of the object being photographed.

[0064] The electronic device segments the fisheye image according to the cutting area to obtain, such as Figure 4 After the image is cut as shown, the electronic device determines whether the cut area needs adjustment based on fisheye coordinates 1, 2, and 3, including:

[0065] The electronic device determines whether the difference between L1 and L3 falls within a first range. For example, if the first range is [-2, 2], and 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 needs to be adjusted;

[0066] The electronic device determines whether L2 is within the second range. For example, if 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 cut area shown needs to be adjusted.

[0067] When the electronic device determines that the difference between L1 and L3 is within a first range and L2 is within a second range, the electronic device determines... Figure 4The cut area shown does not need adjustment. For example, in the first range [-2, 2], L1 is 5, L2 is 3, and L3 is 6. In the second range [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 need to be adjusted.

[0068] S304: Based on the first fisheye coordinates and the second fisheye coordinates, adjust the cutting area to obtain the second cut image of the fisheye image.

[0069] After determining that the cutting area needs adjustment based on the first fisheye coordinates and the second fisheye coordinates, the electronic device adjusts the cutting area according to the first fisheye coordinates and the second fisheye coordinates, and then cuts the fisheye image according to the adjusted cutting area to obtain a new cut image (i.e., the second cut image). After obtaining the second cut image, the electronic device returns to step S303. It should be understood that when the electronic device obtains the second cut image and executes step S303, it determines whether the difference between the vertical distance between the first fisheye coordinates and the central axis of the second cut image and the second vertical distance between the second fisheye coordinates and the central axis of the second cut image is within a first range. That is, after adjusting the cutting area, the electronic device will perform the determination as in step S303 on the cut image corresponding to the adjusted cutting area.

[0070] In one possible embodiment, the electronic device adjusts the cutting area based on the first fisheye coordinates and the second fisheye coordinates in the following two ways:

[0071] Method 1: If 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 side of the first edge and the second edge of the cut area closest to the first fisheye coordinate is expanded outward by one or more pixel units, or the side of the first edge and the second edge of the cut area closest to the second fisheye coordinate is reduced inward by one or more pixel units.

[0072] Method 2: If the vertical distance from the first fisheye coordinate to the central axis of the cut image is less than the vertical distance from the second fisheye coordinate to the central axis of the cut image, reduce the side of the first edge and the second edge of the cut area closer to the first fisheye coordinate by one or more pixels, or expand the side of the first edge and the second edge of the cut area closer to the second fisheye coordinate by one or more pixels.

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

[0074] If 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 by one or more pixel units, or the second edge of the cut area is shrunk inward by one or more pixel units; or if 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 by one or more pixel units, or the first edge of the cut area is shrunk inward by one or more pixel units.

[0075] In one possible embodiment, the aforementioned electronic device may also adjust the cutting area according to the third fisheye coordinates, and the adjustment method may be:

[0076] If 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 region will be reduced inward by one or more pixel units.

[0077] If the vertical distance from the third fisheye coordinate to the third edge of the cut image is less than the second range, the third edge of the cut region is expanded outward by one or more pixel units.

[0078] It should be understood that the cutting area can also be adjusted by moving its position or other means. For example, if 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 by one or more pixels, while the second edge of the cutting area can be shrunk inward by one or more pixels. This application does not make 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. Through continuous adjustments, the position of the photographed object in the cutting area is eventually made consistent with the position of the photographed object in the cutting area before the external parameters of the fisheye camera changed.

[0080] S305: Determine if the cut image of the fisheye diagram meets the requirements.

[0081] Since the difference between the first vertical distance and the second vertical distance is within the first range, it indicates that the object being photographed is at the center of the cut image. The electronic device determines that the object being photographed is at the center of the cut image and sends the cut image to the display device in the vehicle. The display device generates a deviation-free panoramic display image based on the cut image.

[0082] In summary, by implementing the fisheye image segmentation method provided in this application, when the external parameters of the fisheye camera change, the segmentation area of ​​the fisheye image is adjusted through the first fisheye coordinate and the second fisheye coordinate, thereby ensuring that the photographed object remains in the center of the segmented image, and thus ensuring that the panoramic display image generated based on the segmented image will not have any deviation, thereby ensuring the driving safety of the vehicle.

[0083] See Figure 5 , Figure 5 This is a schematic diagram of a fisheye image cutting device provided in this 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 the first fisheye coordinates of the first coordinate in the fisheye diagram and the second fisheye coordinates of the second coordinate in the fisheye diagram, 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.

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

[0086] The adjustment unit 503 is used to adjust the cutting area to obtain a second cut image of the fisheye image based on 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 cut image and the second fisheye coordinate and the central axis of the second cut image is within the first range.

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

[0088] In one possible embodiment, the adjustment unit 503 is specifically configured to: when the first vertical distance is greater than the second vertical distance, expand the side of the first edge and the second edge of the cutting region closer to the first fisheye coordinate outward by one or more pixel units, or reduce the side of the first edge and the second edge of the cutting region closer 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 the side of the first edge and the second edge of the cutting region closer to the first fisheye coordinate inward by one or more pixel units, or expand the side of the first edge and the second edge of the cutting region closer to the second fisheye coordinate outward by one or more pixel units, wherein the first edge and the second edge are edges parallel to the central axis of the first cut image.

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

[0090] In one possible embodiment, the acquisition unit 501 is further configured to determine the third fisheye coordinates in the fisheye image, wherein the third coordinates remain unchanged relative to the photographed object; the processing unit 502 is further configured to determine whether the vertical distance from the third fisheye coordinates to the third edge of the second cut image is within a second range, wherein the third edge of the cut area is an edge perpendicular to the central axis of the second cut image; the adjustment unit 503 is further configured to adjust the cut area of ​​the acquired fisheye image according to the third fisheye coordinates when the vertical distance from the third fisheye coordinates to the third edge of the second cut image is outside the second range, so that the vertical distance from the third fisheye coordinates to the third edge of the second cut image is within the second range.

[0091] In one possible embodiment, the adjustment unit 503 is specifically used to: reduce the entire third edge of the cutting region 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 greater than the second range; and expand the entire third edge of the cutting region outward 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.

[0092] In one possible embodiment, the fisheye image cutting device 500 further includes a scaling unit, which is configured to: scale the first cutting image to obtain a first scaled image; determine a first scaling coordinate of the first fisheye coordinate in the first scaled image, a second scaling coordinate of the second fisheye coordinate in the first scaled image, and a third scaling coordinate of the third fisheye coordinate in the first scaled image; determine whether the difference between the third vertical distance of the first scaling coordinate and the central axis of the first scaled image and the fourth vertical distance of the second scaling coordinate and the central axis of the first scaled image is within a third range; determine whether the vertical distance of the third scaling coordinate to the third edge of the first scaled image is within a fourth range; if the difference between the third vertical distance of the first scaling coordinate and the central axis of the first scaled image and the fourth vertical distance of the second scaling coordinate and the central axis of the first scaled image is outside the third range, or the vertical distance of the third scaling 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 of the third scaling coordinate to the third edge of the first scaled image is within the fourth range.

[0093] The functional units of the fisheye image cutting device 500 can be used to achieve Figure 3 The methods performed by electronic devices. Figure 3 For example, the acquisition unit 501 can be used to execute... Figure 3 In step S301, the processing unit 502 can be used to execute Figure 3 In step S302, the adjustment unit 503 can be used to perform... Figure 3 Steps S303 and S304 in the process.

[0094] This explains that, Figure 5 The acquisition unit 501, processing unit 502, and adjustment unit 503 in the fisheye image cutting device 500 are merely examples provided in this application. In specific implementations, 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 differs from the size of the original fisheye image, in most scenarios, the cut image needs to be scaled by a certain proportion before it can be used later.

[0095] See Figure 6 , Figure 6This is a schematic diagram of the structure of an electronic device provided in this application. The electronic device 600 includes a processor 601, a memory 602, a communication interface 603, and a bus 604. The processor 601, memory 602, and communication interface 603 can be interconnected through the internal bus 604, or they can communicate through wireless transmission or other means.

[0096] Processor 601 may consist of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and hardware chips. The hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLDs may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof. Processor 601 is used to execute various types of digital storage instructions. Processor 601 can implement, by executing corresponding instructions, functions such as... Figure 3 The method shown.

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

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

[0099] It needs to be explained that, Figure 6This is merely one possible implementation of the embodiments of this application. In actual applications, the electronic device 600 may include more or fewer components, which is not limited here.

[0100] See Figure 7 , Figure 7 This is a structural schematic diagram of a vehicle provided in this application, such as... Figure 7 As shown, the vehicle is equipped with the aforementioned electronic device 600, and the above-mentioned functions can be achieved through the electronic device 600. Figure 3 The method shown.

[0101] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a microcontroller to perform some or all of the steps of any of the methods described in the above method embodiments.

[0102] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0103] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0104] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0106] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0107] If the integrated unit is implemented as 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 this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a device (which may be a personal computer, server, network device, robot, microcontroller, chip, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0108] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for cutting fisheye images, characterized in that, The method includes: A first fisheye coordinate and a second fisheye coordinate are determined in the fisheye diagram, wherein the first coordinate and the second coordinate remain unchanged relative to the object being photographed, and the vertical distance between the first coordinate and the central axis of the object being photographed and the vertical distance between the second coordinate and the central axis of the object being photographed are the same, and the first coordinate and the second coordinate are located on different sides of the central axis of the object being photographed. The first cut image of the fisheye image is obtained according to the cut area, and it is determined whether 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 is within a first range. If 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 the 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 is within the first range. If the difference between the first vertical distance and the second vertical distance is within the first range, the object being photographed is determined to be located at the center of the first cut image.

2. The method according to claim 1, characterized in that, The step of adjusting the cutting area based on the first fisheye coordinates and the second fisheye coordinates includes: If the first vertical distance is greater than the second vertical distance, the side of the first edge and the second edge of the cutting region closest to the first fisheye coordinate is expanded outward by one or more pixel units, or the side of the first edge and the second edge of the cutting region closest to the second fisheye coordinate is reduced inward by one or more pixel units; or... When the first vertical distance is less than the second vertical distance, the side of the first edge and the second edge of the cutting region closest to the first fisheye coordinate is reduced inward by one or more pixel units, or the side of the first edge and the second edge of the cutting region closest to the second fisheye coordinate is expanded outward by one or more pixel units, wherein the first edge and the second edge are edges parallel to the central axis of the first cut image.

3. The method according to claim 1, characterized in that, The step of adjusting the cutting area based on the first fisheye coordinates and the second fisheye coordinates includes: If the vertical distance from the first fisheye coordinate to the first edge of the first cut image is greater than the vertical distance from the second fisheye coordinate to the second edge of the first cut image, then the second edge of the cut region is expanded outward by one or more pixel units, or the first edge of the cut region is reduced inward by one or more pixel units; or... When the vertical distance from the first fisheye coordinate to the first edge of the first cut image is less than the vertical distance from the second fisheye coordinate to the second edge of the first cut image, the first edge of the cut area is expanded outward by one or more pixel units, or the second edge of the cut area is shrunk inward by one or more pixel units. The first edge and the second edge are edges parallel to the central axis of the first cut image.

4. The method according to claim 1, characterized in that, The method further includes: Determine the third coordinate in the fisheye image, wherein the third coordinate remains constant relative to the photographed object; Determine whether the vertical distance from the third fisheye coordinate to the third edge of the second cut image is within a second range, wherein the third edge is an edge perpendicular to the central axis of the second cut image; If the vertical distance from the third fisheye coordinate to the third edge of the second cut image is outside the second range, the cutting area is adjusted according to the third fisheye coordinate to obtain the third cut image of the fisheye image, so that the vertical distance from the third fisheye coordinate to the third edge of the second cut image is within the second range.

5. The method according to claim 4, characterized in that, The step of adjusting the cutting region based on the third fisheye coordinates to obtain the third cut image of the fisheye image includes: If the vertical distance from the third fisheye coordinate to the third edge of the second cut image is greater than the second range, the third edge of the cut region is reduced inward by one or more pixel units. If the vertical distance from the third fisheye coordinate to the third edge of the second cut image is less than the second range, the third edge of the cut region is expanded outward by one or more pixel units.

6. The method according to claim 4 or 5, characterized in that, After obtaining the first cut image of the fisheye image based on the cut region, the method further includes: The first cut image is scaled up to obtain a first scaled image, and the first scaled coordinates of the first fisheye coordinates, the second scaled coordinates of the second fisheye coordinates, and the third scaled coordinates of the third fisheye coordinates in the first scaled image are determined. Determine 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; determine whether the vertical distance from the third scaling coordinate to the third edge of the first scaling image is within a fourth range; If 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 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 cut 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.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing computer program instructions, and the processor executing the computer program instructions to implement the method as described in any one of claims 1-6.

8. A vehicle, characterized in that, The vehicle includes the electronic equipment as described in claim 7.

9. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-6.

Citation Information

Patent Citations

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

    CN115250329A

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

    CN118525295A