Image acquisition method, device, equipment and computer readable storage medium
The target underwater image is generated through three-dimensional modeling and transmittance processing, which solves the problem of poor effectiveness of underwater image training samples in the existing technology and achieves more accurate underwater environment simulation.
Patent Information
- Application Number
- CN202110376075.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-04-07
AI Technical Summary
The underwater image training samples obtained by image acquisition methods in the existing technology are less effective and fail to accurately reflect the real information of the underwater environment.
By obtaining the original atmospheric image of the target area, using three-dimensional modeling technology to process it to obtain a three-dimensional model, generating an initial image based on preset distance information and angle information, and combining transmittance and depth information, motion blur operators, and background light coefficients to generate the target Underwater images.
The effectiveness of the target underwater image is improved, making it more accurately reflect the real information of the underwater environment, and enhancing the quality of the training samples.
Smart Images

Figure CN113160386B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image acquisition method, device, equipment and computer-readable storage medium. Background Art
[0002] Underwater images refer to images of underwater environments taken with imaging equipment. Underwater images mainly include light reflected from objects in the water to the imaging equipment, light scattered into the imaging equipment at a small angle due to the underwater environment, and background light caused by impurities such as suspended matter in the water.
[0003] At present, deep learning technology is increasingly being used in the field of underwater image analysis. Underwater image analysis methods based on deep learning technology require a large number of underwater images as training data. At the same time, compared with collecting images on land, it is more difficult for imaging equipment to collect underwater images, making it more difficult to obtain a large number of underwater images.
[0004] In the related art, an image acquisition method is provided, which uses an imaging device to collect actual underwater images, and performs sample expansion on the actually collected underwater images to obtain a large number of underwater images that can be used as training samples. Usually, the actually collected underwater images are rotated, geometrically transformed, scaled, blurred, noisy or distorted to obtain new underwater images to be used as training images.
[0005] However, using the existing image acquisition method, the effectiveness of the expanded training images that can be used as training samples is poor. Summary of the invention
[0006] The main purpose of the present invention is to provide an image acquisition method, device, equipment and computer-readable storage medium, aiming to solve the technical problem in the prior art that the expanded training images that can be used as training samples obtained by using the existing image acquisition method are of poor effectiveness.
[0007] To achieve the above object, the present invention provides an image acquisition method, which comprises the following steps:
[0008] Acquire the original atmospheric image of the target area;
[0009] Processing the original atmospheric image using three-dimensional modeling technology to obtain a three-dimensional model of the target area;
[0010] Based on the preset distance information, the preset angle information and the three-dimensional model, an initial image is obtained;
[0011] Obtaining transmittance based on the preset distance information and the preset attenuation coefficient;
[0012] Based on the transmittance and the initial image, a target underwater image of the target area is obtained.
[0013] Optionally, before the step of obtaining a target underwater image of the target area based on the transmittance and the initial image, the method further includes:
[0014] Obtaining depth information of pixels in the initial image;
[0015] The step of obtaining a target underwater image of the target area based on the transmittance and the initial image comprises:
[0016] The target underwater image is obtained based on the transmittance, the initial image and the depth information.
[0017] Optionally, before the step of obtaining the target underwater image based on the transmittance, the initial image and the depth information, the method further includes:
[0018] Get the preset motion blur operator;
[0019] The step of obtaining the target underwater image based on the transmittance, the initial image and the depth information comprises:
[0020] The target underwater image is obtained based on the transmittance, the initial image, the depth information and the preset motion blur operator.
[0021] Optionally, before the step of obtaining the target underwater image based on the transmittance, the initial image, the depth information and the preset motion blur operator, the method further includes:
[0022] Obtain a preset real underwater image set;
[0023] Obtaining an average pixel value of a selected area in each real underwater image in the preset real underwater image set;
[0024] Based on the average pixel value of the selected area in each real underwater image, obtaining the result pixel value corresponding to the preset real underwater image set;
[0025] Normalizing the result pixel value to obtain a background light coefficient;
[0026] The step of obtaining the target underwater image based on the transmittance, the initial image, the depth information and the preset motion blur operator comprises:
[0027] The target underwater image is obtained based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient.
[0028] Optionally, the step of obtaining an average pixel value of a selected area in each real underwater image in the preset real underwater image set includes:
[0029] Using a hierarchical search technique of quadtree subdivision, each of the real underwater images is divided to obtain four rectangular areas corresponding to each of the real underwater images;
[0030] Obtain the standard deviation and average pixel value of the four rectangular areas;
[0031] Determine a selected rectangular area in the four rectangular areas where the difference between the standard deviation of pixel values and the average pixel value is the largest;
[0032] Dividing the selected rectangular area by using a hierarchical search technique of quadtree subdivision to update the four rectangular areas, and returning to the step of obtaining the standard deviation of pixel values and the average pixel value of each of the four rectangular areas until the size of the selected rectangular area meets a preset condition, and determining the selected rectangular area that meets the preset condition as the selected area;
[0033] Calculate the average pixel value of the selected area.
[0034] Optionally, the step of obtaining transmittance based on the preset distance information and the preset attenuation coefficient includes:
[0035] Based on the preset distance information and the preset attenuation coefficient, the transmittance is obtained using Formula 1;
[0036] The formula 1 is:
[0037] t c (x) = exp(-β c ·dph(x))
[0038] Among them, t c (x) is the transmittance corresponding to the xth pixel of the initial image in the transmittance, β c is the preset attenuation coefficient, dph(x) is the preset distance information corresponding to the x-th pixel in the preset distance information, c is the color channel, c∈{r,g,b}.
[0039] Optionally, the step of obtaining the target underwater image based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient includes:
[0040] Based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient, the target underwater image is obtained using Formula 2;
[0041] The formula 2 is:
[0042]
[0043] Among them, I c (x) is the pixel value corresponding to the x-th pixel in the target underwater image, J c is the pixel value corresponding to the x-th pixel in the initial image, D(x) is the depth information corresponding to the x-th pixel in the depth information, F is the motion blur operator, * is the convolution operation, A c is the background light coefficient.
[0044] In addition, to achieve the above object, the present invention also proposes an image acquisition device, which comprises the following steps:
[0045] An acquisition module, used to acquire the original atmospheric image of the target area;
[0046] A modeling module, used to process the original atmospheric image using a three-dimensional modeling technology to obtain a three-dimensional model of the target area;
[0047] A first acquisition module, used for acquiring an initial image based on preset distance information, preset angle information and the three-dimensional model;
[0048] A second obtaining module, used for obtaining transmittance based on the preset distance information and the preset attenuation coefficient;
[0049] The third acquisition module is used to obtain a target underwater image of the target area based on the transmittance and the initial image.
[0050] In addition, to achieve the above-mentioned purpose, the present invention also proposes a terminal device, which includes: a memory, a processor, and an image acquisition program stored in the memory and running on the processor, and when the image acquisition program is executed by the processor, the steps of the image acquisition method described in any one of the above items are implemented.
[0051] In addition, to achieve the above objectives, the present invention also proposes a computer-readable storage medium, on which an image acquisition program is stored, and when the image acquisition program is executed by a processor, the steps of the image acquisition method as described in any one of the above items are implemented.
[0052] The technical solution of the present invention proposes an image acquisition method, which includes acquiring an original atmospheric image of a target area; processing the original atmospheric image using a three-dimensional modeling technique to obtain a three-dimensional model of the target area; obtaining an initial image based on preset distance information, preset angle information and the three-dimensional model; obtaining transmittance based on the preset distance information and a preset attenuation coefficient; and obtaining a target underwater image of the target area based on the transmittance and the initial image.
[0053] The existing image acquisition method performs operations such as rotation, geometric transformation, scaling, blurring, noise addition or distortion on the actually collected underwater images to obtain training images that can be used as training samples. The obtained training images do not take into account the influence of the transmittance of the underwater environment, so that the training images cannot accurately reflect the real information of the underwater area corresponding to the training images, and the effectiveness of the training images is poor. The present invention obtains the target underwater image by using the transmittance and the initial image, and the transmittance is obtained based on the preset distance information. The target underwater image refers to the transmittance of the underwater environment of the target area, so that the target underwater image has a higher effectiveness. Therefore, the image acquisition method of the present invention achieves the technical effect of improving the effectiveness of the target underwater image. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0055] Figure 1 A schematic diagram of the structure of a terminal device in a hardware operating environment involved in an embodiment of the present invention;
[0056] Figure 2 It is a flowchart of the first embodiment of the image acquisition method of the present invention;
[0057] Figure 3 Schematic diagram of the original target underwater image and the target underwater image with added depth information;
[0058] Figure 4 Schematic diagram of the original target underwater image and the target underwater image after motion blur processing;
[0059] Figure 5 Schematic diagram of the original target underwater image and the target underwater image with changed background light coefficient;
[0060] Figure 6 Schematic diagram of an actual underwater image and a target underwater image of the present invention;
[0061] Figure 7 It is a structural block diagram of the first embodiment of the image acquisition device of the present invention.
[0062] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] Reference Figure 1 , Figure 1 A schematic diagram of the terminal device structure of the hardware operating environment involved in the embodiment of the present invention.
[0065] The terminal device may be a user equipment (UE) such as a mobile phone, a smart phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a mobile station (MS), etc. The terminal device may be called a user terminal, a portable terminal, a desktop terminal, etc.
[0066] Typically, the terminal device includes: at least one processor 301, a memory 302, and an image acquisition program stored in the memory and executable on the processor, wherein the image acquisition program is configured to implement the steps of the image acquisition method as described above.
[0067] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. The processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process operations related to the image acquisition method, so that the image acquisition method model can be trained and learned autonomously to improve efficiency and accuracy.
[0068] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement the image acquisition method provided in the method embodiment of the present application.
[0069] In some embodiments, the terminal may further optionally include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected via a bus or a signal line. Each peripheral device may be connected to the communication interface 303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304, a display screen 305 and a power supply 306.
[0070] The communication interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the communication interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0071] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0072] The display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to collect touch signals on the surface or above the surface of the display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. At this time, the display screen 305 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 305 can be one, the front panel of the electronic device; in other embodiments, the display screen 305 can be at least two, respectively arranged on different surfaces of the electronic device or in a folding design; in some further embodiments, the display screen 305 can be a flexible display screen, arranged on a curved surface or a folding surface of the electronic device. Even, the display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.
[0073] The power supply 306 is used to power various components in the electronic device. The power supply 306 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 306 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0074] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the terminal device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0075] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which an image acquisition program is stored, and when the image acquisition program is executed by a processor, the steps of the image acquisition method described above are implemented. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed to be executed on a terminal device, or on multiple terminal devices located at one location, or on multiple terminal devices distributed at multiple locations and interconnected by a communication network.
[0076] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0077] Based on the above hardware structure, an embodiment of the image acquisition method of the present invention is proposed.
[0078] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of the image acquisition method of the present invention. The method is used in a terminal device and comprises the following steps:
[0079] Step S11: Acquire the original atmospheric image of the target area.
[0080] It should be noted that the executor of the present invention is a terminal device, and the terminal device is equipped with an image acquisition method. When the terminal device executes the image acquisition program, the image acquisition method of the present invention is implemented. The original atmospheric image can be obtained by photographing the target area by a shooting module of the terminal device, or the original atmospheric image can be obtained by photographing the target area by a shooting device, and the terminal device obtains the original atmospheric image of the target area from the shooting device. The target area can be any type of land area, and the present invention does not limit it. Preferably, the target area needs to include a target object (used as a reference object). The original atmospheric image can refer to an image obtained by directly photographing the target area on land, and the original atmospheric image does not include the influence of any underwater environmental factors.
[0081] In addition, the purpose of the present invention is to process the original atmospheric image to obtain a simulated target underwater image. The target underwater image is a simulation of the underwater environment of the target area. The obtained underwater simulation image is not a real underwater image.
[0082] The existing image acquisition method generates new sample images (underwater images that can be used as training samples) by rotating, geometrically transforming, scaling, blurring, adding noise or distorting the collected real underwater images. However, the sample images are real underwater two-dimensional images that are converted into two-dimensional sample images after the above-mentioned multiple operations. The conversion process cannot imitate the changes in the underwater environment, light and objects themselves, making the effectiveness of the obtained two-dimensional sample images poor.
[0083] By using the image acquisition method of the present invention, the original atmospheric image can be used to obtain the corresponding simulated target underwater image. There is no need to shoot the underwater area to obtain the real underwater image, which reduces the difficulty of obtaining the underwater image. At the same time, compared with the sample image obtained by using the existing image acquisition method, the target underwater image obtained by using the image acquisition method of the present invention is more effective.
[0084] Step S12: using three-dimensional modeling technology to process the original atmospheric image to obtain a three-dimensional model of the target area.
[0085] Step S13: obtaining an initial image based on the preset distance information, the preset angle information and the three-dimensional model.
[0086] It should be noted that the original atmospheric image is processed using three-dimensional modeling technology to obtain a three-dimensional model of the target area, and based on the preset distance information (the distance between the camera and the target area, usually the distance to the reference object of the target area) and preset angle information (the angle between the camera and the target area, usually the angle to the reference object of the target area) set by the user, the initial image of the three-dimensional model is obtained, that is, assuming that the camera shoots the three-dimensional model with the preset angle information and preset distance information, the initial image can be obtained.
[0087] It can be understood that, for the three-dimensional model corresponding to the same target area, different preset distance information and preset angle information can obtain different initial images corresponding to the three-dimensional model; the user can set different multiple preset angle information and multiple preset distance information for the same three-dimensional model to obtain multiple initial images, and based on the multiple initial images, obtain the final multiple target underwater images.
[0088] In addition, based on the preset distance information and preset angle information set by the user, the preset distance information and preset angle information corresponding to each pixel in the initial image can be obtained, and the preset distance information and preset angle information corresponding to different pixels in the initial image may be different.
[0089] The three-dimensional modeling technology involved may be any type of existing three-dimensional modeling technology, and the present invention does not impose any limitation thereto.
[0090] It can be understood that all objects in the initial image have a distance and angle with the camera (the camera of the shooting device or the camera of the terminal device), and the initial image needs to be obtained based on the three-dimensional model, the external parameters of the camera, the preset distance information and the preset angle information; in the initial image, the preset distance information and the preset angle information both include the preset distance information and the preset angle information corresponding to each pixel point in the initial image, the preset distance information of a pixel point is the distance between the object point in the target area corresponding to the pixel point and the camera, and the preset angle information of a pixel point is the angle between the object point in the target area corresponding to the pixel point and the camera.
[0091] The obtained initial image is a 2.5-dimensional image with preset distance information, that is, the initial image includes the preset distance information, and the preset distance information corresponding to each pixel point of the initial image is stored in the initial image in the form of additional information.
[0092] For example, the initial image of the target area includes 512*512 pixels, where the pixel in the 124th row and the 35th column is A 124,35 , A 124,35 The corresponding object is point a1 of object A in the target area, then A 124,35 The preset distance information is the distance between point a1 and the camera. 124,35 The preset angle information is the angle between point a1 and the camera.
[0093] Step S14: Obtaining transmittance based on the preset distance information and the preset attenuation coefficient.
[0094] Specifically, step S14 includes: obtaining transmittance using formula 1 based on the preset distance information and the preset attenuation coefficient;
[0095] The formula 1 is:
[0096] t c (x) = exp(-β c ·dph(x))
[0097] Among them, t c (x) is the transmittance corresponding to the xth pixel of the initial image in the transmittance, β c is the preset attenuation coefficient, dph(x) is the preset distance information corresponding to the x-th pixel in the preset distance information, c is the color channel, c∈{r,g,b}.
[0098] The transmittance includes the transmittance of all pixels of the initial image. At the same time, each pixel in the initial image is a three-channel pixel, that is, each pixel in the initial image includes pixel values of the three channels of red, green and blue. Among them, in the present invention, the preset attenuation coefficient includes preset attenuation coefficients of ten types of water, which are named I, IA, IB, II, III, 1C, 3C, 5C, 7C and 9C respectively, among which I, IA, IB, II and III represent the preset attenuation coefficients of deep sea waters from clear to slightly turbid, and 1C to 9C represent the preset attenuation coefficients of coastal waters that are gradually turbid. Refer to Table 1, which is a table of preset attenuation coefficients for the above ten types of water. Table 1 is as follows:
[0099] Table 1
[0100] Type I I A IB II III 1C 3C 5C 7C 9C R 0.341 0.342 0.349 0.375 0.426 0.439 0.498 0.564 0.635 0.755 G 0.049 0.0503 0.0572 0.078 0.121 0.121 0.198 0.314 0.494 0.777 B 0.021 0.0253 0.0325 0.110 0.139 0.240 0.400 0.650 0.693 1.24
[0101] As shown in Table 1, the preset attenuation coefficients of the same type of water include three preset attenuation coefficients of R, G and B, that is, the preset attenuation coefficients of a type of water include the preset attenuation coefficients corresponding to red light, green light and blue light. It can be understood that the three colors of red, green and blue involved in each pixel point need to be processed using the preset attenuation coefficients of the corresponding color light to obtain the transmittance corresponding to the pixel point. Among them, in Table 1, the preset attenuation coefficient of red light represents the preset attenuation coefficient corresponding to a wavelength of 650nm, the preset attenuation coefficient of green light represents the preset attenuation coefficient corresponding to a green light wavelength of 525nm, and the preset attenuation coefficient of blue light represents the preset attenuation coefficient corresponding to a blue light wavelength of 475nm.
[0102] Step S15: obtaining a target underwater image of the target area based on the transmittance and the initial image.
[0103] Furthermore, before step S15, the method further includes: acquiring depth information of pixel points in the initial image; correspondingly, step S15 includes: obtaining the target underwater image based on the transmittance, the initial image and the depth information.
[0104] It should be noted that each pixel in the initial image has depth information, and the depth information can be set by the user according to needs. Usually, the user sets a preset depth, and the terminal device obtains the depth information of each pixel in the initial image based on the preset depth. The preset depth can be the depth information of a certain reference pixel in the initial image, and the depth information of other pixels is obtained through the depth information of the reference pixel; the preset depth can also be the depth of a reference object point in the target area, and the depth information of the selected pixel corresponding to the reference object point is obtained based on the depth of the reference object point, and the depth information of other pixels is obtained based on the depth information of the selected pixel. At this time, the target underwater image obtained takes into account the transmittance, and the effectiveness of the target underwater image is improved.
[0105] Furthermore, before step S15, the method further includes: acquiring a preset motion blur operator; correspondingly, step S15 includes: obtaining the target underwater image based on the transmittance, the initial image, the depth information and the preset motion blur operator.
[0106] It should be noted that in a real underwater environment, the target area will be affected by the water flow, causing relative movement between the camera and the target area, resulting in motion blur. At this time, the influence of motion blur needs to be considered, that is, at this time, the target underwater image needs to be obtained based on the transmittance, the initial image, the depth information and the preset motion blur operator. Usually, the preset motion blur operator uses a directly attenuated radiation scene convolution motion blur operator. At this time, the target underwater image obtained takes into account the motion blur factor, and the effectiveness of the target underwater image is further improved.
[0107] Furthermore, before step S15, the method also includes: obtaining a preset real underwater image set; obtaining an average pixel value of a selected area in each real underwater image in the preset real underwater image set; based on the average pixel value of the selected area in each real underwater image, obtaining a result pixel value corresponding to the preset real underwater image set; normalizing the result pixel value to obtain a background light coefficient; correspondingly, step S15 includes: obtaining the target underwater image based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient.
[0108] Specifically, the step of obtaining the average pixel value of the selected area in each real underwater image in the preset real underwater image set includes: using a hierarchical search technology of quadtree subdivision to divide each real underwater image to obtain four rectangular areas corresponding to each real underwater image; obtaining the pixel value standard deviation and the average pixel value of the four rectangular areas; determining a selected rectangular area with the largest difference between the pixel value standard deviation and the average pixel value among the four rectangular areas; using a hierarchical search technology of quadtree subdivision to divide the selected rectangular area to update the four rectangular areas, and returning to the step of obtaining the pixel value standard deviation and the average pixel value of each of the four rectangular areas until the size of the selected rectangular area meets the preset condition, and determining the selected rectangular area that meets the preset condition as the selected area; and calculating the average pixel value of the selected area.
[0109] It should be noted that when calculating the above average pixel value for each real underwater image, each time the selected rectangular area is divided using the hierarchical search technology of quadtree subdivision, a new selected rectangular area will be obtained. When the new selected rectangular area meets the preset condition, the division step is no longer performed, and the selected rectangular area that meets the preset condition is determined as the selected area. The preset condition may be that the size ratio of the new selected rectangular area to the original real underwater image is not greater than 1 / 8 or 1 / 16; usually, when the new selected rectangular area is not greater than 1 / 8 or 1 / 16, the difference in the background light coefficient obtained is small, so there is no need to continue dividing.
[0110] In addition, the normalization processing of the result pixel value may be to normalize the result pixel value to between 0 and 1 to obtain a background light coefficient. At the same time, the background light coefficient includes a red background light coefficient, a green background light coefficient, and a blue background light coefficient, that is, the result pixel value includes a red result pixel value, a green result pixel value, and a blue result pixel value, and other pixel values (average pixel value and pixel value standard deviation, etc.) involved in the result pixel value calculation process also include red pixel values, green pixel values, and blue pixel values.
[0111] In a specific application, multiple preset real underwater image sets corresponding to multiple underwater environments are selected. One preset real underwater image set is used to obtain a background light coefficient corresponding to an underwater environment. Multiple underwater environments correspond to multiple background light coefficients. Usually, multiple underwater environments can be selected from representative underwater environments. Usually, there are no less than four multiple underwater environments. In another embodiment, the user can also set the background light coefficient according to the needs. Usually, when setting the background light coefficient, the ratio of R is smaller than that of G and B.
[0112] Specifically, step S15 includes: obtaining the target underwater image using formula 2 based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient;
[0113] The formula 2 is:
[0114]
[0115] Among them, I c (x) is the pixel value corresponding to the x-th pixel in the target underwater image, J c is the pixel value corresponding to the x-th pixel in the initial image, D(x) is the depth information corresponding to the x-th pixel in the depth information, F is the motion blur operator, * is the convolution operation, A c is the background light coefficient.
[0116] in, It means that the natural light from the water surface to the depth of the water is attenuated by the absorption and scattering of the water, and the remaining light is attenuated by the distance between the scene and the camera and reaches the camera, which is the direct attenuation of the scene radiation; A c ·(1-t c (x) represents the part of ambient light that enters the camera due to scattering.
[0117] In specific applications, the pixel value of each pixel point of the initial image needs to undergo the above calculation to obtain a new pixel point with a new pixel value corresponding to each pixel point. The image composed of the new pixel points corresponding to all the pixels involved in the initial image is the target underwater image.
[0118] In addition, each pixel in the initial image is a pixel of the red, green and blue channels. The pixel values of the three channels of each pixel need to be processed using the background light coefficient and transmittance of the corresponding color to obtain the pixel with a new pixel value corresponding to the pixel.
[0119] Reference Figure 3-5 , Figure 3 Schematic diagram of the original target underwater image and the target underwater image with added depth information; Figure 4 Schematic diagram of the original target underwater image and the target underwater image after motion blur processing; Figure 5 Schematic diagram of the original target underwater image and the target underwater image with changed background light coefficient.
[0120] exist Figure 3In the figure, the left side is the original target underwater image corresponding to the initial image, which is obtained based on the transmittance and the initial image, and does not consider factors such as depth information, motion blur and background light coefficient. The right side is the target underwater image with added depth information corresponding to the initial image, wherein the depth information is 1m (1m is the depth information of the reference pixel point). The target underwater image takes into account the depth information, but does not consider factors such as motion blur and background light coefficient. The validity of the target underwater image is relatively high.
[0121] exist Figure 4 In the figure, the left side is the original target underwater image corresponding to the initial image, which is obtained based on the transmittance and the initial image, and does not consider factors such as depth information, motion blur and background light coefficient. The right side is the target underwater image processed with motion blur corresponding to the initial image, which considers motion blur but does not consider factors such as depth information and background light coefficient. The validity of this target underwater image is relatively high.
[0122] exist Figure 5 In the figure, the left side is the original target underwater image corresponding to the initial image, which is obtained based on the transmittance and the initial image, and does not consider factors such as depth information, motion blur and background light coefficient. The right side is the target underwater image with changed background light coefficient corresponding to the initial image, which considers the background light coefficient but does not consider factors such as motion blur and depth information. The validity of this target underwater image is relatively high.
[0123] refer to Figure 6 , Figure 6 Schematic diagram of an actual underwater image and a target underwater image of the present invention; the three figures on the left are real underwater images corresponding to different underwater environments, and the right is a target underwater image obtained after initial image simulation (processed by the image acquisition method of the present invention). The target underwater image takes into account factors such as depth information, background light coefficient and motion blur. It can be seen that the target underwater image obtained after processing by the image acquisition method of the present invention has a high similarity with the real underwater image corresponding to the underwater environment, and the target underwater image has a high validity.
[0124] The technical solution of the present invention proposes an image acquisition method, which includes acquiring an original atmospheric image of a target area; processing the original atmospheric image using a three-dimensional modeling technique to obtain a three-dimensional model of the target area; obtaining an initial image based on preset distance information, preset angle information and the three-dimensional model; obtaining transmittance based on the preset distance information and a preset attenuation coefficient; and obtaining a target underwater image of the target area based on the transmittance and the initial image.
[0125] The existing image acquisition method performs operations such as rotation, geometric transformation, scaling, blurring, noise addition or distortion on the actually collected underwater images to obtain training images that can be used as training samples. The obtained training images do not take into account the influence of the transmittance of the underwater environment, so that the training images cannot accurately reflect the real information of the underwater area corresponding to the training images, and the effectiveness of the training images is poor. The present invention obtains the target underwater image by using the transmittance and the initial image, and the transmittance is obtained based on the preset distance information. The target underwater image refers to the transmittance of the underwater environment of the target area, so that the target underwater image has a higher effectiveness. Therefore, the image acquisition method of the present invention achieves the technical effect of improving the effectiveness of the target underwater image.
[0126] Reference Figure 7 , Figure 7 This is a structural block diagram of a first embodiment of an image acquisition device of the present invention, wherein the device is used in a terminal device and comprises:
[0127] An acquisition module 10 is used to acquire an original atmospheric image of a target area;
[0128] A modeling module 20, configured to process the original atmospheric image using a three-dimensional modeling technique to obtain a three-dimensional model of the target area;
[0129] A first obtaining module 30, configured to obtain an initial image based on preset distance information, preset angle information and the three-dimensional model;
[0130] A second obtaining module 40, configured to obtain transmittance based on the preset distance information and the preset attenuation coefficient;
[0131] The third obtaining module 50 is used to obtain a target underwater image of the target area based on the transmittance and the initial image.
[0132] The above descriptions are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.
Claims
1. A method for obtaining an image, characterized in that: The method comprises the following steps: Acquire the original atmospheric image of the target area; Processing the original atmospheric image using three-dimensional modeling technology to obtain a three-dimensional model of the target area; Based on the preset distance information, the preset angle information and the three-dimensional model, an initial image is obtained; Obtaining transmittance based on the preset distance information and the preset attenuation coefficient; Based on the transmittance and the initial image, obtaining a target underwater image of the target area; Before the step of obtaining a target underwater image of the target area based on the transmittance and the initial image, the method further comprises: Acquire depth information of pixels in the initial image, a preset motion blur operator, and a background light coefficient; The step of obtaining a target underwater image of the target area based on the transmittance and the initial image comprises: Based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient, the target underwater image is obtained using Formula 2; The formula 2 is: Among them, I c (x) is the pixel value corresponding to the xth pixel in the target underwater image, J c (x) is the pixel value corresponding to the x-th pixel in the initial image, D(x) is the depth information corresponding to the x-th pixel in the depth information, F is the preset motion blur operator, * is the convolution operation, A c is the background light coefficient, t c (x) is the transmittance corresponding to the x-th pixel of the initial image in the transmittance.
2. The method according to claim 1, characterized in that The steps to obtain the background light coefficient include: Obtain a preset real underwater image set; Obtaining an average pixel value of a selected area in each real underwater image in the preset real underwater image set; Based on the average pixel value of the selected area in each real underwater image, obtaining the result pixel value corresponding to the preset real underwater image set; The result pixel value is normalized to obtain the background light coefficient.
3. The method according to claim 2, characterized in that The step of obtaining the average pixel value of the selected area in each real underwater image in the preset real underwater image set comprises: Using a hierarchical search technique of quadtree subdivision, each of the real underwater images is divided to obtain four rectangular areas corresponding to each of the real underwater images; Obtain the standard deviation and average pixel value of the four rectangular areas; Determine a selected rectangular area in the four rectangular areas where the difference between the standard deviation of pixel values and the average pixel value is the largest; Dividing the selected rectangular area by using a hierarchical search technique of quadtree subdivision to update the four rectangular areas, and returning to the step of obtaining the standard deviation of pixel values and the average pixel value of each of the four rectangular areas until the size of the selected rectangular area meets a preset condition, and determining the selected rectangular area that meets the preset condition as the selected area; Calculate the average pixel value of the selected area.
4. The method according to claim 3, characterized in that The step of obtaining the transmittance based on the preset distance information and the preset attenuation coefficient comprises: Based on the preset distance information and the preset attenuation coefficient, the transmittance is obtained using Formula 1; The formula 1 is: t c (x)=exp(-β c ·dph(x)) Among them, t c (x) is the transmittance corresponding to the xth pixel of the initial image in the transmittance, β c is the preset attenuation coefficient, dph(x) is the preset distance information corresponding to the x-th pixel in the preset distance information, c is the color channel, c∈{r, g, b}.
5. An image acquisition device, characterized in that: The device comprises the following steps: An acquisition module, used to acquire the original atmospheric image of the target area; A modeling module, used to process the original atmospheric image using a three-dimensional modeling technology to obtain a three-dimensional model of the target area; A first acquisition module, used for acquiring an initial image based on preset distance information, preset angle information and the three-dimensional model; A second obtaining module, used for obtaining transmittance based on the preset distance information and the preset attenuation coefficient; A third acquisition module, configured to acquire a target underwater image of the target area based on the transmittance and the initial image; The third acquisition module is also used to obtain the depth information of the pixel points in the initial image, the preset motion blur operator and the background light coefficient; The third acquisition module is further used to obtain the target underwater image based on the transmittance, the initial image, the depth information, the preset motion blur operator and the background light coefficient using Formula 2; the Formula 2 is: Among them, I c (x) is the pixel value corresponding to the xth pixel in the target underwater image, J c (x) is the pixel value corresponding to the x-th pixel in the initial image, D(x) is the depth information corresponding to the x-th pixel in the depth information, F is the preset motion blur operator, * is the convolution operation, A c is the background light coefficient, t c (x) is the transmittance corresponding to the x-th pixel of the initial image in the transmittance.
6. A terminal device, characterized in that: The terminal device comprises: a memory, a processor, and an image acquisition program stored in the memory and running on the processor, wherein the image acquisition program implements the steps of the image acquisition method according to any one of claims 1 to 4 when executed by the processor.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an image acquisition program, and when the image acquisition program is executed by a processor, the steps of the image acquisition method according to any one of claims 1 to 4 are implemented.
