WO2023005336A1 - Image processing method and apparatus, and storage medium and electronic device - Google Patents

Image processing method and apparatus, and storage medium and electronic device Download PDF

Info

Publication number
WO2023005336A1
WO2023005336A1 PCT/CN2022/092037 CN2022092037W WO2023005336A1 WO 2023005336 A1 WO2023005336 A1 WO 2023005336A1 CN 2022092037 W CN2022092037 W CN 2022092037W WO 2023005336 A1 WO2023005336 A1 WO 2023005336A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
data
initial
image processor
processor
Prior art date
Application number
PCT/CN2022/092037
Other languages
French (fr)
Chinese (zh)
Inventor
杨平平
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023005336A1 publication Critical patent/WO2023005336A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Definitions

  • the present application belongs to the technical field of image processing, and in particular relates to an image processing method, device, storage medium and electronic equipment.
  • the terminal has gradually changed from simply providing communication equipment in the past to a platform for general software operation.
  • the platform no longer aims to provide call management, but to provide an operating environment including call management, game entertainment, office notes, mobile payment and other application software.
  • call management game entertainment
  • office notes office notes
  • mobile payment mobile payment
  • the present application provides an image processing method, device, storage medium and electronic equipment, which can reduce the amount of data to be transmitted, reduce the pressure on the image processing chip to transmit data, and thereby improve image processing efficiency.
  • an embodiment of the present application provides an image processing method, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
  • the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
  • the second image processor decompresses the compressed data to obtain restored data
  • an embodiment of the present application provides an image processing apparatus, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
  • an acquisition module configured to acquire the original data of the initial image and send it to the first image processor
  • a compression module configured for the first image processor to compress the original data of the initial image, obtain compressed data and send the compressed data to the second image processor;
  • a decompression module used for the second image processor to decompress the compressed data to obtain restored data
  • a generating module configured to extract YUV data in the restored data, and encode the YUV data to generate a target image.
  • the embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute the above-mentioned image processing method.
  • an embodiment of the present application provides an electronic device, including a first image processor, a second image processor, a central processing unit, and a memory, the memory stores a plurality of instructions, and the central processing unit loads the Instructions in memory are used to perform the following steps:
  • the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
  • the second image processor decompresses the compressed data to obtain restored data
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is another schematic flowchart of the image processing method provided by the embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • FIG. 4 is another schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 6 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • first”, “second” and “third” in this application are used to distinguish different objects, not to describe a specific order.
  • the terms “include” and “have”, as well as any variations thereof, are intended to cover a non-exclusive inclusion.
  • a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.
  • An embodiment of the present application provides an image processing method, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, wherein the method includes the following steps:
  • the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
  • the second image processor decompresses the compressed data to obtain restored data
  • the step of compressing the original data of the initial image by the first image processor includes:
  • the first image processor acquires the shooting scene corresponding to the initial image
  • a target compression rate is determined according to the shooting scene, and the original data of the initial image is compressed at the target compression rate.
  • the shooting scene includes a shooting mode and camera parameters, wherein the step of determining the target compression rate according to the shooting scene includes:
  • a preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
  • the step of sending the compressed data to the second image processor includes:
  • the method before the first image processor compresses the raw data of the initial image, the method further includes:
  • the initial image is multi-frame, then select a reference frame image from the multi-frame initial image;
  • the multi-frame initial images are synthesized according to the reference frame images.
  • the step of selecting a reference frame image from the multiple frames of initial images includes:
  • An image with the highest average brightness is selected from the multiple frames of initial images as the reference frame image.
  • the step of compressing the original data of the initial image by the first image processor includes:
  • the first image processor acquires the shooting scene corresponding to the initial image
  • a compression mode is determined according to the shooting scene, and the original data of the initial image is compressed in the compression mode, and the compression mode includes lossless compression and lossy compression.
  • the method further includes:
  • FIG. 1 is a schematic flowchart of an image processing method provided in an embodiment of the present application.
  • the image processing method provided in the embodiment of the present application is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, and the specific process may be as follows:
  • Step 101 acquire the original data of the initial image and send it to the first image processor.
  • the above initial image may be an image of the current scene acquired by the imaging device of the electronic device when shooting.
  • the imaging device may be a front camera, a rear camera, and the like. Start the imaging device of the electronic device, make it enter the photo preview mode, and display the captured scene on the display window of the electronic device, and define the picture displayed in the display window as a preview image.
  • the hardware of the imaging device generally includes five parts: a housing (motor), a lens, an infrared filter, an image sensor (such as CCD or COMS), and a flexible printed circuit board (FPCB).
  • the lens moves under the drive of the motor, and the object to be photographed passes through the lens and forms an image on the image sensor.
  • the image sensor converts the optical signal into an electrical signal through optical-electrical conversion and sends it to the image processing circuit for subsequent processing.
  • the image processing circuit may be realized by hardware and/or software components, and may include various processing units defining an ISP (Image Signal Processing, image signal processing) pipeline.
  • ISP Image Signal Processing, image signal processing
  • the initial image acquired by the camera sensor can be transmitted to the first image processor through the MIPI (Mobile Industry Processor Interface, mobile industry processor interface) protocol, wherein the above-mentioned first image processor is preISP, used for pre-image processing.
  • the initial image can be transmitted using MIPI protocol VCO, all data is sent out by line.
  • Step 102 the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor.
  • the above-mentioned initial image is a Raw image
  • the Raw image is the original data converted from the light source signal captured by the CMOS or CCD image sensor into a digital signal.
  • the first image processor receives the initial image and determines that the reception is complete
  • the initial image may be compressed and sent to the second image processor after compression, and the second image processor may be an ISP.
  • the amount of data is relatively large. Take the camera sensor output image size of 100 million pixels, the frame rate of 30 frames in 1 second, and 8 bits per pixel as an example. When transmitting through the MIPI interface, the amount of MIPI data in one second can be known by calculation. 22.35GB.
  • the mainstream platform SM8150 on the market is the Qualcomm Snapdragon 855 processor. This platform supports two physical layers of ports: D-PHY and C-PHY.
  • the platform bandwidth of D-PHY within one second is about 9GB
  • the platform bandwidth of D-PHY within one second is about 21.56GB
  • a single CSI (C-PHY/D-PHY) of SM8150 cannot meet the 100 million pixel output of the camera sensor.
  • the general practice in the prior art is to use Binning technology to zoom. Binning is an image readout mode that adds the charges induced by adjacent pixels together and reads out in a pixel mode, which improves sensitivity and output speed, and reduces resolution.
  • the camera sensor outputs a 108M image and after Binning, it outputs a 27M Bayer image
  • the ISP processes the 27M Bayer image
  • the YUV image outputs a 108M image through super-resolution technology.
  • this method will reduce the resolution of the image and produce some mosaic areas in the image.
  • the embodiment of the present application may use the first image processor to compress the original image, for example, to perform lossless compression.
  • the lossless compression refers to decompressing the compressed image data, and the decompressed data is exactly the same as the original data. Lossless compression can make the reconstructed data exactly the same as the original data.
  • the aforementioned lossless compression method may include one of LZ77 algorithm, LZ78 algorithm, LZW algorithm, LZSS algorithm, Huffman coding algorithm, and Shannon-Fano coding algorithm.
  • the image quality is the same after compression as uncompressed, but the resulting file size is approximately 30% to 90% (14-bit RAW), or 45% to 100% (16-bit RAW) of the uncompressed size.
  • the first image processor finishes compressing the initial image, it can be sent to the second image processor, for example, the compressed data is sent to the ISP through the MIPI protocol VCO.
  • the compression can be performed according to a preset compression ratio, such as 70% or 80, and the preset compression ratio can be set according to the capacity of the image data. Furthermore, after the compression is completed, it can be further judged whether the compressed data meets the preset compression rate. If the ratio of the compressed data size to the pre-compressed data size is not greater than the compression rate, it means that the compression is successful; if the compressed If the ratio of the post-compression data size to the pre-compression data size is greater than the compression ratio, it means that the compression fails.
  • a preset compression ratio such as 70% or 80
  • Step 103 the second image processor decompresses the compressed data to obtain restored data.
  • the second image processor first receives the compressed data and directly stores it in the memory, and decompresses it after receiving all the compressed data.
  • the memory can be Synchronous Dynamic Random Access Memory (Synchronous Dynamic Random Access Memory, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Synchronous Graphics Random-Access Memory (SGRAM) or Double rate synchronous graphics random access memory (Double Data Rate SGRAM, DDR SGRAM), etc.
  • the compressed data stored in the image can be decompressed and restored to RAW-DATA, that is, restored data.
  • the first image processor also needs to perform data encapsulation.
  • Image data encapsulation uses data to describe actual image data. This type of data is called metadata, which mainly describes data attribute information.
  • the output is an image file. Therefore, after the second image processor performs decompression, the specific location of the data code stream can be located through the metadata.
  • Step 104 extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
  • data conversion may be performed on the Raw image first to obtain a YUV image, and then a video encoder is used to encode the YUV image to obtain a target image.
  • the input target image may be a JPG image or a JPEG image or the like.
  • the target image after the target image is generated, it can be displayed as a preview image on the screen of the electronic device. Further, after the target image is generated, subsequent processing may be performed on the target image, such as noise reduction processing, and then the electronic device may perform tone mapping processing (Tone Mapping) on the noise reduction image to obtain a final image.
  • tone mapping processing Tone Mapping
  • the electronic device may also display the tone-mapped image on the screen of the electronic device as a preview image of the current scene.
  • the current resolution of the screen can also be obtained first, and then the preview image is down-sampled according to the current resolution of the screen, so that the resolution of the preview image is the same as that of the screen.
  • the current resolution is the same. In this way, the synthesis efficiency of multi-frame synthesis can be improved, and when the preview image is displayed, its display effect will not be reduced.
  • the image processing method provided by the embodiment of the present application can obtain the original data of the initial image and send it to the first image processor, and the first image processor will compress the original data of the initial image to obtain compressed data and compress the data Send to the second image processor, the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image.
  • the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
  • FIG. 2 is another schematic flow chart of the image processing method provided by the embodiment of the present application.
  • the image processing method includes:
  • Step 201 acquire the original data of the initial image and send it to the first image processor.
  • the above initial image may be an image of the current scene acquired by the camera sensor of the electronic device when shooting.
  • the initial image acquired by the camera sensor can be transmitted to the first image processor through the MIPI (Mobile Industry Processor Interface, Mobile Industry Processor Interface) protocol, wherein the above-mentioned first image processor is preISP.
  • MIPI Mobile Industry Processor Interface, Mobile Industry Processor Interface
  • Step 202 if the initial image is multi-frame, select a reference frame image from the multi-frame initial image.
  • step 203 multiple frames of initial images are synthesized according to the reference frame images.
  • a high dynamic range image may be acquired through multi-frame synthesis and used as the initial image after synthesis.
  • the above-mentioned multiple frames of images may be images captured multiple times by one camera according to different shooting parameters, or may be images obtained by shooting separately by multiple cameras according to different shooting parameters.
  • the above-mentioned shooting parameters may be exposure parameters, and the exposure parameters include an exposure value (ie, commonly known as an EV value) or an exposure duration.
  • the electronic device may acquire multi-frame initial images of the current scene in a manner in which the preset short exposure time and long exposure time overlap.
  • one initial image is a short-exposure image
  • the other initial image is a long-exposure image.
  • the electronic device may also acquire multiple frames of initial images of the current scene according to different exposure values, wherein the electronic device may acquire multiple frames of initial images of the current scene according to The preset overexposure value and preset underexposure value respectively expose the current scene to obtain two initial images of the current scene. The scene is exposed, and three initial images of the current scene are obtained.
  • one image can be further selected as a reference frame, for example, the image with the highest average brightness can be selected as a reference frame, and then multiple frames of initial images are synthesized based on the reference frame.
  • step 204 the first image processor acquires the shooting scene corresponding to the synthesized initial image.
  • Step 205 determine the target compression rate according to the shooting scene, and compress the original data of the initial image with the target compression rate.
  • the first image processor when compressing the initial image, can also be used to conveniently obtain the characteristics of the shooting scene of the camera, and determine the corresponding target compression rate according to the shooting scene.
  • the shooting scene can include a shooting mode.
  • a higher target compression rate can be used for compression.
  • a lower target compression ratio can be used for the night scene shooting mode. The target compression ratio for compression.
  • the corresponding target compression rate may also be determined according to the parameters of the camera. For example, for the main camera with high camera quality, use a lower target compression rate for compression, and for other cameras such as macro cameras, telephoto cameras, etc., you can use a higher target compression rate for compression.
  • the shooting scene includes shooting mode and camera parameters, wherein, the step of determining the target compression rate according to the shooting scene includes:
  • a preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
  • different compression methods can also be selected for compression according to the shooting scene, wherein the compression methods include lossless compression and lossy compression.
  • the image quality of lossless compression is the same as that of uncompressed, but The file size is about 30% to 90% (14-bit RAW), or 45% to 100% (16-bit RAW) of the uncompressed, lossless compression. After compressing the RAW image, the image quality is about the same as the uncompressed, But the resulting file size is about 25% to 35% (14-bit RAW), or 30% to 40% (16-bit RAW) of its uncompressed size.
  • lossless compression is used for scenes that require more accurate image information
  • lossy compression can be used for other scenes, so as to further reduce the capacity of image data and improve subsequent image processing efficiency.
  • Step 206 transmit the compressed data to the second image processor via MIPI.
  • the preISP can be sent to the second image processor after being compressed, and the second image processor can be an ISP.
  • the compressed data can be sent to the ISP through the MIPI protocol VCO.
  • the first image processor at the front end that is, preISP, is used to compress and convert the high-bandwidth image data into image data with a greatly reduced data volume, and then send it to the back-end ISP through MIPI, and then send it to the ISP pipeline for processing after decompression. Reduce bandwidth requirements without reducing size.
  • Step 207 the second image processor decompresses the compressed data to obtain restored data.
  • the second image processor first receives the compressed data and directly stores it in the memory, and decompresses it after receiving all the compressed data.
  • the memory may be a double rate synchronous graphic random access memory. Through data decompression, the compressed data stored in the image can be decompressed and restored to RAW-DATA, that is, restored data.
  • Step 208 extract the YUV data in the restored data, and encode the YUV data to generate the target image.
  • data conversion may be performed on the Raw image first to obtain a YUV image, and then a video encoder is used to encode the YUV image to obtain a target image.
  • the input target image may be a JPG image.
  • the general platform ISP supports multiple CSIs, but one CSI does not support excessive data volume such as 100 million pixel images, and multiple merging can be supported.
  • the camera sensor does not support simultaneous output to Multiple CSIs.
  • this application uses each CSI to share part of the data volume, so as not to violate the transmission quantity of each protocol.
  • the image processing method can obtain the original data of the initial image and send it to the first image processor.
  • the frame image synthesizes multiple frames of initial images
  • the first image processor obtains the shooting scene corresponding to the synthesized initial image, determines the target compression rate according to the shooting scene, and compresses the original data of the initial image with the target compression rate, and moves
  • the industrial processor interface MIPI transmits the compressed data to the second image processor
  • the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image.
  • the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
  • FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
  • the image processing device 30 is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
  • An acquisition module 301 configured to acquire the original data of the initial image and send it to the first image processor
  • a decompression module 303 configured for the second image processor to decompress the compressed data to obtain restored data
  • the generating module 304 is configured to extract YUV data in the restored data, and encode the YUV data to generate a target image.
  • the compression module 302 may specifically include:
  • An acquisition submodule 3021 configured for the first image processor to acquire the shooting scene corresponding to the initial image
  • the compression sub-module 3022 is configured to determine a target compression rate according to the shooting scene, and compress the original data of the initial image with the target compression rate to obtain compressed data;
  • the sending submodule 3023 is configured to send the compressed data to the second image processor.
  • the image processing device 30 may further include:
  • a selection module 305 configured to select a reference frame image from the multi-frame initial image when the initial image is multi-frame;
  • the synthesis module 306 is configured to synthesize the multiple frames of initial images according to the reference frame images.
  • the shooting scene includes a shooting mode and camera parameters
  • the compression submodule 3022 can also be used to: search for a shooting scene sample that is the same as the shooting mode and camera parameters in a preset correspondence; obtain the The preset compression ratio corresponding to the shooting scene sample is determined as the target compression ratio.
  • the sending submodule 3023 may also be configured to: transmit the compressed data to the second image processor through a mobile industry processor interface MIPI.
  • the selection module 305 may also be configured to: select an image with the highest average brightness from the multiple frames of initial images as the reference frame image.
  • the compression submodule 3022 can also be used to: determine a compression method according to the shooting scene, and compress the original data of the initial image in the compression method, the compression method includes lossless compression and lossy compression.
  • the generation module 304 may also be configured to: perform noise reduction processing on the target image, perform tone mapping processing on the image after noise reduction processing, and display the image after tone mapping as a preview image on the target image. on the screen of the above-mentioned electronic device.
  • the image processing device 30 of the embodiment of the present application can acquire the original data of the initial image and send it to the first image processor, and the first image processor compresses the original data of the initial image to obtain compressed data and compress the data Send to the second image processor, the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image.
  • the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
  • the image processing device and the image processing method in the above embodiments belong to the same concept, and any method provided in the image processing method embodiment can be run on the image processing device, and its specific implementation process can be found in image processing The embodiment of the method will not be repeated here.
  • module may be considered a software object that executes on the computing system.
  • the various components, modules, engines and services described herein can be considered as implementation objects on the computing system.
  • the devices and methods described herein can be implemented in the form of software, and of course can also be implemented in hardware, all of which are within the protection scope of the present application.
  • the embodiment of the present application also provides a storage medium on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute the above-mentioned image processing method.
  • the embodiment of the present application also provides an electronic device, such as a tablet computer, a mobile phone, and the like.
  • the electronic device includes a first image processor, a second image processor, a central processing unit and a memory, and the central processor in the electronic device will load instructions corresponding to the process of one or more application programs into the memory according to the following steps In, and by the central processing unit to run the application program stored in the memory, so as to achieve various functions:
  • the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
  • the second image processor decompresses the compressed data to obtain restored data
  • an electronic device 400 includes a processor 401 and a memory 402 .
  • the processor 401 is electrically connected with the memory 402 .
  • the processor 400 is the control center of the electronic device 400. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or loading computer programs stored in the memory 402 and calling data stored in the memory 402, the processor 400 executes electronic functions. various functions of the device 400 and process data, so as to monitor the electronic device 400 as a whole.
  • the memory 402 can be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by running the computer programs and modules stored in the memory 402 .
  • the memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, computer programs required by at least one function (such as sound playback function, image playback function, etc.); Data created by the use of electronic devices, etc.
  • the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
  • the memory 402 may further include a memory controller to provide the processor 401 with access to the memory 402 .
  • the processor 401 in the electronic device 400 will follow the steps below to load the instructions corresponding to the process of one or more computer programs into the memory 402, and run the instructions stored in the memory 402 by the processor 401.
  • the computer program in the computer so as to realize various functions, as follows:
  • the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
  • the second image processor decompresses the compressed data to obtain restored data
  • the processor 401 when the processor 401 executes the step of compressing the original data of the initial image by the first image processor, it may execute: the first image processor acquires the Shooting a scene; determining a target compression rate according to the shooting scene, and compressing the original data of the initial image with the target compression rate.
  • the shooting scene includes a shooting mode and camera parameters
  • the processor 401 executes the step of determining the target compression rate according to the shooting scene, it may perform: searching A shooting scene sample with the same mode and camera parameters; obtaining a preset compression rate corresponding to the shooting scene sample, and determining it as the target compression rate.
  • the processor 401 when the processor 401 executes the step of sending the compressed data to the second image processor, it may perform: transmit the compressed data to the second image processor through the mobile industry processor interface MIPI image processor.
  • the processor 401 may execute: if the initial image is multi-frame, from the multi-frame A reference frame image is selected from the initial image; and the multi-frame initial image is synthesized according to the reference frame image.
  • the processor 401 when the processor 401 executes the step of selecting a reference frame image from the multiple frames of initial images, it may perform: selecting an image with the highest average brightness from the multiple frames of initial images as the reference frame image.
  • the processor 401 when the processor 401 executes the step of compressing the original data of the initial image by the first image processor, it may execute: the first image processor acquires the Shooting the scene; determining a compression method according to the shooting scene, and compressing the original data of the initial image in the compression method, the compression method includes lossless compression and lossy compression.
  • the processor 401 may perform: performing noise reduction processing on the target image, and performing tone mapping processing on the image after the noise reduction processing , and display the tone-mapped image on the screen of the electronic device as a preview image.
  • the electronic device 400 may further include: a display 403 , a radio frequency circuit 404 , an audio circuit 405 and a power supply 406 .
  • the display 403 , the radio frequency circuit 404 , the audio circuit 405 and the power supply 406 are respectively electrically connected to the processor 401 .
  • the display 403 can be used to display information input by or provided to the user and various graphical user interfaces, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof.
  • the display 403 may include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
  • the radio frequency circuit 404 can be used to send and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to send and receive signals with network equipment or other electronic equipment.
  • the radio frequency circuit 501 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM, Subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc.
  • SIM Subscriber Identity Module
  • LNA Low Noise Amplifier
  • the audio circuit 405 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
  • the audio circuit 506 can convert the received audio data into an electrical signal, transmit it to the speaker, and convert it into an audio signal for output by the speaker.
  • the power supply 406 may be used to power various components of the electronic device 400 .
  • the power supply 406 can be logically connected to the processor 401 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.
  • the power supply 406 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
  • the electronic device 400 may also include a camera, a Bluetooth module, etc., which will not be repeated here.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
  • the computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
  • each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, magnetic disk or optical disk.

Abstract

An image processing method. The method comprises: acquiring original data of an initial image, and sending same to a first image processor; the first image processor compressing the original data of the initial image, so as to obtain compressed data, and sending the compressed data to a second image processor; the second image processor decompressing the compressed data, so as to obtain restored data; and extracting YUV data from the restored data, and encoding the YUV data to generate a target image.

Description

图像处理方法、装置、存储介质及电子设备Image processing method, device, storage medium and electronic equipment
本申请要求于2021年07月28日提交专利局、申请号为202110857728.6、申请名称为“图像处理方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110857728.6 and the application name "image processing method, device, storage medium and electronic equipment" submitted to the Patent Office on July 28, 2021, the entire contents of which are incorporated by reference in In this application.
技术领域technical field
本申请属于图像处理技术领域,尤其涉及一种图像处理方法、装置、存储介质及电子设备。The present application belongs to the technical field of image processing, and in particular relates to an image processing method, device, storage medium and electronic equipment.
背景技术Background technique
随着终端技术的发展,终端已经开始从以前简单地提供通话设备渐渐变成一个通用软件运行的平台。该平台不再以提供通话管理为主要目的,而是提供一个包括通话管理、游戏娱乐、办公记事、移动支付等各类应用软件在内的运行环境,随着大量的普及,已经深入至人们的生活、工作的方方面面。With the development of terminal technology, the terminal has gradually changed from simply providing communication equipment in the past to a platform for general software operation. The platform no longer aims to provide call management, but to provide an operating environment including call management, game entertainment, office notes, mobile payment and other application software. With a large number of popularization, it has penetrated into people's All aspects of life and work.
目前,由于智能终端的硬件性能越来越高,尤其是摄像头传感器的规格越来越好,成像的质量也越来越高。At present, as the hardware performance of smart terminals is getting higher and higher, especially the specifications of camera sensors are getting better and better, and the imaging quality is getting higher and higher.
发明内容Contents of the invention
本申请提供一种图像处理方法、装置、存储介质及电子设备,可以减小传输的数据量,降低图像处理芯片传输数据的压力,从而提升图像处理效率。The present application provides an image processing method, device, storage medium and electronic equipment, which can reduce the amount of data to be transmitted, reduce the pressure on the image processing chip to transmit data, and thereby improve image processing efficiency.
第一方面,本申请实施例提供一种图像处理方法,应用于电子设备,所述电子设备包括第一图像处理器和第二图像处理器,包括:In the first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
第二方面,本申请实施例提供一种图像处理装置,应用于电子设备,所述电子设备包括第一图像处理器和第二图像处理器,包括:In a second aspect, an embodiment of the present application provides an image processing apparatus, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
获取模块,用于获取初始图像的原始数据并发送至所述第一图像处理器;an acquisition module, configured to acquire the original data of the initial image and send it to the first image processor;
压缩模块,用于所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;a compression module, configured for the first image processor to compress the original data of the initial image, obtain compressed data and send the compressed data to the second image processor;
解压模块,用于所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;A decompression module, used for the second image processor to decompress the compressed data to obtain restored data;
生成模块,用于提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。A generating module, configured to extract YUV data in the restored data, and encode the YUV data to generate a target image.
第三方面,本申请实施例提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述的图像处理方法。In a third aspect, the embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute the above-mentioned image processing method.
第四方面,本申请实施例提供一种电子设备,包括第一图像处理器、第二图像处理器、 中央处理器和存储器,所述存储器存储有多条指令,所述中央处理器加载所述存储器中的指令用于执行以下步骤:In a fourth aspect, an embodiment of the present application provides an electronic device, including a first image processor, a second image processor, a central processing unit, and a memory, the memory stores a plurality of instructions, and the central processing unit loads the Instructions in memory are used to perform the following steps:
获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例提供的图像处理方法的一种流程示意图。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
图2为本申请实施例提供的图像处理方法的另一流程示意图。FIG. 2 is another schematic flowchart of the image processing method provided by the embodiment of the present application.
图3为本申请实施例提供的图像处理装置的一种结构示意图。FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
图4为本申请实施例提供的图像处理装置的另一结构示意图。FIG. 4 is another schematic structural diagram of an image processing device provided by an embodiment of the present application.
图5为本申请实施例提供的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
图6为本申请实施例提供的电子设备的另一结构示意图。FIG. 6 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Referring to the drawings, wherein the same reference numerals represent the same components, the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application, which should not be construed as limiting other specific embodiments of the present application that are not described in detail here.
在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise stated. Accordingly, these steps and operations will several times be referred to as being computer-implemented, which herein refers to operations by a computer processing unit of electronic signals representing data in a structured form. This operation transforms the data or maintains it at a location in the computer's memory system that can reconfigure or otherwise alter the operation of the computer in a manner well known to testers in the art. The data structures maintained by the data are physical locations in the memory that have certain characteristics defined by the data format. However, the principle of the present application is described in the above text, which is not meant to be a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first", "second" and "third" in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.
本申请实施例提供一种图像处理方法,应用于电子设备,所述电子设备包括第一图像 处理器和第二图像处理器,其中,所述方法包括以下步骤:An embodiment of the present application provides an image processing method, which is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, wherein the method includes the following steps:
获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
在一实施例中,所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤,包括:In one embodiment, the step of compressing the original data of the initial image by the first image processor includes:
所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩。A target compression rate is determined according to the shooting scene, and the original data of the initial image is compressed at the target compression rate.
在一实施例中,所述拍摄场景包括拍摄模式以及摄像头参数,其中,根据所述拍摄场景确定目标压缩率的步骤,包括:In an embodiment, the shooting scene includes a shooting mode and camera parameters, wherein the step of determining the target compression rate according to the shooting scene includes:
在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;Searching for the same shooting scene sample as the shooting mode and camera parameters in the preset corresponding relationship;
获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。A preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
在一实施例中,将所述压缩数据发送至所述第二图像处理器的步骤,包括:In one embodiment, the step of sending the compressed data to the second image processor includes:
通过移动产业处理器接口MIPI传输所述压缩数据至所述第二图像处理器。and transmitting the compressed data to the second image processor through MIPI.
在一实施例中,在所述第一图像处理器对所述初始图像的原始数据进行压缩之前,所述方法还包括:In an embodiment, before the first image processor compresses the raw data of the initial image, the method further includes:
若所述初始图像为多帧,则从所述多帧初始图像中选取参考帧图像;If the initial image is multi-frame, then select a reference frame image from the multi-frame initial image;
根据所述参考帧图像对所述多帧初始图像进行合成。The multi-frame initial images are synthesized according to the reference frame images.
在一实施例中,从所述多帧初始图像中选取参考帧图像的步骤,包括:In one embodiment, the step of selecting a reference frame image from the multiple frames of initial images includes:
从所述多帧初始图像中选取平均亮度最高的图像作为所述参考帧图像。An image with the highest average brightness is selected from the multiple frames of initial images as the reference frame image.
在一实施例中,所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤,包括:In one embodiment, the step of compressing the original data of the initial image by the first image processor includes:
所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
根据所述拍摄场景确定压缩方式,并以所述压缩方式对所述初始图像的原始数据进行压缩,所述压缩方式包括无损压缩和有损压缩。A compression mode is determined according to the shooting scene, and the original data of the initial image is compressed in the compression mode, and the compression mode includes lossless compression and lossy compression.
在一实施例中,对所述YUV数据进行编码以生成目标图像之后,所述方法还包括:In one embodiment, after encoding the YUV data to generate a target image, the method further includes:
对所述目标图像进行降噪处理,并将降噪处理后的图像进行色调映射处理,并将色调映射后的图像作为预览图像显示至所述电子设备的屏幕上。performing noise reduction processing on the target image, and performing tone mapping processing on the image after noise reduction processing, and displaying the image after tone mapping on the screen of the electronic device as a preview image.
请参阅图1,图1为本申请实施例提供的图像处理方法的一种流程示意图。本申请实施例提供的图像处理方法应用于电子设备,电子设备包括第一图像处理器和第二图像处理器,具体流程可以如下:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of an image processing method provided in an embodiment of the present application. The image processing method provided in the embodiment of the present application is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, and the specific process may be as follows:
步骤101,获取初始图像的原始数据并发送至第一图像处理器。 Step 101, acquire the original data of the initial image and send it to the first image processor.
在一实施例中,上述初始图像可以为电子设备的成像装置在进行拍摄时获取当前场景 的图像。该成像装置可以是前置摄像头、后置摄像头等。启动电子设备的成像装置,使其进入拍照预览模式,并将被拍摄的场景显示在电子设备的显示窗口,并将此时显示窗口所显示的画面定义为预览图像。其中,成像装置硬件上一般包括五个部分:外壳(马达)、镜头、红外滤光片、图像传感器(例如CCD或COMS)和挠性印刷电路板(FPCB)等。在拍照预览模式下,显示预览图像的过程中,镜头在马达的驱动下移动,被拍摄的物体经过镜头在图像传感器上成像。图像传感器通过光-电转换将光信号转换为电信号输给图像处理电路进行后续处理。其中,图像处理电路可以利用硬件和/或软件组件实现,可包括定义ISP(Image Signal Processing,图像信号处理)管线的各种处理单元。In an embodiment, the above initial image may be an image of the current scene acquired by the imaging device of the electronic device when shooting. The imaging device may be a front camera, a rear camera, and the like. Start the imaging device of the electronic device, make it enter the photo preview mode, and display the captured scene on the display window of the electronic device, and define the picture displayed in the display window as a preview image. Among them, the hardware of the imaging device generally includes five parts: a housing (motor), a lens, an infrared filter, an image sensor (such as CCD or COMS), and a flexible printed circuit board (FPCB). In the photo preview mode, during the process of displaying the preview image, the lens moves under the drive of the motor, and the object to be photographed passes through the lens and forms an image on the image sensor. The image sensor converts the optical signal into an electrical signal through optical-electrical conversion and sends it to the image processing circuit for subsequent processing. Wherein, the image processing circuit may be realized by hardware and/or software components, and may include various processing units defining an ISP (Image Signal Processing, image signal processing) pipeline.
在一实施例中,摄像头传感器在拍摄获取到初始图像可以通过MIPI(Mobile Industry Processor Interface,移动产业处理器接口)协议传输到第一图像处理器,其中,上述第一图像处理器为preISP,用于进行前期影像处理。举例来说,可以使用MIPI协议VC0传输初始图像,所有的数据按行发出。In one embodiment, the initial image acquired by the camera sensor can be transmitted to the first image processor through the MIPI (Mobile Industry Processor Interface, mobile industry processor interface) protocol, wherein the above-mentioned first image processor is preISP, used for pre-image processing. For example, the initial image can be transmitted using MIPI protocol VCO, all data is sent out by line.
步骤102,第一图像处理器对初始图像的原始数据进行压缩,得到压缩数据并将压缩数据发送至第二图像处理器。 Step 102, the first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor.
在一实施例中,上述初始图像为Raw图像,Raw图像就是CMOS或者CCD图像感应器将捕捉到的光源信号转化为数字信号的原始数据。当第一图像处理器接收所述初始图像并在确定接收完毕后,可以对初始图像进行压缩,并在压缩后发送至第二图像处理器,该第二图像处理器可以为ISP。In one embodiment, the above-mentioned initial image is a Raw image, and the Raw image is the original data converted from the light source signal captured by the CMOS or CCD image sensor into a digital signal. When the first image processor receives the initial image and determines that the reception is complete, the initial image may be compressed and sent to the second image processor after compression, and the second image processor may be an ISP.
具体的,在现有技术当中,摄像头传感器拍摄得到的初始图像数据若直接传输至ISP进行处理,数据量较为庞大。以摄像头传感器输出图像大小1亿像素,1秒内30帧的帧率,1个像素8bit为例来进行说明,通过MIPI接口进行传输时,此时通过计算可知在一秒内的MIPI数据量为22.35GB。而现在市面上较为主流的平台SM8150,也即高通骁龙855处理器,该平台支持两种端口物理层分别为D-PHY和C-PHY,经计算D-PHY一秒内的平台带宽约为9GB,D-PHY一秒内的平台带宽约为21.56GB,因此均小于实际传输能力22.35Gb,所以SM8150单条CSI(C-PHY/D-PHY)无法满足摄像头传感器的1亿像素输出。现有技术中一般做法是通过Binning技术来进行缩放,Binning是一种图像读出模式,将相邻像元感应的电荷加在一起,以一个像素的模式读出,提高灵敏度和输出速度,降低分辨率。比如摄像头传感器输出108M图像再经过Binning之后,输出27M拜尔图像,ISP处理27M的拜尔图像,输出27M的YUV图像,YUV图像经过超分辨率技术输出108M的图像。但是这种方式会使得图像的解析力下降,还会在图像中产生些马赛克区域。Specifically, in the prior art, if the initial image data captured by the camera sensor is directly transmitted to the ISP for processing, the amount of data is relatively large. Take the camera sensor output image size of 100 million pixels, the frame rate of 30 frames in 1 second, and 8 bits per pixel as an example. When transmitting through the MIPI interface, the amount of MIPI data in one second can be known by calculation. 22.35GB. Now, the mainstream platform SM8150 on the market is the Qualcomm Snapdragon 855 processor. This platform supports two physical layers of ports: D-PHY and C-PHY. It is calculated that the platform bandwidth of D-PHY within one second is about 9GB, the platform bandwidth of D-PHY within one second is about 21.56GB, so they are both smaller than the actual transmission capacity of 22.35Gb, so a single CSI (C-PHY/D-PHY) of SM8150 cannot meet the 100 million pixel output of the camera sensor. The general practice in the prior art is to use Binning technology to zoom. Binning is an image readout mode that adds the charges induced by adjacent pixels together and reads out in a pixel mode, which improves sensitivity and output speed, and reduces resolution. For example, the camera sensor outputs a 108M image and after Binning, it outputs a 27M Bayer image, the ISP processes the 27M Bayer image, outputs a 27M YUV image, and the YUV image outputs a 108M image through super-resolution technology. However, this method will reduce the resolution of the image and produce some mosaic areas in the image.
因此为了解决上述问题,本申请实施例可以通过第一图像处理器对初始图像进行压缩,比如进行无损压缩。其中无损压缩是指使用压缩后的图像数据进行解压缩,解压缩后的数据与原来的数据完全相同。无损压缩可以使要求重构的数据与原始数据完全一致。其中上述无损压缩的方法可以包括LZ77算法、LZ78算法、LZW算法、LZSS算法、霍夫曼编码算法、香浓-范诺编码算法的其中一种。在压缩后其图像质量与未压缩时相同,但是生成的文件尺寸约为未压缩时的30%至90%(14位RAW),或45%至100%(16位RAW)。Therefore, in order to solve the above problem, the embodiment of the present application may use the first image processor to compress the original image, for example, to perform lossless compression. The lossless compression refers to decompressing the compressed image data, and the decompressed data is exactly the same as the original data. Lossless compression can make the reconstructed data exactly the same as the original data. The aforementioned lossless compression method may include one of LZ77 algorithm, LZ78 algorithm, LZW algorithm, LZSS algorithm, Huffman coding algorithm, and Shannon-Fano coding algorithm. The image quality is the same after compression as uncompressed, but the resulting file size is approximately 30% to 90% (14-bit RAW), or 45% to 100% (16-bit RAW) of the uncompressed size.
进一步的,在第一图像处理器对初始图象压缩完成后,便可以发送至第二图像处理器,比如通过MIPI协议VC0将压缩数据发送至ISP。Further, after the first image processor finishes compressing the initial image, it can be sent to the second image processor, for example, the compressed data is sent to the ISP through the MIPI protocol VCO.
在一实施例中,可以根据预设的压缩率来进行压缩,比如70%或80等,该预设压缩率可以根据图像数据的容量大小来进行设置。进一步的,在压缩完成后还可以进一步判断压缩后的数据是否满足预设的压缩率,如果压缩后的数据大小与压缩前的数据大小之比不大于该压缩率,则表示压缩成功;如果压缩后的数据大小与压缩前的数据大小之比大于该压缩率,则表示压缩失败。In an embodiment, the compression can be performed according to a preset compression ratio, such as 70% or 80, and the preset compression ratio can be set according to the capacity of the image data. Furthermore, after the compression is completed, it can be further judged whether the compressed data meets the preset compression rate. If the ratio of the compressed data size to the pre-compressed data size is not greater than the compression rate, it means that the compression is successful; if the compressed If the ratio of the post-compression data size to the pre-compression data size is greater than the compression ratio, it means that the compression fails.
步骤103,第二图像处理器对压缩数据进行解压,以得到还原数据。 Step 103, the second image processor decompresses the compressed data to obtain restored data.
在一实施例中,第二图像处理器先接收上述压缩数据,并直接存储在存储器中,在全部压缩数据接收完毕后,则可以进行解压缩。其中存储器可为同步动态随机存储器(Synchronous Dynamic Random Access Memory,SDRAM),双倍速率同步动态随机存储器(Double Data Rate SDRAM,DDR SDRAM),同步图形随机存储器(Synchronous Graphics Random-Access Memory,SGRAM)或者双倍速率同步图形随机存储器(Double Data Rate SGRAM,DDR SGRAM)等。In one embodiment, the second image processor first receives the compressed data and directly stores it in the memory, and decompresses it after receiving all the compressed data. The memory can be Synchronous Dynamic Random Access Memory (Synchronous Dynamic Random Access Memory, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Synchronous Graphics Random-Access Memory (SGRAM) or Double rate synchronous graphics random access memory (Double Data Rate SGRAM, DDR SGRAM), etc.
具体的,通过数据解压就可以将存储在图像中的压缩后的数据解压还原成RAW-DATA也即还原数据。需要说明的是,第一图像处理器在进行数据压缩后,还需要进行数据封装,图像数据封装是用数据描述实际的图像数据,称为该类型数据为元数据,主要是描述数据属性信息。数据封装之后,输出的就是图像文件。因此,在第二图像处理器进行解压缩后,可以通过元数据定位到数据码流的具体位置。另外,还可以通过文件后缀名,或者封装产生的元数据判断当前文件使用的是哪种压缩方式(例如,PBM、PGM、PPM格式的图像的文件在最开始的几个字节会说明图像是属于什么类型的,例如PBM是P1或P4等),从而确定应该采用哪种解压方式还原数据。最后对数据码流进行解压还原,最终输出的是图像的RAW-DATA。Specifically, through data decompression, the compressed data stored in the image can be decompressed and restored to RAW-DATA, that is, restored data. It should be noted that after data compression, the first image processor also needs to perform data encapsulation. Image data encapsulation uses data to describe actual image data. This type of data is called metadata, which mainly describes data attribute information. After the data is encapsulated, the output is an image file. Therefore, after the second image processor performs decompression, the specific location of the data code stream can be located through the metadata. In addition, you can also judge which compression method is used by the current file through the file suffix name or the metadata generated by the package (for example, the first few bytes of the image file in PBM, PGM, and PPM formats will indicate that the image is It belongs to what type, for example, PBM is P1 or P4, etc.), so as to determine which decompression method should be used to restore the data. Finally, the data code stream is decompressed and restored, and the final output is the RAW-DATA of the image.
步骤104,提取还原数据中的YUV数据,对YUV数据进行编码以生成目标图像。 Step 104, extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
在一实施例中,可以先对Raw图像进行数据转换以得到YUV图像,再通过视频编码器对YUV图像进行编码处理,得到目标图像。其中,输入的目标图像可以为JPG图像或者JPEG图像等。In an embodiment, data conversion may be performed on the Raw image first to obtain a YUV image, and then a video encoder is used to encode the YUV image to obtain a target image. Wherein, the input target image may be a JPG image or a JPEG image or the like.
在一实施例中,可以在生成目标图像后将其作为预览图象显示至电子设备的屏幕上。进一步的,在生成目标图像后,还可以对目标图像进行后续处理,比如降噪处理,然后,电子设备可以对该降噪后的图像进行色调映射处理(Tone Mapping),从而得到最终的图像。可以理解的是,对该降噪后的图像进行色调映射处理可以提高图像的图像对比度,从而使得目标图像具有更高的动态范围,成像效果更好。电子设备还可以将色调映射处理后的图像作为当前场景的预览图像在电子设备的屏幕上进行展示。In one embodiment, after the target image is generated, it can be displayed as a preview image on the screen of the electronic device. Further, after the target image is generated, subsequent processing may be performed on the target image, such as noise reduction processing, and then the electronic device may perform tone mapping processing (Tone Mapping) on the noise reduction image to obtain a final image. It can be understood that performing tone mapping processing on the noise-reduced image can improve the image contrast of the image, so that the target image has a higher dynamic range and better imaging effect. The electronic device may also display the tone-mapped image on the screen of the electronic device as a preview image of the current scene.
可以理解的是,预览图像的实际分辨率大于屏幕显示的分辨率情况,相较于预览图像的实际分辨率等于屏幕显示分辨率的情况并不会获得更好的显示效果。因此,在将预览图像在电子设备的屏幕上进行展示之前,还可以先获取到屏幕当前的分辨率,再根据屏幕当 前的分辨率对预览图像进行降采样处理,使得预览图像的分辨率与屏幕当前的分辨率一致。这样,能够提高多帧合成的合成效率,并且在将预览图像进行展示时,也不会降低其显示效果。It can be understood that when the actual resolution of the preview image is greater than the resolution of the screen display, a better display effect will not be obtained compared with the case where the actual resolution of the preview image is equal to the resolution of the screen display. Therefore, before the preview image is displayed on the screen of the electronic device, the current resolution of the screen can also be obtained first, and then the preview image is down-sampled according to the current resolution of the screen, so that the resolution of the preview image is the same as that of the screen. The current resolution is the same. In this way, the synthesis efficiency of multi-frame synthesis can be improved, and when the preview image is displayed, its display effect will not be reduced.
由上可知,本申请实施例提供的图像处理方法可以获取初始图像的原始数据并发送至第一图像处理器,第一图像处理器对初始图像的原始数据进行压缩,得到压缩数据并将压缩数据发送至第二图像处理器,第二图像处理器对压缩数据进行解压,以得到还原数据,提取还原数据中的YUV数据,对YUV数据进行编码以生成目标图像。本申请实施例可以先通过第一图像处理器对初始图像的原始数据进行压缩再发送至第二图像处理器进行图像处理,减小传输的数据量,从而提升图像处理的效率。It can be seen from the above that the image processing method provided by the embodiment of the present application can obtain the original data of the initial image and send it to the first image processor, and the first image processor will compress the original data of the initial image to obtain compressed data and compress the data Send to the second image processor, the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image. In the embodiment of the present application, the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
下面将在上述实施例描述的方法基础上,对本申请的图像处理方法做进一步介绍。参阅图2,图2为本申请实施例提供的图像处理方法的另一流程示意图,该图像处理方法包括:The image processing method of the present application will be further introduced below on the basis of the methods described in the above embodiments. Referring to FIG. 2, FIG. 2 is another schematic flow chart of the image processing method provided by the embodiment of the present application. The image processing method includes:
步骤201,获取初始图像的原始数据并发送至第一图像处理器。 Step 201, acquire the original data of the initial image and send it to the first image processor.
在一实施例中,上述初始图像可以为电子设备的摄像头传感器在进行拍摄时获取当前场景的图像。摄像头传感器在拍摄获取到初始图像可以通过MIPI(Mobile Industry Processor Interface,移动产业处理器接口)协议传输到第一图像处理器,其中,上述第一图像处理器为preISP。In an embodiment, the above initial image may be an image of the current scene acquired by the camera sensor of the electronic device when shooting. The initial image acquired by the camera sensor can be transmitted to the first image processor through the MIPI (Mobile Industry Processor Interface, Mobile Industry Processor Interface) protocol, wherein the above-mentioned first image processor is preISP.
步骤202,若初始图像为多帧,则从多帧初始图像中选取参考帧图像。 Step 202, if the initial image is multi-frame, select a reference frame image from the multi-frame initial image.
步骤203,根据参考帧图像对多帧初始图像进行合成。In step 203, multiple frames of initial images are synthesized according to the reference frame images.
在一实施例中,若初始图像为多帧,则可以通过多帧合成的方式获取高动态范围图像并作为合成后的初始图像。其中上述多帧图像可以为一个摄像头根据不同的拍摄参数多次拍摄得到的图像,也可以为多个摄像头根据不同的拍摄参数分别拍摄得到的图像。举例来说,上述拍摄参数可以为曝光参数,曝光参数包括曝光值(即俗称的EV值)或曝光时长。在按照不同曝光参数获取当前场景的多帧初始图像时,电子设备可以按照预设短曝光时长和长曝光时长交叠的方式获取当前场景的多帧初始图像。换言之,即两个相邻曝光的初始图像中,一个初始图像为短曝光图像,另一个初始图像为长曝光图像。这样即可通过长、短曝合成的方式合成得到当前场景的第一高动态范围图像。In an embodiment, if the initial image consists of multiple frames, a high dynamic range image may be acquired through multi-frame synthesis and used as the initial image after synthesis. The above-mentioned multiple frames of images may be images captured multiple times by one camera according to different shooting parameters, or may be images obtained by shooting separately by multiple cameras according to different shooting parameters. For example, the above-mentioned shooting parameters may be exposure parameters, and the exposure parameters include an exposure value (ie, commonly known as an EV value) or an exposure duration. When acquiring multi-frame initial images of the current scene according to different exposure parameters, the electronic device may acquire multi-frame initial images of the current scene in a manner in which the preset short exposure time and long exposure time overlap. In other words, among two adjacently exposed initial images, one initial image is a short-exposure image, and the other initial image is a long-exposure image. In this way, the first high dynamic range image of the current scene can be synthesized by means of long-exposure and short-exposure synthesis.
作为另一种可选的实施方式,在按照不同曝光参数获取当前场景的多帧初始图像时,电子设备还可以按照不同的曝光值来获取当前场景的多帧初始图像,其中,电子设备可以按照预设过曝光值和预设欠曝光值分别对当前场景进行曝光,得到当前场景的两个初始图像,还可以按照预设过曝光值、预设正常曝光值以及预设欠曝光值分别对当前场景进行曝光,得到当前场景的三个初始图像等。As another optional implementation manner, when acquiring multiple frames of initial images of the current scene according to different exposure parameters, the electronic device may also acquire multiple frames of initial images of the current scene according to different exposure values, wherein the electronic device may acquire multiple frames of initial images of the current scene according to The preset overexposure value and preset underexposure value respectively expose the current scene to obtain two initial images of the current scene. The scene is exposed, and three initial images of the current scene are obtained.
在得到多帧初始图像后,还可以进一步从中选取一张图像作为参考帧,比如可以选取平均亮度最高的图像作为参考帧,然后基于该参考帧对多帧初始图像进行合成。After obtaining multiple frames of initial images, one image can be further selected as a reference frame, for example, the image with the highest average brightness can be selected as a reference frame, and then multiple frames of initial images are synthesized based on the reference frame.
步骤204,第一图像处理器获取合成后的初始图像对应的拍摄场景。In step 204, the first image processor acquires the shooting scene corresponding to the synthesized initial image.
步骤205,根据拍摄场景确定目标压缩率,并以目标压缩率对初始图像的原始数据进 行压缩。 Step 205, determine the target compression rate according to the shooting scene, and compress the original data of the initial image with the target compression rate.
在本申请实施例中,在对初始图像进行压缩时还可以利用第一图像处理器也即preISP方便获取相机拍摄场景的特点,根据拍摄场景确定其对应的目标压缩率。比如该拍摄场景可以包括拍摄模式,针对正常的拍摄模式,可以使用较高的目标压缩率进行压缩,而针对夜景这种拍摄模式,由于夜景的拍摄需要更准确的图像信息,因此可以使用较低的目标压缩率进行压缩。In the embodiment of the present application, when compressing the initial image, the first image processor, that is, preISP, can also be used to conveniently obtain the characteristics of the shooting scene of the camera, and determine the corresponding target compression rate according to the shooting scene. For example, the shooting scene can include a shooting mode. For the normal shooting mode, a higher target compression rate can be used for compression. For the night scene shooting mode, since night scene shooting requires more accurate image information, a lower target compression ratio can be used. The target compression ratio for compression.
在另一实施例中,还可以根据摄像头的参数确定其对应的目标压缩率。比如针对摄像头素质较高的主摄像头,使用较低的目标压缩率进行压缩,而针对其他摄像头比如微距摄像头、长焦摄像头等则可以使用较高的目标压缩率进行压缩。当然还可以综合上述拍摄模式以及摄像头参数来进行综合判断,最终确定目标压缩率。也即所述拍摄场景包括拍摄模式以及摄像头参数,其中,根据所述拍摄场景确定目标压缩率的步骤,包括:In another embodiment, the corresponding target compression rate may also be determined according to the parameters of the camera. For example, for the main camera with high camera quality, use a lower target compression rate for compression, and for other cameras such as macro cameras, telephoto cameras, etc., you can use a higher target compression rate for compression. Of course, the above-mentioned shooting modes and camera parameters can also be combined to make a comprehensive judgment, and finally determine the target compression rate. That is to say, the shooting scene includes shooting mode and camera parameters, wherein, the step of determining the target compression rate according to the shooting scene includes:
在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;Searching for the same shooting scene sample as the shooting mode and camera parameters in the preset corresponding relationship;
获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。A preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
在一实施例中,还可以根据拍摄场景来选择不同的压缩方式进行压缩,其中压缩方式包括无损压缩和有损压缩两种方式,无损压缩在压缩后其图像质量与未压缩时相同,但是生成的文件尺寸约为未压缩时的30%至90%(14位RAW),或45%至100%(16位RAW),无损压缩则在压缩RAW图像后,图像质量与未压缩时大致相同,但是生成的文件尺寸约为未压缩时的25%至35%(14位RAW),或30%至40%(16位RAW)。比如针对需要更准确的图像信息的场景时,使用无损压缩的方式进行压缩,而其他场景则可以用有损压缩的方式,从而进一步减小图像数据的容量,并提升后续的图像处理效率。In an embodiment, different compression methods can also be selected for compression according to the shooting scene, wherein the compression methods include lossless compression and lossy compression. The image quality of lossless compression is the same as that of uncompressed, but The file size is about 30% to 90% (14-bit RAW), or 45% to 100% (16-bit RAW) of the uncompressed, lossless compression. After compressing the RAW image, the image quality is about the same as the uncompressed, But the resulting file size is about 25% to 35% (14-bit RAW), or 30% to 40% (16-bit RAW) of its uncompressed size. For example, lossless compression is used for scenes that require more accurate image information, while lossy compression can be used for other scenes, so as to further reduce the capacity of image data and improve subsequent image processing efficiency.
步骤206,通过移动产业处理器接口MIPI传输压缩数据至第二图像处理器。 Step 206, transmit the compressed data to the second image processor via MIPI.
在本申请实施例中,preISP在压缩后便可以发送至第二图像处理器,该第二图像处理器可以为ISP。具体可以通过MIPI协议VC0将压缩数据发送至ISP。此时利用前端的第一图像处理器也即preISP将高带宽的图像数据经过压缩转换为数据量大大减少的图像数据,再通过MIPI送给后端ISP,解压缩之后再送ISP pipeline处理,从而在不降低尺寸的前提下降低带宽需求。In the embodiment of the present application, the preISP can be sent to the second image processor after being compressed, and the second image processor can be an ISP. Specifically, the compressed data can be sent to the ISP through the MIPI protocol VCO. At this time, the first image processor at the front end, that is, preISP, is used to compress and convert the high-bandwidth image data into image data with a greatly reduced data volume, and then send it to the back-end ISP through MIPI, and then send it to the ISP pipeline for processing after decompression. Reduce bandwidth requirements without reducing size.
步骤207,第二图像处理器对压缩数据进行解压,以得到还原数据。 Step 207, the second image processor decompresses the compressed data to obtain restored data.
在一实施例中,第二图像处理器先接收上述压缩数据,并直接存储在存储器中,在全部压缩数据接收完毕后,则可以进行解压缩。其中存储器可为双倍速率同步图形随机存储器。通过数据解压就可以将存储在图像中的压缩后的数据解压还原成RAW-DATA也即还原数据。In one embodiment, the second image processor first receives the compressed data and directly stores it in the memory, and decompresses it after receiving all the compressed data. Wherein the memory may be a double rate synchronous graphic random access memory. Through data decompression, the compressed data stored in the image can be decompressed and restored to RAW-DATA, that is, restored data.
步骤208,提取还原数据中的YUV数据,对YUV数据进行编码以生成目标图像。 Step 208, extract the YUV data in the restored data, and encode the YUV data to generate the target image.
在一实施例中,可以先对Raw图像进行数据转换以得到YUV图像,再通过视频编码器对YUV图像进行编码处理,得到目标图像。其中,输入的目标图像可以为JPG图像。In an embodiment, data conversion may be performed on the Raw image first to obtain a YUV image, and then a video encoder is used to encode the YUV image to obtain a target image. Wherein, the input target image may be a JPG image.
针对目前市面上的低端平台,一般平台ISP支持多路CSI,但是一条CSI传输时不支持过大的数据量比如1亿像素图像,多条合并可以支持,但是,摄像头传感器不支持同时 输出到多条CSI。而本申请利用preISP将数据分拆之后,利用每条CSI来分担一部分数据量,从而不违反每个协议的传输数量。For the low-end platforms currently on the market, the general platform ISP supports multiple CSIs, but one CSI does not support excessive data volume such as 100 million pixel images, and multiple merging can be supported. However, the camera sensor does not support simultaneous output to Multiple CSIs. However, after splitting the data by preISP, this application uses each CSI to share part of the data volume, so as not to violate the transmission quantity of each protocol.
由上可知,本申请实施例提供的图像处理方法可以获取初始图像的原始数据并发送至第一图像处理器,若初始图像为多帧,则从多帧初始图像中选取参考帧图像,根据参考帧图像对多帧初始图像进行合成,第一图像处理器获取合成后的初始图像对应的拍摄场景,根据拍摄场景确定目标压缩率,并以目标压缩率对初始图像的原始数据进行压缩,通过移动产业处理器接口MIPI传输压缩数据至第二图像处理器,第二图像处理器对压缩数据进行解压,以得到还原数据,提取还原数据中的YUV数据,对YUV数据进行编码以生成目标图像。本申请实施例可以先通过第一图像处理器对初始图像的原始数据进行压缩再发送至第二图像处理器进行图像处理,减小传输的数据量,从而提升图像处理的效率。It can be seen from the above that the image processing method provided by the embodiment of the present application can obtain the original data of the initial image and send it to the first image processor. The frame image synthesizes multiple frames of initial images, the first image processor obtains the shooting scene corresponding to the synthesized initial image, determines the target compression rate according to the shooting scene, and compresses the original data of the initial image with the target compression rate, and moves The industrial processor interface MIPI transmits the compressed data to the second image processor, and the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image. In the embodiment of the present application, the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
请参阅图3,图3为本申请实施例提供的图像处理装置的一种结构示意图。其中该图像处理装置30应用于电子设备,所述电子设备包括第一图像处理器和第二图像处理器,包括:Please refer to FIG. 3 . FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application. Wherein the image processing device 30 is applied to an electronic device, and the electronic device includes a first image processor and a second image processor, including:
获取模块301,用于获取初始图像的原始数据并发送至所述第一图像处理器;An acquisition module 301, configured to acquire the original data of the initial image and send it to the first image processor;
压缩模块302,用于所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;A compression module 302, configured for the first image processor to compress the original data of the initial image, obtain compressed data and send the compressed data to the second image processor;
解压模块303,用于所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;a decompression module 303, configured for the second image processor to decompress the compressed data to obtain restored data;
生成模块304,用于提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。The generating module 304 is configured to extract YUV data in the restored data, and encode the YUV data to generate a target image.
在一实施例中,继续参阅图4,其中所述压缩模块302可以具体包括:In an embodiment, continue to refer to FIG. 4, wherein the compression module 302 may specifically include:
获取子模块3021,用于所述第一图像处理器获取所述初始图像对应的拍摄场景;An acquisition submodule 3021, configured for the first image processor to acquire the shooting scene corresponding to the initial image;
压缩子模块3022,用于根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩,得到压缩数据;The compression sub-module 3022 is configured to determine a target compression rate according to the shooting scene, and compress the original data of the initial image with the target compression rate to obtain compressed data;
发送子模块3023,用于将所述压缩数据发送至所述第二图像处理器。The sending submodule 3023 is configured to send the compressed data to the second image processor.
在一实施例中,所述图像处理装置30还可以包括:In an embodiment, the image processing device 30 may further include:
选取模块305,用于当所述初始图像为多帧时,从所述多帧初始图像中选取参考帧图像;A selection module 305, configured to select a reference frame image from the multi-frame initial image when the initial image is multi-frame;
合成模块306,用于根据所述参考帧图像对所述多帧初始图像进行合成。The synthesis module 306 is configured to synthesize the multiple frames of initial images according to the reference frame images.
在一实施例中,所述拍摄场景包括拍摄模式以及摄像头参数,压缩子模块3022还可以用于:在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。In an embodiment, the shooting scene includes a shooting mode and camera parameters, and the compression submodule 3022 can also be used to: search for a shooting scene sample that is the same as the shooting mode and camera parameters in a preset correspondence; obtain the The preset compression ratio corresponding to the shooting scene sample is determined as the target compression ratio.
在一实施例中,发送子模块3023还可以用于:通过移动产业处理器接口MIPI传输所述压缩数据至所述第二图像处理器。In an embodiment, the sending submodule 3023 may also be configured to: transmit the compressed data to the second image processor through a mobile industry processor interface MIPI.
在一实施例中,选取模块305还可以用于:从所述多帧初始图像中选取平均亮度最高的图像作为所述参考帧图像。In an embodiment, the selection module 305 may also be configured to: select an image with the highest average brightness from the multiple frames of initial images as the reference frame image.
在一实施例中,压缩子模块3022还可以用于:根据所述拍摄场景确定压缩方式,并以 所述压缩方式对所述初始图像的原始数据进行压缩,所述压缩方式包括无损压缩和有损压缩。In an embodiment, the compression submodule 3022 can also be used to: determine a compression method according to the shooting scene, and compress the original data of the initial image in the compression method, the compression method includes lossless compression and lossy compression.
在一实施例中,生成模块304还可以用于:对所述目标图像进行降噪处理,并将降噪处理后的图像进行色调映射处理,并将色调映射后的图像作为预览图像显示至所述电子设备的屏幕上。In an embodiment, the generation module 304 may also be configured to: perform noise reduction processing on the target image, perform tone mapping processing on the image after noise reduction processing, and display the image after tone mapping as a preview image on the target image. on the screen of the above-mentioned electronic device.
由上述可知,本申请实施例的图像处理装置30可以获取初始图像的原始数据并发送至第一图像处理器,第一图像处理器对初始图像的原始数据进行压缩,得到压缩数据并将压缩数据发送至第二图像处理器,第二图像处理器对压缩数据进行解压,以得到还原数据,提取还原数据中的YUV数据,对YUV数据进行编码以生成目标图像。本申请实施例可以先通过第一图像处理器对初始图像的原始数据进行压缩再发送至第二图像处理器进行图像处理,减小传输的数据量,从而提升图像处理的效率。It can be seen from the above that the image processing device 30 of the embodiment of the present application can acquire the original data of the initial image and send it to the first image processor, and the first image processor compresses the original data of the initial image to obtain compressed data and compress the data Send to the second image processor, the second image processor decompresses the compressed data to obtain the restored data, extracts the YUV data in the restored data, and encodes the YUV data to generate the target image. In the embodiment of the present application, the original data of the initial image may be compressed by the first image processor and then sent to the second image processor for image processing, so as to reduce the amount of transmitted data and improve the efficiency of image processing.
本申请实施例中,图像处理装置与上文实施例中的图像处理方法属于同一构思,在图像处理装置上可以运行图像处理方法实施例中提供的任一方法,其具体实现过程详见图像处理方法的实施例,此处不再赘述。In the embodiment of the present application, the image processing device and the image processing method in the above embodiments belong to the same concept, and any method provided in the image processing method embodiment can be run on the image processing device, and its specific implementation process can be found in image processing The embodiment of the method will not be repeated here.
本文所使用的术语“模块”可看作为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看作为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。The term "module" as used herein may be considered a software object that executes on the computing system. The various components, modules, engines and services described herein can be considered as implementation objects on the computing system. The devices and methods described herein can be implemented in the form of software, and of course can also be implemented in hardware, all of which are within the protection scope of the present application.
本申请实施例还提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述的图像处理方法。The embodiment of the present application also provides a storage medium on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute the above-mentioned image processing method.
本申请实施例还提供一种电子设备,如平板电脑、手机等。电子设备包括第一图像处理器、第二图像处理器、中央处理器和存储器,电子设备中的中央处理器会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器中,并由中央处理器来运行存储在存储器中的应用程序,从而实现各种功能:The embodiment of the present application also provides an electronic device, such as a tablet computer, a mobile phone, and the like. The electronic device includes a first image processor, a second image processor, a central processing unit and a memory, and the central processor in the electronic device will load instructions corresponding to the process of one or more application programs into the memory according to the following steps In, and by the central processing unit to run the application program stored in the memory, so as to achieve various functions:
获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
请参阅图5,电子设备400包括处理器401以及存储器402。其中,处理器401与存储器402电性连接。Referring to FIG. 5 , an electronic device 400 includes a processor 401 and a memory 402 . Wherein, the processor 401 is electrically connected with the memory 402 .
处理器400是电子设备400的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器402内的计算机程序,以及调用存储在存储器402 内的数据,执行电子设备400的各种功能并处理数据,从而对电子设备400进行整体监控。The processor 400 is the control center of the electronic device 400. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or loading computer programs stored in the memory 402 and calling data stored in the memory 402, the processor 400 executes electronic functions. various functions of the device 400 and process data, so as to monitor the electronic device 400 as a whole.
存储器402可用于存储软件程序以及模块,处理器401通过运行存储在存储器402的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器402可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器402可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器402还可以包括存储器控制器,以提供处理器401对存储器402的访问。The memory 402 can be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by running the computer programs and modules stored in the memory 402 . The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, computer programs required by at least one function (such as sound playback function, image playback function, etc.); Data created by the use of electronic devices, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 402 may further include a memory controller to provide the processor 401 with access to the memory 402 .
在本申请实施例中,电子设备400中的处理器401会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器402中,并由处理器401运行存储在存储器402中的计算机程序,从而实现各种功能,如下:In this embodiment of the application, the processor 401 in the electronic device 400 will follow the steps below to load the instructions corresponding to the process of one or more computer programs into the memory 402, and run the instructions stored in the memory 402 by the processor 401. The computer program in the computer, so as to realize various functions, as follows:
获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
在一实施例中,所述处理器401执行所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤时,可以执行:所述第一图像处理器获取所述初始图像对应的拍摄场景;根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩。In an embodiment, when the processor 401 executes the step of compressing the original data of the initial image by the first image processor, it may execute: the first image processor acquires the Shooting a scene; determining a target compression rate according to the shooting scene, and compressing the original data of the initial image with the target compression rate.
在一实施例中,所述拍摄场景包括拍摄模式以及摄像头参数,所述处理器401执行根据所述拍摄场景确定目标压缩率的步骤时,可以执行:在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。In an embodiment, the shooting scene includes a shooting mode and camera parameters, and when the processor 401 executes the step of determining the target compression rate according to the shooting scene, it may perform: searching A shooting scene sample with the same mode and camera parameters; obtaining a preset compression rate corresponding to the shooting scene sample, and determining it as the target compression rate.
在一实施例中,所述处理器401执行将所述压缩数据发送至所述第二图像处理器的步骤时,可以执行:通过移动产业处理器接口MIPI传输所述压缩数据至所述第二图像处理器。In an embodiment, when the processor 401 executes the step of sending the compressed data to the second image processor, it may perform: transmit the compressed data to the second image processor through the mobile industry processor interface MIPI image processor.
在一实施例中,所述处理器401执行在所述第一图像处理器对所述初始图像的原始数据进行压缩之前,可以执行:若所述初始图像为多帧,则从所述多帧初始图像中选取参考帧图像;根据所述参考帧图像对所述多帧初始图像进行合成。In an embodiment, before the first image processor compresses the original data of the original image, the processor 401 may execute: if the initial image is multi-frame, from the multi-frame A reference frame image is selected from the initial image; and the multi-frame initial image is synthesized according to the reference frame image.
在一实施例中,所述处理器401执行从所述多帧初始图像中选取参考帧图像的步骤时,可以执行:从所述多帧初始图像中选取平均亮度最高的图像作为所述参考帧图像。In an embodiment, when the processor 401 executes the step of selecting a reference frame image from the multiple frames of initial images, it may perform: selecting an image with the highest average brightness from the multiple frames of initial images as the reference frame image.
在一实施例中,所述处理器401执行所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤时,可以执行:所述第一图像处理器获取所述初始图像对应的拍摄场景;根据所述拍摄场景确定压缩方式,并以所述压缩方式对所述初始图像的原始数据进行压缩,所述压缩方式包括无损压缩和有损压缩。In an embodiment, when the processor 401 executes the step of compressing the original data of the initial image by the first image processor, it may execute: the first image processor acquires the Shooting the scene; determining a compression method according to the shooting scene, and compressing the original data of the initial image in the compression method, the compression method includes lossless compression and lossy compression.
在一实施例中,所述处理器401执行对所述YUV数据进行编码以生成目标图像之后, 可以执行:对所述目标图像进行降噪处理,并将降噪处理后的图像进行色调映射处理,并将色调映射后的图像作为预览图像显示至所述电子设备的屏幕上。In an embodiment, after the processor 401 encodes the YUV data to generate a target image, it may perform: performing noise reduction processing on the target image, and performing tone mapping processing on the image after the noise reduction processing , and display the tone-mapped image on the screen of the electronic device as a preview image.
请一并参阅图6,在一些实施方式中,电子设备400还可以包括:显示器403、射频电路404、音频电路405以及电源406。其中,其中,显示器403、射频电路404、音频电路405以及电源406分别与处理器401电性连接。Please refer to FIG. 6 together. In some embodiments, the electronic device 400 may further include: a display 403 , a radio frequency circuit 404 , an audio circuit 405 and a power supply 406 . Wherein, the display 403 , the radio frequency circuit 404 , the audio circuit 405 and the power supply 406 are respectively electrically connected to the processor 401 .
显示器403可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器403可以包括显示面板,在一些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 403 can be used to display information input by or provided to the user and various graphical user interfaces, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display 403 may include a display panel. In some implementation manners, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
射频电路404可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。通常,射频电路501包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM,Subscriber Identity Module)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。The radio frequency circuit 404 can be used to send and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to send and receive signals with network equipment or other electronic equipment. Generally, the radio frequency circuit 501 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM, Subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc.
音频电路405可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。音频电路506可将接收到的音频数据转换成电信号,传输到扬声器,由扬声器转换为声音信号输出。The audio circuit 405 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone. The audio circuit 506 can convert the received audio data into an electrical signal, transmit it to the speaker, and convert it into an audio signal for output by the speaker.
电源406可以用于给电子设备400的各个部件供电。在一些实施例中,电源406可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源406还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The power supply 406 may be used to power various components of the electronic device 400 . In some embodiments, the power supply 406 can be logically connected to the processor 401 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system. The power supply 406 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
尽管图6中未示出,电子设备400还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 6 , the electronic device 400 may also include a camera, a Bluetooth module, etc., which will not be repeated here.
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM)、或者随机存取记忆体(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
需要说明的是,对本申请实施例的图像处理方法而言,本领域普通测试人员可以理解实现本申请实施例图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that for the image processing method of the embodiment of the present application, ordinary testers in the field can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device. process. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
对本申请实施例的图像处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,存储介质譬如为只读存储器,磁盘或光盘等。For the image processing device of the embodiment of the present application, its various functional modules may be integrated into one processing chip, or each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, magnetic disk or optical disk.
以上对本申请实施例所提供的一种图像处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。An image processing method, device, storage medium, and electronic equipment provided by the embodiments of the present application have been described in detail above. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only It is used to help understand the method and its core idea of this application; at the same time, for those skilled in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, this specification The content should not be construed as a limitation of the application.

Claims (20)

  1. 一种图像处理方法,应用于电子设备,所述电子设备包括第一图像处理器和第二图像处理器,其中,所述方法包括以下步骤:An image processing method applied to an electronic device, the electronic device comprising a first image processor and a second image processor, wherein the method includes the following steps:
    获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
    所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
    所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
    提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
  2. 根据权利要求1所述的图像处理方法,其中,所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤,包括:The image processing method according to claim 1, wherein the step of compressing the original data of the initial image by the first image processor comprises:
    所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
    根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩。A target compression rate is determined according to the shooting scene, and the original data of the initial image is compressed at the target compression rate.
  3. 根据权利要求2所述的图像处理方法,所述拍摄场景包括拍摄模式以及摄像头参数,其中,根据所述拍摄场景确定目标压缩率的步骤,包括:The image processing method according to claim 2, wherein the shooting scene includes a shooting mode and camera parameters, wherein the step of determining the target compression rate according to the shooting scene includes:
    在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;Searching for the same shooting scene sample as the shooting mode and camera parameters in the preset corresponding relationship;
    获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。A preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
  4. 根据权利要求1所述的图像处理方法,其中,将所述压缩数据发送至所述第二图像处理器的步骤,包括:The image processing method according to claim 1, wherein the step of sending the compressed data to the second image processor comprises:
    通过移动产业处理器接口MIPI传输所述压缩数据至所述第二图像处理器。and transmitting the compressed data to the second image processor through MIPI.
  5. 根据权利要求1所述的图像处理方法,其中,在所述第一图像处理器对所述初始图像的原始数据进行压缩之前,所述方法还包括:The image processing method according to claim 1, wherein, before the first image processor compresses the original data of the initial image, the method further comprises:
    若所述初始图像为多帧,则从所述多帧初始图像中选取参考帧图像;If the initial image is multi-frame, then select a reference frame image from the multi-frame initial image;
    根据所述参考帧图像对所述多帧初始图像进行合成。The multi-frame initial images are synthesized according to the reference frame images.
  6. 根据权利要求5所述的图像处理方法,其中,从所述多帧初始图像中选取参考帧图像的步骤,包括:The image processing method according to claim 5, wherein the step of selecting a reference frame image from the multi-frame initial image comprises:
    从所述多帧初始图像中选取平均亮度最高的图像作为所述参考帧图像。An image with the highest average brightness is selected from the multiple frames of initial images as the reference frame image.
  7. 根据权利要求1所述的图像处理方法,其中,所述第一图像处理器对所述初始图像的原始数据进行压缩的步骤,包括:The image processing method according to claim 1, wherein the step of compressing the original data of the initial image by the first image processor comprises:
    所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
    根据所述拍摄场景确定压缩方式,并以所述压缩方式对所述初始图像的原始数据进行压缩,所述压缩方式包括无损压缩和有损压缩。A compression mode is determined according to the shooting scene, and the original data of the initial image is compressed in the compression mode, and the compression mode includes lossless compression and lossy compression.
  8. 根据权利要求1所述的图像处理方法,其中,对所述YUV数据进行编码以生成目标图像之后,所述方法还包括:The image processing method according to claim 1, wherein, after encoding the YUV data to generate a target image, the method further comprises:
    对所述目标图像进行降噪处理,并将降噪处理后的图像进行色调映射处理,并将色调映射后的图像作为预览图像显示至所述电子设备的屏幕上。performing noise reduction processing on the target image, and performing tone mapping processing on the image after noise reduction processing, and displaying the image after tone mapping on the screen of the electronic device as a preview image.
  9. 一种图像处理装置,应用于电子设备,所述电子设备包括第一图像处理器和第二图像处理器,其中,所述装置包括:An image processing device, applied to an electronic device, the electronic device includes a first image processor and a second image processor, wherein the device includes:
    获取模块,用于获取初始图像的原始数据并发送至所述第一图像处理器;an acquisition module, configured to acquire the original data of the initial image and send it to the first image processor;
    压缩模块,用于所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;a compression module, configured for the first image processor to compress the original data of the initial image, obtain compressed data and send the compressed data to the second image processor;
    解压模块,用于所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;A decompression module, used for the second image processor to decompress the compressed data to obtain restored data;
    生成模块,用于提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。A generating module, configured to extract YUV data in the restored data, and encode the YUV data to generate a target image.
  10. 根据权利要求9所述的图像处理装置,其中,所述压缩模块具体包括:The image processing device according to claim 9, wherein the compression module specifically comprises:
    获取子模块,用于控制所述第一图像处理器获取所述初始图像对应的拍摄场景;An acquisition submodule, configured to control the first image processor to acquire the shooting scene corresponding to the initial image;
    压缩子模块,用于根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩,得到压缩数据;A compression submodule, configured to determine a target compression rate according to the shooting scene, and compress the original data of the initial image with the target compression rate to obtain compressed data;
    发送子模块,用于将所述压缩数据发送至所述第二图像处理器。A sending submodule, configured to send the compressed data to the second image processor.
  11. 根据权利要求9所述的图像处理装置,其中,所述装置还包括:The image processing device according to claim 9, wherein the device further comprises:
    选取模块,用于当所述初始图像为多帧时,从所述多帧初始图像中选取参考帧图像;A selection module, configured to select a reference frame image from the multi-frame initial image when the initial image is multiple frames;
    合成模块,用于根据所述参考帧图像对所述多帧初始图像进行合成。A synthesis module, configured to synthesize the multi-frame initial images according to the reference frame images.
  12. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至8任一项所述的图像处理方法。A storage medium, on which a computer program is stored, wherein, when the computer program is run on a computer, the computer is made to execute the image processing method according to any one of claims 1 to 8.
  13. 一种电子设备,包括第一图像处理器、第二图像处理器、中央处理器和存储器,所述存储器存储有多条指令,其中,所述中央处理器加载所述存储器中的指令用于执行以下步骤:An electronic device, comprising a first image processor, a second image processor, a central processing unit and a memory, wherein the memory stores a plurality of instructions, wherein the central processing unit loads the instructions in the memory for execution The following steps:
    获取初始图像的原始数据并发送至所述第一图像处理器;acquiring raw data of an initial image and sending it to the first image processor;
    所述第一图像处理器对所述初始图像的原始数据进行压缩,得到压缩数据并将所述压缩数据发送至所述第二图像处理器;The first image processor compresses the original data of the initial image, obtains compressed data, and sends the compressed data to the second image processor;
    所述第二图像处理器对所述压缩数据进行解压,以得到还原数据;The second image processor decompresses the compressed data to obtain restored data;
    提取所述还原数据中的YUV数据,对所述YUV数据进行编码以生成目标图像。extracting YUV data in the restored data, and encoding the YUV data to generate a target image.
  14. 根据权利要求13所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 13, wherein the central processing unit is further configured to execute:
    所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
    根据所述拍摄场景确定目标压缩率,并以所述目标压缩率对所述初始图像的原始数据进行压缩。A target compression rate is determined according to the shooting scene, and the original data of the initial image is compressed at the target compression rate.
  15. 根据权利要求14所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 14, wherein the central processing unit is further configured to execute:
    在预设对应关系中查找与所述拍摄模式以及摄像头参数相同的拍摄场景样本;Searching for the same shooting scene sample as the shooting mode and camera parameters in the preset corresponding relationship;
    获取所述拍摄场景样本对应的预设压缩率,并确定为所述目标压缩率。A preset compression rate corresponding to the shooting scene sample is obtained, and determined as the target compression rate.
  16. 根据权利要求13所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 13, wherein the central processing unit is further configured to execute:
    通过移动产业处理器接口MIPI传输所述压缩数据至所述第二图像处理器。and transmitting the compressed data to the second image processor through MIPI.
  17. 根据权利要求13所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 13, wherein the central processing unit is further configured to execute:
    若所述初始图像为多帧,则从所述多帧初始图像中选取参考帧图像;If the initial image is multi-frame, then select a reference frame image from the multi-frame initial image;
    根据所述参考帧图像对所述多帧初始图像进行合成。The multi-frame initial images are synthesized according to the reference frame images.
  18. 根据权利要求17所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 17, wherein the central processing unit is further configured to execute:
    从所述多帧初始图像中选取平均亮度最高的图像作为所述参考帧图像。An image with the highest average brightness is selected from the multiple frames of initial images as the reference frame image.
  19. 根据权利要求13所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 13, wherein the central processing unit is further configured to execute:
    所述第一图像处理器获取所述初始图像对应的拍摄场景;The first image processor acquires the shooting scene corresponding to the initial image;
    根据所述拍摄场景确定压缩方式,并以所述压缩方式对所述初始图像的原始数据进行压缩,所述压缩方式包括无损压缩和有损压缩。A compression mode is determined according to the shooting scene, and the original data of the initial image is compressed in the compression mode, and the compression mode includes lossless compression and lossy compression.
  20. 根据权利要求13所述的电子设备,其中,所述中央处理器还用于执行:The electronic device according to claim 13, wherein the central processing unit is further configured to execute:
    对所述目标图像进行降噪处理,并将降噪处理后的图像进行色调映射处理,并将色调映射后的图像作为预览图像显示至所述电子设备的屏幕上。performing noise reduction processing on the target image, and performing tone mapping processing on the image after noise reduction processing, and displaying the image after tone mapping on the screen of the electronic device as a preview image.
PCT/CN2022/092037 2021-07-28 2022-05-10 Image processing method and apparatus, and storage medium and electronic device WO2023005336A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110857728.6A CN115696059A (en) 2021-07-28 2021-07-28 Image processing method, image processing device, storage medium and electronic equipment
CN202110857728.6 2021-07-28

Publications (1)

Publication Number Publication Date
WO2023005336A1 true WO2023005336A1 (en) 2023-02-02

Family

ID=85058338

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/092037 WO2023005336A1 (en) 2021-07-28 2022-05-10 Image processing method and apparatus, and storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN115696059A (en)
WO (1) WO2023005336A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713922A (en) * 2017-01-13 2017-05-24 京东方科技集团股份有限公司 Image processing method and electronic equipment
US20200221103A1 (en) * 2017-07-21 2020-07-09 Samsung Electronics Co., Ltd Electronic device and image compression method of electronic device
CN111418201A (en) * 2018-03-27 2020-07-14 华为技术有限公司 Shooting method and equipment
US20200236317A1 (en) * 2017-07-20 2020-07-23 Samsung Electronics Co., Ltd. Method for transmitting image data and data associated with control of image capture, on basis of size of image data and size of data associated with control of image capture, and electronic device supporting same
CN111953848A (en) * 2020-08-19 2020-11-17 Oppo广东移动通信有限公司 System, method and related device for realizing application function through context awareness
CN112184537A (en) * 2020-09-30 2021-01-05 王汉 Heterogeneous computing architecture camera system and image processing method
CN112866576A (en) * 2021-01-18 2021-05-28 Oppo广东移动通信有限公司 Image preview method, storage medium and display device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713922A (en) * 2017-01-13 2017-05-24 京东方科技集团股份有限公司 Image processing method and electronic equipment
US20200236317A1 (en) * 2017-07-20 2020-07-23 Samsung Electronics Co., Ltd. Method for transmitting image data and data associated with control of image capture, on basis of size of image data and size of data associated with control of image capture, and electronic device supporting same
US20200221103A1 (en) * 2017-07-21 2020-07-09 Samsung Electronics Co., Ltd Electronic device and image compression method of electronic device
CN111418201A (en) * 2018-03-27 2020-07-14 华为技术有限公司 Shooting method and equipment
CN111953848A (en) * 2020-08-19 2020-11-17 Oppo广东移动通信有限公司 System, method and related device for realizing application function through context awareness
CN112184537A (en) * 2020-09-30 2021-01-05 王汉 Heterogeneous computing architecture camera system and image processing method
CN112866576A (en) * 2021-01-18 2021-05-28 Oppo广东移动通信有限公司 Image preview method, storage medium and display device

Also Published As

Publication number Publication date
CN115696059A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
KR101180474B1 (en) Image capture module and image capture method for avoiding shutter lag
JP5337707B2 (en) Method and system for image preprocessing
KR101905621B1 (en) Apparatus and method for transmitting a frame image of camera using a hybrid interleaved data
US20230162324A1 (en) Projection data processing method and apparatus
US9813613B2 (en) Method and apparatus for capturing image in portable terminal
KR20090015402A (en) Image processing device for reducing jpeg(joint photographic coding experts group) capture time and method of capturing jpeg in the same device
KR100770835B1 (en) Image data processing system and it's method
KR100821407B1 (en) Image information processing system and image information processing method
WO2023160285A1 (en) Video processing method and apparatus
CN115564659B (en) Video processing method and device
JP4561649B2 (en) Image compression apparatus, image compression program and image compression method, HDR image generation apparatus, HDR image generation program and HDR image generation method, image processing system, image processing program and image processing method
TWI222315B (en) Digital camera controller apparatus for a mobile phone
US7936378B2 (en) Image pickup device and encoded data transferring method
WO2023005336A1 (en) Image processing method and apparatus, and storage medium and electronic device
US7813015B2 (en) Image processor of imaging apparatus
US7705890B2 (en) Apparatus and method for photographing an image in a wireless terminal
CN100420283C (en) Image sensor and computer system utilizing the same image sensor
CN114298889A (en) Image processing circuit and image processing method
JP2018110300A (en) Imaging device, control method therefor, program, and recording medium
CN113364964A (en) Image processing method, image processing apparatus, storage medium, and terminal device
US7656433B2 (en) Web camera
CN112135150A (en) Image compression and decompression method, readable medium and electronic device thereof
CN112565771A (en) Picture compression method and device, electronic equipment and medium
CN113747046A (en) Image processing method, image processing device, storage medium and electronic equipment
CN116095509A (en) Method, device, electronic equipment and storage medium for generating video frame

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE