Correction methods, devices, and storage media for underwater photographs
By dividing underwater images into regions and adjusting the field of view, the problem of black borders in underwater photography was solved, thus improving the stitching quality of panoramic images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2026-03-06
AI Technical Summary
Underwater panoramic images suffer from black borders due to the reduced field of view (FOV) of the lens and the stitching limitations in the underwater hull mode, affecting the quality of the image stitching.
By dividing the image to be corrected into regions, detecting the distribution of pixels in different regions, setting the field of view coefficient, and adjusting the field of view, black border areas are eliminated, thus achieving a buffered gradient.
It improves the stitching quality of underwater panoramic images, avoids obvious visual differences and black border areas, and enhances the stitching effect.
Smart Images

Figure CN115797210B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a correction method, apparatus and storage medium for underwater photographs. Background Technology
[0002] In underwater shooting scenarios, because water has a higher refractive index than air, light entering the lens is refracted, resulting in a reduced field of view (FOV). Furthermore, to ensure the panoramic camera can function properly underwater, it needs to be protected by a submersible housing. However, when using the submersible housing mode, optical flow stitching cannot be used; only the camera parameters calibrated by the manufacturer can be used for stitching. Additionally, images shot in submersible housing mode will have some scene loss at the stitching seams, resulting in black borders and incomplete images. Summary of the Invention
[0003] This application provides a correction method, apparatus, and storage medium for underwater photographs, aiming to eliminate black border areas in underwater photographs to improve the stitching quality of underwater panoramic images.
[0004] In a first aspect, this application provides a correction method for underwater photographs, the correction method for underwater photographs comprising the following steps:
[0005] Acquire underwater images from a panoramic camera that require calibration;
[0006] Based on a preset division angle, the image to be corrected is divided into regions to obtain a first distribution region;
[0007] Expand the image to be corrected to obtain an expanded image, and divide the expanded image into regions based on the distribution position of the black borders in the expanded image to obtain a second distribution region;
[0008] The distribution positions of each pixel in the image to be corrected in the first distribution region and the second distribution region are detected, and the field of view coefficients corresponding to each pixel are set.
[0009] Based on the field of view coefficients corresponding to each pixel, the field of view of each pixel in the image to be corrected is adjusted to obtain a corrected image.
[0010] Secondly, this application also provides a correction device for underwater image capture, the correction device for underwater image capture comprising:
[0011] The image acquisition module is used to acquire underwater images that need to be corrected by the panoramic camera.
[0012] The image region segmentation module is used to segment the image to be corrected into regions based on a preset segmentation angle to obtain a first distribution region.
[0013] The image expansion module is used to expand the image to be corrected, obtain the expanded image, and divide the expanded image into regions based on the distribution position of the black borders in the expanded image to obtain a second distribution region;
[0014] The field of view coefficient setting module is used to detect the distribution position of each pixel in the image to be corrected in the first distribution area and the second distribution area, and set the field of view coefficient corresponding to each pixel;
[0015] The image correction module is used to adjust the field of view of each pixel in the image to be corrected based on the field of view coefficient corresponding to each pixel, so as to obtain a corrected image.
[0016] Thirdly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the correction method for underwater image capture described above.
[0017] This application provides a method, apparatus, and storage medium for correcting underwater photographs. The method includes acquiring an underwater image to be corrected taken by a panoramic camera; dividing the image to be corrected into regions based on a preset division angle to obtain a first distribution region; unfolding the image to be corrected to obtain an unfolded image, and dividing the unfolded image into regions based on the black border distribution positions in the unfolded image to obtain a second distribution region; detecting the distribution positions of each pixel in the image to be corrected within the first and second distribution regions, and setting a field-of-view coefficient corresponding to each pixel; and adjusting the field-of-view angle of each pixel in the image to be corrected based on the field-of-view angle coefficients corresponding to each pixel to obtain a corrected image. Through this method, by dividing the image to be corrected into regions, regions with different effects from the black border distribution positions are distinguished, thereby facilitating targeted field-of-view angle adjustments for each distribution region. By detecting the position of each pixel in the first and second distribution regions of the image to be corrected, different field-of-view coefficients are adjusted for pixels at different distribution positions, causing pixels near the black border distribution position to expand, thereby avoiding the appearance of black border areas and achieving a buffered transition from the expanded pixel area to the normal area, avoiding obvious visual differences in the corrected image, and thus improving the stitching quality of panoramic images. Attached Figure Description
[0018] 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.
[0019] Figure 1 A correction system for underwater image capture is provided as an embodiment of this application;
[0020] Figure 2 A schematic flowchart illustrating a first embodiment of a correction method for underwater photographs provided in this application;
[0021] Figure 3 This application provides a schematic diagram of the region division for underwater spherical image capture.
[0022] Figure 4 This application provides a schematic diagram of the region division of a rectangular unfolded image of an underwater photograph as an embodiment of the present application.
[0023] Figure 5 A schematic flowchart illustrating a second embodiment of a correction method for underwater photographs provided in this application;
[0024] Figure 6 This is a schematic block diagram of a correction device for underwater image capture provided in an embodiment of this application;
[0025] Figure 7 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0026] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0029] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0030] The embodiments of this application provide a correction method, a correction device, and a storage medium for underwater photographs, used to eliminate black border areas in underwater photographs to improve the stitching quality of underwater panoramic images.
[0031] like Figure 1 As shown, Figure 1 An embodiment of this application provides a correction system for underwater image capture. The system includes a terminal and a server, which are communicatively connected. The server is communicatively connected to an underwater image capture application.
[0032] The terminals include electronic devices such as mobile phones, tablets, laptops, desktop computers, personal digital assistants, and wearable devices.
[0033] The server may be a single independent server or a server cluster.
[0034] The underwater photography applications include panoramic camera equipment, diving hulls, and communication equipment.
[0035] The following will provide a detailed description of the correction method for underwater photography provided in the embodiments of this application, based on the correction system for underwater photography.
[0036] Please refer to Figure 2 , Figure 2 This is a schematic flowchart illustrating a first embodiment of a correction method for underwater photographs provided in this application. This correction method for underwater photographs can be used in the terminal of an underwater photograph correction system.
[0037] like Figure 2 As shown, the correction method for underwater images includes steps S101 to S105.
[0038] Step S101: Obtain the image to be calibrated taken by the panoramic camera underwater;
[0039] In this embodiment, the images captured underwater by the panoramic camera can be sent to the server via remote communication; alternatively, the images can be downloaded from the panoramic camera's memory after underwater shooting is completed. This can be done via wired transmission, such as USB, or wireless transmission, such as WIFI.
[0040] In one embodiment, the panoramic camera includes at least two cameras; images captured by multiple cameras need to be stitched together, but each image to be corrected is generally corrected separately, i.e., corrected before being stitched together.
[0041] Step S102: Based on a preset division angle, the image to be corrected is divided into regions to obtain a first distribution region;
[0042] In this embodiment, as Figure 3 As shown, fisheye lens imaging typically involves spherical perspective projection, which projects points in three-dimensional space along a straight line passing through the lens's optical center onto the inner surface of a sphere of unit radius with the optical center as the origin, thus forming a circular image. Based on the location of the black border area, the circular image to be corrected can be divided into regions.
[0043] In one embodiment, when a panoramic camera in a submersible hull takes a picture, the bottom part of the image may be cropped. In this case, a certain angle range at the center of the circular image to be corrected can be used as the first distribution area.
[0044] In one embodiment, the first distribution area can be defined as the 90° range directly below the center of the circular image to be corrected, and the first distribution area can completely include the cropped image.
[0045] Step S103: Expand the image to be corrected to obtain an expanded image, and divide the expanded image into regions based on the distribution position of the black borders in the expanded image to obtain a second distribution region;
[0046] In this embodiment, the circular fisheye image can be unfolded into a rectangular planar image according to latitude and longitude. At this time, the part of the image that is cropped in the circular graphic is displayed as the black border area on the rectangular planar image. Based on the distribution position of the black border area, the image to be corrected is divided into regions to obtain the second distribution area.
[0047] In one embodiment, the second distribution area includes a black border connection area, a buffer area, and a normal area.
[0048] In one embodiment, such as Figure 4 As shown, the image region can be divided according to angles, with the center of the expanded rectangular image to be corrected as the vertex. For example, the image region within a 100° angle (-40° to -140°) directly below the vertex can be designated as the black border connection region 10, which includes most of the black border region. On both sides of the black border connection region, a 15° angle range can be divided, namely -25° to -40° and -140° to -155°, as the buffer region 20, and the other image regions can be designated as the normal region 30.
[0049] In one embodiment, because fisheye lens imaging is achieved through spherical perspective projection, each image pixel on the sphere can be represented by corresponding latitude and longitude coordinates. Points projected onto the sphere can be further projected onto the imaging plane according to a specific fisheye projection model to obtain the corresponding fisheye image. Therefore, the fisheye image correction process essentially involves finding the fisheye image coordinates corresponding to each latitude and longitude on the sphere, thereby obtaining the pixel information at that latitude and longitude through interpolation, and then unfolding the sphere into the desired planar image.
[0050] In one embodiment, spherical unfolding is typically based on an equirectangular model, also known as an equidistant cylindrical projection model, which unfolds the sphere into a rectangular grid, wherein the size of the grid is proportional to the size of the corresponding longitude and latitude interval.
[0051] In one embodiment, the process of projecting a point on a sphere onto the camera's imaging plane through a fisheye lens to obtain a fisheye image is typically based on the principle of light refraction. That is, light rays refract upon entering the fisheye lens, and the distance *r* between the point of impact on the imaging plane and the optical axis is related to the angle between the incident ray and the optical axis, i.e., the incident angle θ. The point of impact lies on the plane formed by the incident ray and the optical axis. Different functional relationships *r = f(θ)* correspond to different fisheye projection models.
[0052] In one embodiment, the distance from the point of impact to the optical axis in equidistant or equiangular projection is linearly proportional to the angle of incidence, so that the same angular difference corresponds to the same distance difference.
[0053] It is understood that this embodiment is merely an example of methods such as equidistant projection for specific explanation, in order to facilitate understanding by those skilled in the art. It does not mean that the image unfolding method described in this embodiment is limited to these two methods, but may also be other methods that can be used to unfold images captured by fisheye lenses.
[0054] Step S104: Detect the distribution position of each pixel in the image to be corrected in the first distribution region and the second distribution region, and set the field of view coefficient corresponding to each pixel;
[0055] In this embodiment, the distribution position of each pixel in the image to be corrected is detected in the first distribution region and the second distribution region, and different field of view coefficients are set for each pixel according to its different position.
[0056] In one embodiment, when the distribution position of each pixel is located in the first distribution area and in the black border connection area, the field of view coefficient corresponding to each pixel is set to a first coefficient; when the distribution position of each pixel is located in the first distribution area and in the buffer area, the field of view coefficient corresponding to each pixel is set to a buffer coefficient, wherein the buffer coefficient is a field of view coefficient between the first coefficient and the second coefficient; when the distribution position of each pixel is located in the normal area, the field of view coefficient corresponding to each pixel is set to 1.
[0057] In one embodiment, the first coefficient is greater than 1 and less than the second coefficient.
[0058] In one embodiment, the actual field of view (FOV) of a fisheye lens when shooting underwater is smaller than its FOV in air. Therefore, the actual FOV value for underwater shooting needs to be expanded during deployment. The field of view coefficient for images taken by the fisheye lens in air can be set to 1, while the second coefficient is the field of view coefficient for underwater shooting.
[0059] In one embodiment, when performing panoramic unfolding, the position of each pixel is determined. If the pixel falls within the first distribution area and is located within the black border connection area, the focal length is multiplied by the first coefficient Y (X>Y>1) to ensure that no black border is exposed. If the pixel is within the first distribution area and within the buffer area, the coefficient is smoothly transitioned between the second coefficient X and the first coefficient Y to ensure the continuity of the stitching.
[0060] Step S105: Based on the field of view coefficients corresponding to each pixel, adjust the field of view of each pixel in the image to be corrected to obtain a corrected image.
[0061] In this embodiment, the field of view of each pixel is adjusted according to the field of view parameters corresponding to each pixel, thereby obtaining a rectangular corrected image without black borders.
[0062] This embodiment provides a correction method for underwater images. The method divides the image to be corrected into regions, distinguishing areas affected by the distribution of black borders, thus facilitating targeted field-of-view adjustments for each region. By detecting the positions of each pixel in the image to be corrected within the first and second distribution regions, different field-of-view coefficients are adjusted for pixels at different positions. This causes pixels near the black border distribution to expand, thereby avoiding black border areas and providing a gradual transition from the expanded pixel area to the normal area. This prevents significant visual differences in the corrected image, improving the stitching quality of panoramic images.
[0063] Please refer to Figure 5 , Figure 5This is a flowchart illustrating a second embodiment of a correction method for underwater photographs provided in this application.
[0064] Based on the above Figure 2 In the illustrated embodiment, prior to step S101, the method further includes:
[0065] Step S201: Obtain the images to be stitched from the two underwater cameras of the panoramic camera;
[0066] Step S202: Based on the shooting distance between the main shooting object and the corresponding shooting lens in the normal area of each image to be stitched, determine the stitching field of view parameters corresponding to each image to be stitched;
[0067] In this embodiment, each FOV (field of view) is matched with an optimal shooting distance at which the image distortion in the frame will be less than a set value. This distortion is determined by the difference between the image being shot in the center of the lens and the image being shot at the edge.
[0068] In one embodiment, in the images to be stitched by the underwater camera, the normal area has the smallest pixel deformation, which means that the shooting distance of the main shooting object in the normal area is more accurate. Therefore, for the images to be stitched by the underwater camera, using the normal area in the image as the alignment basis will result in better stitching effect and stitching quality.
[0069] In one embodiment, before setting the target field of view parameters for each image to be stitched, it is necessary to detect the shooting distance between the main shooting object in the normal area of each image to be stitched and the corresponding shooting lens, and find the optimal field of view parameter corresponding to the shooting distance according to the preset field of view parameter table.
[0070] In optical engineering, the field of view (FOV) refers to the angular range within which a camera can receive images in a typical environment. The size of the FOV determines the field of view of an optical instrument; a larger FOV results in a wider field of view but a smaller optical magnification. The FOV is also expressed as the image height (EFL) * tan(0.5FOV), where EFL is the focal length and FOV is the field of view.
[0071] Furthermore, based on the above Figure 3 In the aforementioned embodiment, step S202 specifically includes:
[0072] When multiple main objects are present in the normal area of each image to be stitched, the priority of each main object is determined based on its position in each image to be stitched.
[0073] Based on the priority of each main shooting object and the shooting distance between each main shooting object and the corresponding shooting lens, the priority shooting distance corresponding to each image to be stitched is determined;
[0074] Based on the preferred shooting distance and the preset field of view parameter table, the field of view parameter corresponding to the preferred shooting distance is determined as the stitching field of view parameter corresponding to each image to be stitched.
[0075] In this embodiment, there are multiple feature objects, i.e., main shooting objects, in the field of view captured by the camera. They are distributed in different positions in the image to be stitched. For fisheye lenses, the deformation of main shooting objects in different positions will vary greatly, and their impact on the calculation of field of view angle parameters will also be different. Therefore, it is necessary to determine the priority of each main shooting object according to the degree of influence of each main shooting object on the stitching effect.
[0076] In one embodiment, the priority of the main photographed object gradually increases from the center position of each image to be stitched to the seam position of each image to be stitched, wherein the main photographed object located at the seam position has the highest priority.
[0077] In one embodiment, the pixel deformation at the edge of the fisheye lens is greater than that at the center of the image. That is, the main object being photographed at the center is the most accurate in calculating its distance from the lens. The pixel deformation increases as the image moves closer to the edge, with the largest pixel deformation at the seam. This means that the shooting distance corresponding to the main object at the seam is less accurate, so the main object at the seam needs to be optimized. At the same time, the main object at the seam is also the main reference when stitching two adjacent images. To improve the stitching effect, the main object at the seam needs to be corrected first, so the main object at the seam has the highest priority.
[0078] In one embodiment, when the main subject in each image to be stitched is determined, the shooting distance between the main subject in each image and its corresponding shooting lens is comprehensively considered to calculate a shooting distance that can adjust all images to be stitched to the closest deformation, which is then used as the sole priority shooting distance for all images to be stitched.
[0079] Step S203: Based on the preset field of view parameter table and the stitching field of view parameters, adjust the field of view parameters of the images to be stitched corresponding to each shooting lens to obtain the images to be corrected corresponding to each shooting lens.
[0080] In one embodiment, a preset field of view parameter table is compared to find the field of view parameter corresponding to the priority shooting distance. This field of view parameter is the target field of view parameter corresponding to each image to be stitched.
[0081] In one embodiment, each image to be stitched can be adjusted using the target field of view parameter so that the seams of each image to be stitched can be aligned after the field of view parameter is adjusted.
[0082] In one embodiment, in a preset field of view parameter table, each field of view parameter table corresponds to an optimal shooting distance and depth of field range, forming a shooting distance range. Shooting distances within this shooting distance range all correspond to the corresponding field of view parameter. For example, if the field of view parameter is 193°, its corresponding optimal shooting distance is 2.25m, and the depth of field is 0.1m, then its corresponding shooting distance range is 2.2m-2.3m. Shooting distances within this range (such as 2.23m) all correspond to the field of view parameter 193°.
[0083] To further optimize the stitched image, the step of determining the stitching field of view parameters for each image to be stitched, based on the shooting distance between the main object and the corresponding camera lens within the normal area of each image to be stitched, may further include:
[0084] Based on the shooting distance between the main subject and the corresponding camera lens within the normal area of adjacent images to be stitched, the shooting distance difference between adjacent images is obtained. When the shooting distance difference between adjacent images is less than a preset distance difference (or a preset FOV value difference), the target FOV parameters corresponding to the normal areas of the adjacent images can be determined based on their respective shooting distances and a preset FOV parameter table. In other words, different FOV values between two adjacent images can better ensure the display quality of each image; simultaneously, a small shooting distance difference or a small FOV value difference between two adjacent images can better ensure the stitching quality between them.
[0085] In one embodiment, after optimizing the FOV of the images to be stitched, the images to be stitched are stitched together by the image stitching module to obtain the target image, i.e., the panoramic image.
[0086] In one embodiment, the image stitching module may include an image stitching algorithm or an existing vision module, such as an image stitching Stitching module.
[0087] In one embodiment, the image stitching steps basically include: feature point extraction and matching, image registration, projection transformation, seam calculation, and image fusion. First, robust feature points are extracted from the input image, and feature point matching is performed based on feature descriptors. Then, the positional relationship between adjacent images is obtained based on the matched feature points, and image registration is performed. Since direct image registration would disrupt the consistency of the field of view, the image is first projected onto a spherical or cylindrical surface. Finally, the seam between adjacent images is calculated, and the overlapping areas are fused to obtain the final panoramic image.
[0088] Please see Figure 6 , Figure 6 This is a schematic block diagram of a correction device for underwater image capture provided in an embodiment of this application. This correction device for underwater image capture is used to perform the aforementioned correction method for underwater image capture. The correction device for underwater image capture can be configured in a server or a terminal.
[0089] like Figure 6 As shown, the correction device 300 for underwater image capture includes: an image acquisition module 301, an image region division module 302, an image unfolding module, a field of view coefficient setting module 304, and an image correction module 305.
[0090] Image acquisition module 301 is used to acquire underwater images to be corrected taken by a panoramic camera;
[0091] Image region segmentation module 302 is used to segment the image to be corrected into regions based on a preset segmentation angle to obtain a first distribution region;
[0092] Image unfolding module 303 is used to unfold the image to be corrected, obtain an unfolded image, and divide the unfolded image into regions based on the distribution position of black borders in the unfolded image to obtain a second distribution region;
[0093] The field of view coefficient setting module 304 is used to detect the distribution position of each pixel in the image to be corrected in the first distribution area and the second distribution area, and set the field of view coefficient corresponding to each pixel.
[0094] Image correction module 305 is used to adjust the field of view of each pixel in the image to be corrected based on the field of view coefficient corresponding to each pixel, so as to obtain a corrected image.
[0095] In one embodiment, the second distribution area includes a black border connection area, a buffer area, and a normal area.
[0096] In one embodiment, the field of view coefficient setting module 304 is further configured to: set the field of view coefficient corresponding to each pixel to a first coefficient when the distribution position of each pixel is located in the first distribution area and in the black border connection area; set the field of view coefficient corresponding to each pixel to a buffer coefficient when the distribution position of each pixel is located in the first distribution area and in the buffer area, wherein the buffer coefficient is a field of view coefficient between the first coefficient and the second coefficient; and set the field of view coefficient corresponding to each pixel to 1 when the distribution position of each pixel is located in the normal area.
[0097] In one embodiment, the first coefficient is greater than 1 and less than the second coefficient.
[0098] In one embodiment, the underwater image correction device 300 further includes an image stitching correction module, used to obtain images to be stitched from the two underwater cameras of the panoramic camera; determine the stitching field of view parameters corresponding to each image to be stitched based on the shooting distance between the main shooting object in the normal area of each image to be stitched and the corresponding shooting lens; and adjust the field of view parameters of the images to be stitched corresponding to each shooting lens based on a preset field of view parameter table and the stitching field of view parameters to obtain the images to be corrected corresponding to each shooting lens.
[0099] In one embodiment, the image stitching correction module is further configured to: when multiple main shooting objects exist within the normal area of each image to be stitched, determine the priority of each main shooting object based on its position in each image to be stitched; determine the priority shooting distance corresponding to each image to be stitched based on the priority of each main shooting object and the shooting distance between each main shooting object and its corresponding shooting lens; and determine the field of view parameter corresponding to the priority shooting distance as the stitching field of view parameter corresponding to each image to be stitched based on the priority shooting distance and the preset field of view parameter table.
[0100] In one embodiment, the image stitching correction module is further configured to gradually increase the priority of the main photographed object from the center position of each image to be stitched to the seam position of each image to be stitched, wherein the main photographed object located at the seam position has the highest priority.
[0101] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device and each module described above can be referred to the corresponding process in the aforementioned embodiment of the correction method for underwater image capture, and will not be repeated here.
[0102] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 7 It runs on the computer device shown.
[0103] Please see Figure 7 , Figure 7 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a terminal.
[0104] See Figure 7 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0105] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform any correction method for underwater image capture.
[0106] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0107] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When executed by a processor, the computer program can enable the processor to perform any correction method for underwater images.
[0108] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0109] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0110] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0111] Acquire underwater images from a panoramic camera that require calibration;
[0112] Based on a preset division angle, the image to be corrected is divided into regions to obtain a first distribution region;
[0113] Expand the image to be corrected to obtain an expanded image, and divide the expanded image into regions based on the distribution position of the black borders in the expanded image to obtain a second distribution region;
[0114] The distribution positions of each pixel in the image to be corrected in the first distribution region and the second distribution region are detected, and the field of view coefficients corresponding to each pixel are set.
[0115] Based on the field of view coefficients corresponding to each pixel, the field of view of each pixel in the image to be corrected is adjusted to obtain a corrected image.
[0116] In one embodiment, the second distribution area includes a black border connection area, a buffer area, and a normal area.
[0117] In one embodiment, when the processor detects the distribution positions of each pixel in the image to be corrected in the first distribution region and the second distribution region, and sets the field of view coefficient corresponding to each pixel, it also implements:
[0118] When the distribution position of each pixel is located in the first distribution area and in the black border connection area, the field of view coefficient corresponding to each pixel is set to the first coefficient;
[0119] When the distribution position of each pixel is located in the first distribution area and in the buffer area, the field of view coefficient corresponding to each pixel is set as the buffer coefficient, wherein the buffer coefficient is the field of view coefficient between the first coefficient and the second coefficient range;
[0120] When the distribution position of each pixel is located in the normal area, the field of view coefficient corresponding to each pixel is set to 1.
[0121] In one embodiment, the first coefficient is greater than 1 and less than the second coefficient.
[0122] In one embodiment, before acquiring the underwater image to be corrected taken by the panoramic camera, the processor further implements:
[0123] Obtain the images to be stitched from the two underwater cameras of the panoramic camera;
[0124] Based on the shooting distance between the main shooting object and the corresponding shooting lens in the normal area of each image to be stitched, the stitching field of view parameters corresponding to each image to be stitched are determined;
[0125] Based on the preset field of view parameter table and the stitching field of view parameters, the field of view parameters of the images to be stitched corresponding to each shooting lens are adjusted to obtain the images to be corrected corresponding to each shooting lens.
[0126] In one embodiment, when the processor determines the stitching field of view parameters corresponding to each corrected image based on the shooting distance between the main shooting object and the corresponding shooting lens in the normal area of each image to be stitched, it further implements:
[0127] When multiple main objects are present in the normal area of each image to be stitched, the priority of each main object is determined based on its position in each image to be stitched.
[0128] Based on the priority of each main shooting object and the shooting distance between each main shooting object and the corresponding shooting lens, the priority shooting distance corresponding to each image to be stitched is determined;
[0129] Based on the preferred shooting distance and the preset field of view parameter table, the field of view parameter corresponding to the preferred shooting distance is determined as the stitching field of view parameter corresponding to each image to be stitched.
[0130] In one embodiment, when the processor determines the priority of each main captured object based on its position in each image to be stitched, it further implements:
[0131] From the center of each image to be stitched to the seam of each image, the priority of the main subject gradually increases, with the main subject located at the seam having the highest priority.
[0132] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the correction methods for underwater image capture provided in the embodiments of this application.
[0133] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0134] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A correction method for underwater picture taking, characterized in that, The method comprises: obtaining a to-be-corrected picture shot by a panoramic camera underwater; dividing the to-be-corrected picture into regions based on a preset division angle to obtain a first distribution region; unfolding the to-be-corrected picture to obtain an unfolded picture, and dividing the unfolded picture into regions based on a black border distribution position in the unfolded picture to obtain a second distribution region; detecting the distribution positions of each pixel in the to-be-corrected picture in the first distribution region and the second distribution region, and setting a field of view angle coefficient corresponding to each pixel; adjusting the field of view angle of each pixel in the to-be-corrected picture based on the field of view angle coefficient corresponding to each pixel to obtain a corrected picture; the second distribution region comprises a black border connection region, a buffer region and a normal region; the detection of the distribution positions of each pixel in the to-be-corrected picture in the first distribution region and the second distribution region, and the setting of the field of view angle coefficient corresponding to each pixel, comprises: when the distribution position of each pixel is located in the first distribution region and in the black border connection region, setting the field of view angle coefficient corresponding to each pixel as a first coefficient; when the distribution position of each pixel is located in the first distribution region and in the buffer region, setting the field of view angle coefficient corresponding to each pixel as a buffer coefficient, wherein the buffer coefficient is a field of view angle coefficient in a range from the first coefficient to a second coefficient; when the distribution position of each pixel is located in the normal region, setting the field of view angle coefficient corresponding to each pixel as 1.
2. The correction method for underwater picture taking according to claim 1, characterized in that, The first coefficient is greater than 1 and less than the second coefficient.
3. The correction method for underwater picture taking according to claim 1, wherein, Before the obtaining of the to-be-corrected picture shot by the panoramic camera underwater, the method further comprises: obtaining to-be-stitched pictures shot by two underwater cameras of the panoramic camera; determining stitching field of view angle parameters corresponding to each to-be-stitched picture based on the shooting distances between main shooting objects in the normal region in each to-be-stitched picture and corresponding shooting lenses; adjusting the field of view angle parameters of the to-be-stitched pictures corresponding to each shooting lens based on a preset field of view angle parameter table and the stitching field of view angle parameters to obtain the to-be-corrected pictures corresponding to each shooting lens.
4. The correction method for underwater picture taking according to claim 3, wherein, The determination of the stitching field of view angle parameters corresponding to each to-be-stitched picture based on the shooting distances between main shooting objects in the normal region in each to-be-stitched picture and corresponding shooting lenses, comprises: when there are multiple main shooting objects in the normal region in each to-be-stitched picture, determining the priorities of each main shooting object based on the positions of each main shooting object in each to-be-stitched picture; determining a priority shooting distance corresponding to each to-be-stitched picture based on the priorities of each main shooting object and the shooting distances between each main shooting object and the corresponding shooting lens; determining a field of view angle parameter corresponding to the priority shooting distance as the stitching field of view angle parameter corresponding to each to-be-stitched picture based on the priority shooting distance and the preset field of view angle parameter table.
5. The correction method for underwater picture taking according to claim 4, characterized in that, The determination of the priorities of each main shooting object based on the positions of each main shooting object in each to-be-stitched picture, comprises: The priority of the main shooting object gradually increases from the central position of each to-be-stitched picture to the seam position of each to-be-stitched picture, and the priority of the main shooting object at the seam position is the highest.
6. A correction device for underwater picture taking, characterized in that The correction device for underwater shooting pictures comprises: An image acquisition module is configured to acquire a to-be-corrected image shot by a panoramic camera underwater. An image region division module is configured to divide the to-be-corrected image into regions based on a preset division angle to obtain a first distribution region. An image unfolding module is configured to unfold the to-be-corrected image to obtain an unfolded image, and divide the unfolded image into regions based on a black border distribution position in the unfolded image to obtain a second distribution region. A field of view angle coefficient setting module is configured to detect the distribution position of each pixel in the first distribution region and the second distribution region in the to-be-corrected image, and set the field of view angle coefficient corresponding to each pixel. An image correction module is configured to adjust the field of view angle of each pixel in the to-be-corrected image based on the field of view angle coefficient corresponding to each pixel to obtain a corrected image. The second distribution region comprises a black border connection region, a buffer region and a normal region. The field of view angle coefficient setting module is specifically configured to set the field of view angle coefficient corresponding to each pixel as a first coefficient when the distribution position of each pixel is located in the first distribution region and the black border connection region, set the field of view angle coefficient corresponding to each pixel as a buffer coefficient when the distribution position of each pixel is located in the first distribution region and the buffer region, and set the field of view angle coefficient corresponding to each pixel as 1 when the distribution position of each pixel is located in the normal region, wherein the buffer coefficient is a field of view angle coefficient in a range from the first coefficient to a second coefficient.
7. The correction device for underwater picture taking according to claim 6, characterized in that, The first coefficient is greater than 1 and less than the second coefficient.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a correction program for underwater shooting pictures, and the correction program for underwater shooting pictures is executed by a processor to implement the steps of the correction method for underwater shooting pictures in any one of claims 1 to 5.
Citation Information
Patent Citations
Shooting distance based distortion correction method and mobile terminal
CN105005972A
Image processing method and terminal
CN106612397A