WO2022151054A1 - Image processing method and apparatus, and storage medium - Google Patents

Image processing method and apparatus, and storage medium Download PDF

Info

Publication number
WO2022151054A1
WO2022151054A1 PCT/CN2021/071514 CN2021071514W WO2022151054A1 WO 2022151054 A1 WO2022151054 A1 WO 2022151054A1 CN 2021071514 W CN2021071514 W CN 2021071514W WO 2022151054 A1 WO2022151054 A1 WO 2022151054A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
image data
data
processed
base layer
Prior art date
Application number
PCT/CN2021/071514
Other languages
French (fr)
Chinese (zh)
Inventor
周长波
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/071514 priority Critical patent/WO2022151054A1/en
Publication of WO2022151054A1 publication Critical patent/WO2022151054A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene

Definitions

  • the present invention generally relates to the technical field of data processing, and more particularly to an image processing method and device, and a storage medium.
  • Most cameras have a digital viewfinder, which can be used to observe the frame and brightness, color, etc. of a picture or video captured under the current shooting conditions. Under some shooting conditions, including when the exposure time is too long or the shooting scene is too bright, parts of the image can be so bright that they saturate to pure white. Usually some cameras have the function of overexposure prompting, but prompting that a specific area has been overexposed cannot meet the needs of users.
  • the present application provides a new image processing method, device, and storage medium.
  • one aspect of the present invention provides an image processing method, the method includes: acquiring a first image of a first dynamic range of a shooting scene; analyzing the first image to determine exposure in the first image an abnormal area, the abnormal exposure area includes an overexposed area and/or an underexposed area; at least an image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, and the first 2.
  • the dynamic range is higher than the first dynamic range; the first image and the processed image are displayed.
  • the image processing apparatus includes: a memory for storing executable program instructions; one or more processors for executing the program instructions stored in the memory , causing the processor to perform the following steps:
  • processing at least the image of the abnormally exposed area to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range;
  • the display unit is used for displaying the first image and the processed image.
  • Another aspect of the present application provides a computer storage medium on which a computer program is stored, the computer program implements the aforementioned image processing method when executed by a processor.
  • the image processing method of the present application at least the image of the overexposed area and/or the underexposed area is processed, and the first image and the processed image are displayed, so that the user can intuitively observe the current shooting conditions
  • FIG. 1 shows a schematic flowchart of an image processing method in an embodiment of the present application
  • FIG. 2 shows a schematic diagram of a standard dynamic range image of a shooting scene displayed on a camera screen
  • Figure 3 shows a schematic diagram when only overexposed areas are identified with prompt information
  • FIG. 4 shows a schematic diagram of a prompting manner of an overexposed area in an embodiment of the present application
  • FIG. 5 shows a schematic block diagram of an image processing apparatus in an embodiment of the present application.
  • Most cameras have a digital viewfinder, which can be used to observe the frame and brightness, color, etc. of a picture or video captured under the current shooting conditions. Under some shooting conditions, including when the exposure time is too long or the shooting scene is too bright, parts of the image can be so bright that they saturate to pure white. Many cameras have the function of overexposure prompting, the most common one is "zebra crossing", that is, displaying oblique black and white alternating lines in the area where the brightness exceeds a specified threshold to remind the user that this area has been overexposed (that is, overexposed). Excessive areas show some line-like patterns to help achieve accurate exposure.
  • zebra crossing that is, displaying oblique black and white alternating lines in the area where the brightness exceeds a specified threshold to remind the user that this area has been overexposed (that is, overexposed). Excessive areas show some line-like patterns to help achieve accurate exposure.
  • HDR High Dynamic Range
  • an image processing method includes: acquiring a first image of a first dynamic range of a shooting scene; analyzing the first image to determine the first image an abnormally exposed area in an image, the abnormally exposed area includes an overexposed area and/or an underexposed area; at least the image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, the second dynamic range is higher than the first dynamic range; displaying the first image and the processed image.
  • the image processing method of the present application at least the image of the overexposed area and/or the underexposed area is processed, and the first image and the processed image are displayed, so that the user can intuitively observe the current shooting conditions
  • FIG. 1 shows a schematic flowchart of the image processing method in an embodiment of the present application
  • FIG. 3 shows a schematic diagram when only the overexposed area is marked with prompt information
  • the image processing method 100 includes the following steps:
  • step S110 a first image of a first dynamic range of the shooting scene is acquired.
  • the first image may be an image or a video, etc., and a still image, a dynamic image, or a video of a shooting scene may be captured by a shooting device.
  • the first image may also be a live view image or the like that is continuously and real-time collected by a photographing device during viewfinder.
  • the acquiring the first image of the first dynamic range of the shooting scene includes: acquiring image code stream data, wherein the image code stream data includes a base layer code stream and an enhancement layer image code stream; decoding the image code stream base layer code stream to obtain the first image. That is, the image code stream data may be data encoded based on the encoder, which may include the base layer code stream.
  • the enhancement layer image code stream is used to obtain the first image with the first dynamic range.
  • Two dynamic range processed images, wherein the second dynamic range is higher than the first dynamic range for example, the first image is a standard dynamic range image (including but not limited to JPEG images), and the processed image is a high dynamic range image .
  • the acquiring the first image of the first dynamic range of the shooting scene includes: acquiring original image data, and acquiring the first image of the first dynamic range of the shooting scene based on the original image data.
  • the raw image data may be unencoded image data, such as RAW data collected by an image sensor.
  • the base layer image code stream may also be directly obtained, and the base layer image code stream may be decoded to obtain the first image.
  • the base layer code stream may be an independent code stream, and the encoding process may not involve a series of processing processes on the enhancement layer image data.
  • step S120 the first image is analyzed to determine an abnormally exposed area in the first image, and the abnormally exposed area includes an overexposed area and/or an underexposed area.
  • Overexposed areas and/or underexposed areas in the first image can be determined based on any suitable method known to those skilled in the art.
  • analyzing the first image to determine an abnormally exposed area in the first image includes: determining the exposure in the first image based on pixel information of pixels of the first image abnormal area. For example, comparing the brightness information of each area in the first image with a preset brightness threshold to determine an abnormally exposed area in the first image, where the preset brightness threshold includes a first preset brightness threshold or a second preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, the overexposed area includes an area whose brightness information is greater than the first preset brightness threshold, the underexposed area Including an area whose brightness information is less than the second preset brightness threshold.
  • the first preset brightness threshold and the second preset brightness threshold may be preset parameters in the photographing device, or may be suitable parameters specified according to user input, for example, the first preset brightness threshold may be saturated brightness 70%, 80%, 90%, 100%, etc.
  • the second preset brightness threshold may be, for example, 40%, 30%, 20%, 10%, etc. of the saturated brightness.
  • the pixels included in the overexposed area and the pixels included in the underexposed area can be determined by comparing the luminance value of each pixel in the first image with the luminance threshold.
  • the first image may include both an overexposed area and an underexposed area, or may include only one of the overexposed area and the underexposed area.
  • step S130 at least the image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range.
  • the image of the abnormally exposed area may be processed by any suitable method known to those skilled in the art to obtain a processed image.
  • the processed image has a second dynamic range, the second dynamic range is higher than the first dynamic range, the second dynamic range is higher than the first dynamic range, for example, the first image is a standard dynamic range image (including but not limited to JPEG images), the processed images are high dynamic range images.
  • the processing at least the image of the abnormally exposed area to obtain the processed image includes: acquiring image code stream data, wherein the image code stream data includes a base layer code stream and an enhancement layer image code stream ; Decode the base layer code stream and the enhancement layer image code stream to obtain the base layer image data and the enhancement layer image data; fuse the base layer image data and the enhancement layer image data to obtain a second image; extracting the image corresponding to the abnormal exposure area in the second image to obtain the processed image.
  • the processed image has better brightness and better display effect.
  • the processing at least the image of the abnormally exposed area to obtain the processed image includes: when the first image includes an overexposed area, processing the second image to reduce
  • For the brightness of the second image for example, the brightness of the second image is reduced by applying a preset mapping function to the pixel values of the second image.
  • extracting the image corresponding to the overexposed area in the second image to obtain the processed image comprising: extracting the processed image corresponding to the overexposed area in the second image.
  • the image corresponding to the overexposed area is obtained to obtain the processed image.
  • the processed image extracted at this time has both high dynamic range and better brightness than the image corresponding to the overexposed area in the first image.
  • the processing at least the image of the abnormally exposed area to obtain the processed image includes: when the first image includes an underexposed area, processing the second image to improve the the brightness of the second image.
  • extracting the image corresponding to the overexposed area in the second image to obtain the processed image comprising: extracting the processed image corresponding to the overexposed area in the second image. image corresponding to the underexposed area to obtain the processed image.
  • the processed image extracted at this time has both high dynamic range and better brightness than the image corresponding to the overexposed area in the first image.
  • the processed image may also be extracted first, and then the processed image may be subjected to brightness reduction processing or brightness enhancement processing in substantially the same manner as described above.
  • an area may be determined first, and only the corresponding base layer image data and enhancement layer image data of the abnormally exposed area may be fused.
  • at least the image of the abnormally exposed area is processed to Obtaining a processed image includes: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream; decoding the base layer image code stream to obtain base layer image data; The enhancement layer code stream is decoded to obtain enhancement layer image data; the base layer image data corresponding to the abnormal exposure area and the enhancement layer image data corresponding to the abnormal exposure area are fused to obtain a processed image.
  • brightness processing can also be performed on the processed image, for example, brightness reduction processing is performed on the processed image corresponding to the overexposed area, and brightness enhancement processing is performed on the processed image corresponding to the underexposed area, so as to obtain a more ideal brightness.
  • processing method reference may be made to the foregoing processing method for the brightness of the second image, which will not be repeated here.
  • the image code stream data may be data encoded by an encoder, and obtaining the obtained image code stream data includes the following steps S1 to S6:
  • step S1 the original image data is acquired, and the image data to be processed is obtained by performing nonlinear image transformation processing on the original image data.
  • the original image data is high dynamic range image data.
  • the original image data includes linear image data or nonlinear image data.
  • the linear image data may be image data acquired by an image sensor.
  • the nonlinear image data may be high dynamic range image data generated based on multiple images, or may be image data acquired by an image sensor.
  • the original image data may refer to the original image data collected by the photographing device of the image processing apparatus, the original image data may be linear image data, and the image data may be linear HDR image data.
  • the photographing device may be a camera, a video camera, a camera, etc., for example, the original image data may be obtained through a camera of a mobile phone, and the original image data may be 16-bit (bit) linear image data.
  • the image data to be processed may be acquired from the original image data, which may be non-linear image data, and the size may be 12 bits.
  • the camera of the mobile phone captures an image of the external environment, and the image is 16-bit linear image data.
  • the encoder in the mobile phone obtains the image data, it can obtain 12-bit nonlinear image data through nonlinear image transformation, which can be used as the intermediate layer image data, and can be directly used as the image data to be processed.
  • the image data to be processed can be non-linear image data. Linear HDR image data.
  • original image data is acquired, and image transformation processing is performed on the original image data to obtain image data to be processed.
  • the image transformation processing may include linear transformation processing, nonlinear transformation processing, or a combination of linear transformation processing and nonlinear transformation processing.
  • step S2 extract the base layer image data of a preset data amount from the to-be-processed image data or the original image data;
  • the base layer image data refers to the image data of the base data bit depth, that is, the low bit depth image data, and the dynamic range thereof is also the base dynamic range. Such as 8bit image data.
  • the base layer image data is compliant with the displayable image data of conventional display devices.
  • extracting the base layer image data of the preset data amount from the to-be-processed image data or the original image data includes: performing linear image transformation processing on the to-be-processed image data or the original image data to obtain the base layer image data of the preset data amount.
  • the preset data amount may be determined according to the requirements of the electronic device associated with or where the decoder is located, such as 8 bits.
  • the encoder in the mobile phone can perform linear cropping after acquiring the above-mentioned 12-bit image data, and directly obtain the linearly cropped 8-bit base layer image data.
  • the base layer image data of the preset data amount can also be obtained by performing linear image transformation processing from the original image data. It is not repeated here, but it should be understood that the dynamic range of the image data of the base layer is smaller than the dynamic range of the image data to be processed.
  • step S3 the base layer image data is encoded based on the first preset encoding rule to obtain a base layer image code stream;
  • the first preset encoding rule is an encoding rule determined according to the JPEG encoding rule.
  • it can also be an encoding rule determined according to the encoding rule of the current mainstream image format, such as TIFF (Tag Image File Format, Tag Image File Format), BMP (Bitmap, Bitmap), etc.
  • TIFF Tag Image File Format, Tag Image File Format
  • BMP Bitmap, Bitmap
  • the following description may be given by taking JPEG as an example: For example, an encoder in a mobile phone may acquire the above-mentioned base layer image data, and encode it according to JPEG encoding rules to obtain a base layer image code stream.
  • step S4 a residual is calculated based on the to-be-processed image data and the base layer image data, and enhancement layer image data is determined based on the residual;
  • residual refers to image data obtained by removing base layer image data from image data to be processed.
  • the residual can be directly used as enhancement layer image data.
  • the enhancement layer image data refers to the image data between the high bit depth image data and the base layer image data. Its dynamic range is also high dynamic range, which is higher than the dynamic range of the base layer image data.
  • calculating the residual based on the image data to be processed and the base layer image data includes: acquiring preprocessed base layer image data, wherein the preprocessed base layer image data includes base layer image data obtained after decoding the base layer image code stream; calculating residuals based on the image data to be processed and the preprocessed base layer image data, for example, subtracting the image data from the image data to be processed The residual is obtained by preprocessing the base layer image data.
  • the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data includes:
  • the alignment may be: hdr/16, where hdr is the image to be processed data, that is, the above-mentioned nonlinear HDR image data.
  • hdr is 12bit and the base layer image data is 8bit image data
  • hdr/16 can obtain 8bit integer and 4bit decimal, so as to align with the dynamic range of the base layer image data.
  • the aligned image data to be processed is compensated; the preprocessing is subtracted from the compensated image data to be processed
  • the base layer image data is obtained, and the residual is obtained.
  • the compensation method may be, for example, compensating hdr/16 data, and converting hdr/16*drccoef, where *drccoef is the ratio of the dynamic range of the base layer image data to the dynamic range of the HDR image (ie, hdr) data countdown.
  • the preprocessed base layer image data can be subtracted to obtain the enhancement layer image data.
  • the data of the enhancement layer image can be selected.
  • the determining the enhancement layer image data based on the residual includes: obtaining data to be retained based on the residual; selecting retained data from the data to be retained, and using the data as the enhancement layer image data.
  • the way to choose to keep the data can be, for example, (hdr/16*drc coef -base)*2 n , where n is the number of bits of data you want to keep. According to the previous text, hdr/16 can get 4 decimal places, so the maximum value of n is 4, and the minimum value is 1. Here you can choose n to be 3, then you can keep three decimal places for a long time. (hdr/16*drc coef -base) is the residual. Random noise data can be added to this residual. Since in the encoding process of the subsequent images, the calculation process is performed on positive integers, it is also necessary to convert the decimals into positive integers.
  • the reserved data is adjusted to obtain enhancement layer image data with positive integer data.
  • res is the image data of the enhancement layer. It can be understood that it is adjusted to a positive integer through 2048.
  • Base can be the preprocessed base layer image data.
  • the enhancement layer image data is encoded based on the second preset encoding rule to obtain an enhancement layer image code stream.
  • the second preset encoding rule refers to the encoding rule for the enhancement layer image data, and is encoded accordingly.
  • the encoding process may include: dividing into slices (slice image data), DCT (Discrete Cosine Transform, discrete cosine transform) transformation, quantization, calculation of Qp map (quantization parameter map, quantization parameter table), coefficient scanning, entropy encoding, etc.
  • the encoding process may be any suitable encoding manner well known to those skilled in the art, which will not be described further here.
  • the image code stream data is generated based on the enhancement layer image code stream and the base layer image code stream, for example, the enhancement layer image code stream is written into a preset in the base layer image code stream field to generate the video stream data.
  • the preset field can select the corresponding preset field according to different encoding rules. For example, for the encoding rule corresponding to JPEG, it may be the position immediately following the APP0 application segment.
  • the encoder in the mobile phone finds the position of the APP0 application segment of the base layer image code stream (code stream marker character FF E0), then reads the length of the application segment, and moves the pointer back by this length, It is the insertion position of the enhancement layer image code stream, and the enhancement layer image code stream is inserted into the base layer image code stream, and the final image code stream data is output.
  • the enhancement layer image code stream is inserted at the last or other custom position of the base layer image code stream.
  • the above-mentioned enhancement layer image code stream retained in the image code stream data can obtain enhancement layer image data by decoding the enhancement layer image code stream, and the enhancement layer image data can be used to restore the saturated area in part of the image.
  • the image data of the enhancement layer with the dynamic range of the basic layer image data (such as JPEG) can be used to restore the saturated areas in part of the image when adjusting the brightness, contrast and other parameters of the image in image post-processing, such as reducing the image brightness to make part of the image white The sky is restored to its original blue color.
  • step S140 the first image and the processed image are displayed.
  • the first image and the processed image may be displayed in a preset display manner, including: for the abnormally exposed area in the first image, alternately displaying the image corresponding to the abnormally exposed area in the first image and all the images corresponding to the abnormally exposed area in the first image.
  • the processing image is described, and through the alternate display, the user is prompted by the jumping of the image that the area covered by the processed image in the first image is an abnormal exposure area.
  • the alternate display also means that by controlling the display timing of the processed image, it is displayed at a preset frequency.
  • the method further includes: based on the abnormal exposure area, generating prompt information for prompting the abnormal exposure area; displaying the prompt information, the prompt information identifying the Expose abnormal areas.
  • the prompt information may include a preset pattern, such as a pattern similar to a zebra crossing. As shown in FIG. 3 , the abnormally exposed area in the first image is identified by the preset pattern; for another example, the prompt information Including a specific color, the abnormally exposed area in the first image is identified with a specific color, and the specific color can be any color that can highlight the abnormally exposed area, such as red, black, green and so on. Alternatively, abnormally exposed areas can be highlighted in a flashing manner.
  • the same prompt information can be used to prompt the user, or different prompt information can be used to differentiate the prompting to the user, such as Overexposed and underexposed areas are identified in different preset patterns, or overexposed and underexposed areas are identified in different specific colors.
  • the first image 201 , the processed image 203 and the prompt information 202 may also be displayed simultaneously, wherein the prompt information identifies the The exposed abnormal area in the first image, and the processed image can cover the prompt information such as a pattern similar to zebra crossing.
  • a preset pattern such as a zebra crossing
  • the processed image can also be displayed according to the user's instruction. For example, when the user judges that there is an overexposed area and/or an underexposed area in the first image by observing the first image, or obtains the first image through the displayed prompt information When there are overexposed areas and/or underexposed areas in an image, the processed image can be manually controlled to display.
  • the current shooting parameters can be used for shooting, and when the displayed first image has an abnormal exposure area If there is an abnormal exposure area in an image, and the processing effect of the processed image does not meet the user's needs, the current shooting parameters can be corrected, for example, if there is an overexposed area, appropriately increase the shutter speed, reduce the aperture and/or Reduce the ISO sensitivity; if there is an underexposed area, appropriately reduce the shutter speed, increase the aperture and/or increase the ISO sensitivity, etc., so as to assist the user in exposure control, achieve accurate exposure, and improve the user experience.
  • the image processing method of the present application at least the image of the abnormally exposed area is processed, and the first image and the processed image are displayed in a preset display mode, so that the user can intuitively observe The exposure state under the current shooting conditions, and whether the processed effect of the image captured under the current shooting conditions meets the user's requirements, so as to assist the user in exposure control, achieve accurate exposure, and improve the user's experience.
  • FIG. 5 shows a schematic block diagram of the image processing apparatus in the embodiment of the present application.
  • the image processing apparatus can be used to process the aforementioned image processing method.
  • the image processing apparatus may be a handheld or wearable terminal device, for example, a smart phone, a tablet computer, a desktop computer, a computer, a camera, a video camera, a wearable device (such as a smart watch), etc., or any other
  • An image processing device with a photographing device such as a camera, such as a movable platform, the movable platform includes but is not limited to aircraft (including but not limited to drones), robots, vehicles or ships.
  • the photographing device may be a device with an image sensor, such as a camera, a video camera, a camera, or other devices.
  • An image sensor (also referred to herein as a camera sensor) is a device for capturing image data, which may be, for example, a CMOS image sensor, a CCD image sensor, or the like.
  • the image processing apparatus 500 includes one or more processors 501, a memory 502, a communication interface 503, a display unit 504, and the like. These components are interconnected by a bus system and/or other form of connection mechanism (not shown).
  • the memory 502 is used for storing executable instructions, for example, for storing corresponding steps and program instructions for implementing the image processing method 100 according to the embodiment of the present application.
  • the memory 502 can store an operating system (including programs for processing various basic system services and for performing hardware-related tasks), an application program required for at least one function (such as a control function of a photographing device, a sound playback function, an image playback function) and many more. Some of these applications can be downloaded from external servers via wireless communication. Other applications may be installed in memory 502 at the time of manufacture or at the factory, and may also include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and /or non-volatile memory.
  • the volatile memory may include, for example, random access memory (RAM) and/or cache memory, or the like.
  • the non-volatile memory may include, for example, a read only memory (ROM), a hard disk, a flash memory (eg, an SD card), and the like.
  • the communication interface 503 may be used for communication between the image processing apparatus 500 and other external devices, including wired or wireless communication.
  • the communication interface 503 may be for accessing a wireless network based on a communication standard, such as WiFi (eg WiFi6), software-defined radio (SDR for short), 2G, 3G, 4G, 5G or a combination thereof.
  • the communication interface 503 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication interface 503 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the image processing apparatus 500 further includes an input device (not shown), which may be a device used by the user to input various operations, for example, may include function keys (such as touch keys, keys (such as volume control keys, switch keys, etc.). etc.), mechanical keys, soft keys, etc., one or more of joysticks, microphones, touchscreens, etc., or other user input devices for enabling a user to enter information.
  • Data eg, audio, video, images, etc. is passed through input device to obtain.
  • the processor 501 may be a central processing unit (CPU), a graphics processing unit (GPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other form of processing with data processing capabilities and/or instruction execution capabilities unit, and can control other components in the camera to perform desired functions.
  • the processor 501 can execute the instructions stored in the memory 502 to execute the corresponding steps of the image processing method 100 described herein.
  • processor 501 can include one or more embedded processors, processor cores, microprocessors, logic circuits, hardware finite state machines (FSMs), digital signal processors (DSPs), ISPs, encoders, decoders or their combination.
  • FSMs hardware finite state machines
  • DSPs digital signal processors
  • ISPs encoders, decoders or their combination.
  • the processor 501 is configured to execute program instructions stored in the memory, so that one or more processors perform the following steps: acquiring a first image of a first dynamic range of a shooting scene; performing analysis to determine abnormally exposed areas in the first image, the abnormally exposed areas including overexposed areas and/or underexposed areas; at least processing the images of the abnormally exposed areas to obtain a processed image, wherein the The processed image has a second dynamic range that is higher than the first dynamic range.
  • the processor 501 is further configured to: generate prompt information for prompting the abnormal exposure area based on the abnormal exposure area.
  • the processor 501 is configured to analyze the first image and determine the abnormally exposed area in the first image, including: determining, based on pixel information of pixel points of the first image, the Describe the abnormally exposed area in the first image. For example, comparing the brightness information of each area in the first image with a preset brightness threshold to determine an abnormally exposed area in the first image, where the preset brightness threshold includes a first preset brightness threshold or a second preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, the overexposed area includes an area whose brightness information is greater than the first preset brightness threshold, and the underexposed area Including an area whose brightness information is less than the second preset brightness threshold.
  • the processor 501 is configured to acquire a first image of a first dynamic range of a shooting scene, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream; decoding the base layer image code stream to obtain the first image; or, acquiring original image data, and acquiring a first image of a first dynamic range of a shooting scene based on the original image data.
  • the processor 501 is configured to process at least the image of the abnormally exposed area to obtain the processed image, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and the enhancement layer code stream; decode the base layer image code stream and the enhancement layer code stream to obtain the base layer image data and the enhancement layer image data; fuse the base layer image data and the enhancement layer image data to obtain the A second image with a second dynamic range; extracting an image corresponding to the abnormally exposed area in the second image to obtain the processed image.
  • the processor 501 is configured to process at least the image of the abnormally exposed area to obtain a processed image, including: when the first image includes an overexposed area, processing the second image processing to reduce the brightness of the second image; or, when the first image includes an underexposed area, processing the second image to improve the brightness of the second image; the extracting The image corresponding to the abnormal exposure area in the second image to obtain the processed image includes: extracting the image corresponding to the abnormal exposure area in the processed second image to obtain the processed image image.
  • the processor 501 is configured to process at least the image of the abnormally exposed area to obtain a processed image, including: when the first image includes an overexposed area, based on a preset mapping function , process the second image to reduce the brightness of the second image; or when the first image includes an underexposed area, process the second image based on a preset mapping function to improve the brightness of the second image brightness.
  • the processor 501 is configured to process at least the image of the abnormally exposed area to obtain the processed image, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and enhancement layer code stream; decode the base layer image code stream to obtain base layer image data; decode the enhancement layer code stream to obtain enhancement layer image data; The image data of the base layer and the image data of the enhancement layer corresponding to the abnormally exposed area are fused to obtain a processed image.
  • the processor 501 is configured to acquire image code stream data, including: acquiring original image data, performing nonlinear image transformation processing on the original image data to obtain image data to be processed; or extracting a preset amount of base layer image data from the original image data; encoding the base layer image data based on the first preset coding rule to obtain a base layer image code stream; based on the to-be-processed image data and Calculate residuals from the base layer image data, and determine enhancement layer image data based on the residuals; encode the enhancement layer image data based on a second preset coding rule to obtain an enhancement layer image code stream;
  • the video code stream data is generated from the layer image code stream and the base layer image code stream.
  • the processor 501 is configured to calculate a residual based on the image data to be processed and the base layer image data, including: acquiring preprocessed base layer image data, wherein the preprocessed base layer The image data includes base layer image data obtained after decoding the base layer image code stream; a residual is calculated based on the to-be-processed image data and the preprocessed base layer image data.
  • the processor 501 is configured to calculate the residual based on the to-be-processed image data and the preprocessed base layer image data, including: subtracting the pre-processed image data from the to-be-processed image data Process the base layer image data to obtain the residual.
  • the processor 501 is configured to calculate the residual based on the to-be-processed image data and the preprocessed base layer image data, including: comparing the dynamic range represented by the to-be-processed image data with the The dynamic range represented by the preprocessed base layer image data is aligned; the aligned image data to be processed is compensated according to the ratio of the dynamic range of the image data to be processed to the dynamic range of the base layer image data; The preprocessed base layer image data is subtracted from the compensated image data to be processed to obtain a residual.
  • the processor 501 is configured to determine the enhancement layer image data based on the residual, including: obtaining data to be retained based on the residual; selecting retained data from the data to be retained, and using the data as the retained data the enhancement layer image data.
  • the processor 501 is configured to select the reserved data from the to-be-retained data and use it as the enhancement layer image data, including: adjusting the reserved data to obtain a data with positive integer data. Enhancement layer image data.
  • the image processing apparatus 500 further includes a display unit 504, a device for displaying images or videos generated by the processor component.
  • the display unit 504 may include, for example, a liquid crystal display (LCD) device or an organic light emitting diode (OLED) device.
  • the display may display various images, such as menus, selected operating parameters, a capture mode selection interface, images captured by an image sensor, received by the processor, etc. and/or received from a user interface of the device other information, etc.
  • the image processing device is a movable platform
  • the movable platform is connected to a control terminal such as a mobile phone, a remote controller, glasses, a tablet computer, etc., and the display unit may be a display screen of these control terminals.
  • the display unit 504 is configured to: display the first image and the processed image, for example, for the abnormal exposure area in the first image, alternately display the corresponding abnormal exposure area in the first image. an image and the processed image.
  • the prompt information includes a preset pattern, and the abnormal exposure area in the first image is identified by the preset pattern; or the prompt information includes a specific color, and the abnormal exposure area in the first image is marked with the preset pattern. identified by a specific color.
  • the display unit is further configured to display the prompt information, and the prompt information identifies an abnormally exposed area in the first image, for example, the first image, the processed image, and the prompt information are displayed at the same time.
  • the image processing apparatus in the embodiment of the present application can implement the aforementioned image processing method, it also has the advantages of the aforementioned method.
  • the image processing apparatus 500 in this application may be any device or apparatus that can process images, such as a camera, a mobile phone, a PTZ camera, a drone, a camera on a drone, a computer, or the like.
  • an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored.
  • One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions stored in the storage device to implement (implemented by the processor) the embodiments of the present invention described herein. function and/or other desired functions, for example, to execute the corresponding steps of the image processing method 100 according to the embodiment of the present application, various application programs and various data may also be stored in the computer-readable storage medium, such as the Various data used and/or generated by the application, etc.
  • the computer storage medium may include, for example, a memory card for a smartphone, a storage unit for a tablet computer, a hard disk for a personal computer, read only memory (ROM), erasable programmable read only memory (EPROM), portable compact disk Read only memory (CD-ROM), USB memory, or any combination of the above storage media.
  • the computer-readable storage medium can be any combination of one or more computer-readable storage media.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
  • Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof.
  • a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules according to the embodiments of the present invention.
  • DSP digital signal processor
  • the present invention may also be implemented as apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein.
  • Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.

Abstract

An image processing method and apparatus, and a storage medium. The image processing method (100) comprises: acquiring a first image of a first dynamic range of a photographing scenario (S110); analyzing the first image to determine an exposure abnormality region in the first image (S120); processing at least the image of the exposure abnormality region to obtain a processed image (S130), wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range; and displaying the first image and the processed image (S140). In this way, a user can intuitively observe the exposure state under a current photographing condition, and whether the effect, after processing, of an image photographed under the current photographing condition conforms to the requirement of the user, thereby assisting the user to perform exposure control, achieving accurate exposure, and improving user experience.

Description

图像处理方法及装置、存储介质Image processing method and device, and storage medium
说明书manual
技术领域technical field
本发明总地涉及数据处理技术领域,更具体地涉及一种图像处理方法及装置、存储介质。The present invention generally relates to the technical field of data processing, and more particularly to an image processing method and device, and a storage medium.
背景技术Background technique
大多数的相机带有数码取景器,可以用来观察当前拍摄条件下拍摄下来的图片或者视频的画框和亮度、颜色等。在一些拍摄条件下,包括曝光时间过长或者拍摄场景太亮时,图像的一部分会过亮以至于饱和成为纯白色。通常有些相机有过曝提示的功能,但及提示特定区域已经过曝光是不能满足用户需求的。Most cameras have a digital viewfinder, which can be used to observe the frame and brightness, color, etc. of a picture or video captured under the current shooting conditions. Under some shooting conditions, including when the exposure time is too long or the shooting scene is too bright, parts of the image can be so bright that they saturate to pure white. Usually some cameras have the function of overexposure prompting, but prompting that a specific area has been overexposed cannot meet the needs of users.
因此,鉴于上述问题的存在,本申请提供一种新的图像处理方法及装置、存储介质。Therefore, in view of the existence of the above problems, the present application provides a new image processing method, device, and storage medium.
发明内容SUMMARY OF THE INVENTION
为了解决上述问题中的至少一个而提出了本发明。具体地,本发明一方面提供一种图像处理方法,所述方法包括:获取拍摄场景的第一动态范围的第一影像;对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围;显示所述第一影像和所述处理影像。The present invention has been made to solve at least one of the above-mentioned problems. Specifically, one aspect of the present invention provides an image processing method, the method includes: acquiring a first image of a first dynamic range of a shooting scene; analyzing the first image to determine exposure in the first image an abnormal area, the abnormal exposure area includes an overexposed area and/or an underexposed area; at least an image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, and the first 2. The dynamic range is higher than the first dynamic range; the first image and the processed image are displayed.
本发明再一方面提供一种图像处理装置,所述图像处理装置包括:存储器,用于存储可执行的程序指令;一个或多个处理器,用于执行所述存储器中存储的所述程序指令,使得所述处理器执行以下步骤:Another aspect of the present invention provides an image processing apparatus, the image processing apparatus includes: a memory for storing executable program instructions; one or more processors for executing the program instructions stored in the memory , causing the processor to perform the following steps:
获取拍摄场景的第一动态范围的第一影像;acquiring a first image of a first dynamic range of the shooting scene;
对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;Analyzing the first image to determine an abnormally exposed area in the first image, where the abnormally exposed area includes an overexposed area and/or an underexposed area;
至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围;processing at least the image of the abnormally exposed area to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range;
显示单元,用于显示所述第一影像和所述处理影像。The display unit is used for displaying the first image and the processed image.
本申请另一方面提供一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现前述的图像处理方法。Another aspect of the present application provides a computer storage medium on which a computer program is stored, the computer program implements the aforementioned image processing method when executed by a processor.
根据本申请的图像处理方法,至少对所述过度曝光区域和/或欠曝光区域的影像进行处理,并显示所述第一影像和所述处理影像,以便用户能够直观的观察到当前拍摄条件下 的曝光状态,以及在当前拍摄条件下拍摄的图像经过处理后的效果是否符合用户要求,从而能够辅助用户进行曝光控制,实现准确曝光,提升用户的使用体验。According to the image processing method of the present application, at least the image of the overexposed area and/or the underexposed area is processed, and the first image and the processed image are displayed, so that the user can intuitively observe the current shooting conditions The exposure state of the camera, and whether the processed effect of the image captured under the current shooting conditions meets the user's requirements, so as to assist the user in exposure control, achieve accurate exposure, and improve the user's experience.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1示出了本申请一个实施例中的图像处理方法的示意性流程图;FIG. 1 shows a schematic flowchart of an image processing method in an embodiment of the present application;
图2示出了在相机屏幕上显示的拍摄场景的标准动态范围的影像的示意图;2 shows a schematic diagram of a standard dynamic range image of a shooting scene displayed on a camera screen;
图3示出了仅在过度曝光区域标识出提示信息时的示意图;Figure 3 shows a schematic diagram when only overexposed areas are identified with prompt information;
图4示出了本申请实施例中的过度曝光区域的提示方式的示意图;FIG. 4 shows a schematic diagram of a prompting manner of an overexposed area in an embodiment of the present application;
图5示出了本申请实施例中的图像处理装置的示意性框图。FIG. 5 shows a schematic block diagram of an image processing apparatus in an embodiment of the present application.
具体实施方式Detailed ways
为了使得本发明的目的、技术方案和优点更为明显,下面将参照附图详细描述根据本发明的示例实施例。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是本发明的全部实施例,应理解,本发明不受这里描述的示例实施例的限制。基于本发明中描述的本发明实施例,本领域技术人员在没有付出创造性劳动的情况下所得到的所有其它实施例都应落入本发明的保护范围之内。In order to make the objects, technical solutions and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of the embodiments of the present invention, and it should be understood that the present invention is not limited by the example embodiments described herein. Based on the embodiments of the present invention described in the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
在下文的描述中,给出了大量具体的细节以便提供对本发明更为彻底的理解。然而,对于本领域技术人员而言显而易见的是,本发明可以无需一个或多个这些细节而得以实施。在其他的例子中,为了避免与本发明发生混淆,对于本领域公知的一些技术特征未进行描述。In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without one or more of these details. In other instances, some technical features known in the art have not been described in order to avoid obscuring the present invention.
应当理解的是,本发明能够以不同形式实施,而不应当解释为局限于这里提出的实施例。相反地,提供这些实施例将使公开彻底和完全,并且将本发明的范围完全地传递给本领域技术人员。It should be understood that the present invention may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
在此使用的术语的目的仅在于描述具体实施例并且不作为本发明的限制。在此使用时,单数形式的“一”、“一个”和“所述/该”也意图包括复数形式,除非上下文清楚指出另外的方式。还应明白术语“组成”和/或“包括”,当在该说明书中使用时,确定所述特征、整数、步骤、操作、元件和/或部件的存在,但不排除一个或更多其它的特征、整数、步骤、操 作、元件、部件和/或组的存在或添加。在此使用时,术语“和/或”包括相关所列项目的任何及所有组合。The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms "a," "an," and "the/the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the terms "compose" and/or "include", when used in this specification, identify the presence of stated features, integers, steps, operations, elements and/or components, but do not exclude one or more other The presence or addition of features, integers, steps, operations, elements, parts and/or groups. As used herein, the term "and/or" includes any and all combinations of the associated listed items.
为了彻底理解本发明,将在下列的描述中提出详细的结构,以便阐释本发明提出的技术方案。本发明的可选实施例详细描述如下,然而除了这些详细描述外,本发明还可以具有其他实施方式。For a thorough understanding of the present invention, detailed structures will be presented in the following description in order to explain the technical solutions proposed by the present invention. Alternative embodiments of the present invention are described in detail below, however, the invention is capable of other embodiments in addition to these detailed descriptions.
下面结合附图,对本发明的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Some embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The embodiments described below and features in the embodiments may be combined with each other without conflict.
大多数的相机带有数码取景器,可以用来观察当前拍摄条件下拍摄下来的图片或者视频的画框和亮度、颜色等。在一些拍摄条件下,包括曝光时间过长或者拍摄场景太亮时,图像的一部分会过亮以至于饱和成为纯白色。很多相机有过曝提示的功能,最常见的是“斑马线”,即在亮度超过指定阈值的区域显示倾斜的黑白交替的线条以提示用户这个区域已经过曝(也即过度曝光),通过在曝光过度的区域显示一些线条状的图案来帮助实现准确曝光。Most cameras have a digital viewfinder, which can be used to observe the frame and brightness, color, etc. of a picture or video captured under the current shooting conditions. Under some shooting conditions, including when the exposure time is too long or the shooting scene is too bright, parts of the image can be so bright that they saturate to pure white. Many cameras have the function of overexposure prompting, the most common one is "zebra crossing", that is, displaying oblique black and white alternating lines in the area where the brightness exceeds a specified threshold to remind the user that this area has been overexposed (that is, overexposed). Excessive areas show some line-like patterns to help achieve accurate exposure.
在使用高动态范围(High Dynamic Range,HDR)拍摄技术时,通过文件中额外保留的信息,可以恢复部分图像中饱和的区域。在这种拍摄模式下,仅仅提示特定区域已经过曝是不满足用户要求的,用户还需要知道这个区域是否可以通过文件中额外保留的信息进行恢复以及恢复可以达到什么效果。When using High Dynamic Range (HDR) shooting technology, the saturated areas in some images can be recovered through the additional information retained in the file. In this shooting mode, it is not enough to only prompt that a specific area has been overexposed, and the user also needs to know whether this area can be recovered through the additionally retained information in the file and what effect the recovery can achieve.
因此,鉴于上述问题的存在,本申请实施例中提出一种图像处理方法,该方法包括:获取拍摄场景的第一动态范围的第一影像;对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围;显示所述第一影像和所述处理影像。Therefore, in view of the existence of the above problems, an image processing method is proposed in an embodiment of the present application. The method includes: acquiring a first image of a first dynamic range of a shooting scene; analyzing the first image to determine the first image an abnormally exposed area in an image, the abnormally exposed area includes an overexposed area and/or an underexposed area; at least the image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, the second dynamic range is higher than the first dynamic range; displaying the first image and the processed image.
根据本申请的图像处理方法,至少对所述过度曝光区域和/或欠曝光区域的影像进行处理,并显示所述第一影像和所述处理影像,以便用户能够直观的观察到当前拍摄条件下的曝光状态,以及在当前拍摄条件下拍摄的图像经过处理后的效果是否符合用户要求,从而能够辅助用户进行曝光控制,实现准确曝光,提升用户的使用体验。According to the image processing method of the present application, at least the image of the overexposed area and/or the underexposed area is processed, and the first image and the processed image are displayed, so that the user can intuitively observe the current shooting conditions The exposure state of the camera, and whether the processed effect of the image captured under the current shooting conditions meets the user's requirements, so as to assist the user in exposure control, achieve accurate exposure, and improve the user's experience.
下面,参考图1至图4对本申请的图像处理方法进行描述,其中,图1示出了本申请一个实施例中的图像处理方法的示意性流程图;图2示出了在相机屏幕上显示的拍摄场景的标准动态范围的影像的示意图;图3示出了仅在过度曝光区域标识出提示信息时的示意图;图4示出了本申请实施例中的过度曝光区域的提示方式的示意图。Below, the image processing method of the present application will be described with reference to FIGS. 1 to 4 , wherein FIG. 1 shows a schematic flowchart of the image processing method in an embodiment of the present application; A schematic diagram of a standard dynamic range image of a shooting scene; FIG. 3 shows a schematic diagram when only the overexposed area is marked with prompt information; FIG.
作为示例,如图1所示,本申请实施例的图像处理方法100包括以下步骤:As an example, as shown in FIG. 1 , the image processing method 100 according to the embodiment of the present application includes the following steps:
首先,在步骤S110中,获取拍摄场景的第一动态范围的第一影像。First, in step S110, a first image of a first dynamic range of the shooting scene is acquired.
第一影像可以是图像或视频等,可以通过拍摄装置捕获拍摄场景的静态图像、动态图像或视频。第一影像还可以是在取景时通过拍摄装置不断地、实时地采集的实时取景图像等。The first image may be an image or a video, etc., and a still image, a dynamic image, or a video of a shooting scene may be captured by a shooting device. The first image may also be a live view image or the like that is continuously and real-time collected by a photographing device during viewfinder.
在一个示例中,所述获取拍摄场景的第一动态范围的第一影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层码流和增强层图像码流;解码所述基础层码流,以获得所述第一影像。也即影像码流数据可以是基于编码器编码后的数据,其可以包括基础层码流,当基础层码流用于获得具有第一动态范围的第一影像,增强层图像码流用于获得具有第二动态范围的处理影像,其中,所述第二动态范围高于所述第一动态范围,例如,第一影像为标准动态范围图像(包括但不限于JPEG图像),处理影像为高动态范围图像。In an example, the acquiring the first image of the first dynamic range of the shooting scene includes: acquiring image code stream data, wherein the image code stream data includes a base layer code stream and an enhancement layer image code stream; decoding the image code stream base layer code stream to obtain the first image. That is, the image code stream data may be data encoded based on the encoder, which may include the base layer code stream. When the base layer code stream is used to obtain the first image with the first dynamic range, the enhancement layer image code stream is used to obtain the first image with the first dynamic range. Two dynamic range processed images, wherein the second dynamic range is higher than the first dynamic range, for example, the first image is a standard dynamic range image (including but not limited to JPEG images), and the processed image is a high dynamic range image .
在另一个示例中,所述获取拍摄场景的第一动态范围的第一影像,包括:获取原始影像数据,并基于所述原始影像数据获取拍摄场景的第一动态范围的第一影像。该原始影像数据可以是未经编码的影像数据,例如经图像传感器采集的RAW数据等。In another example, the acquiring the first image of the first dynamic range of the shooting scene includes: acquiring original image data, and acquiring the first image of the first dynamic range of the shooting scene based on the original image data. The raw image data may be unencoded image data, such as RAW data collected by an image sensor.
在其他示例中,还可以直接获取基础层图像码流,解码所述基础层图像码流,以获得所述第一影像。该基础层码流可以为一个独立的码流,其编码过程可以不涉及对增强层图像数据的一系列的处理过程。In other examples, the base layer image code stream may also be directly obtained, and the base layer image code stream may be decoded to obtain the first image. The base layer code stream may be an independent code stream, and the encoding process may not involve a series of processing processes on the enhancement layer image data.
接着,在步骤S120中,对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域。Next, in step S120, the first image is analyzed to determine an abnormally exposed area in the first image, and the abnormally exposed area includes an overexposed area and/or an underexposed area.
可以基于本领域技术人员熟知的任意适合的方法来判断第一影像中的过度曝光区域和/或欠曝光区域。Overexposed areas and/or underexposed areas in the first image can be determined based on any suitable method known to those skilled in the art.
在一个示例中,对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,包括:基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域。例如,将所述第一影像中的各个区域的亮度信息和预设亮度阈值进行比较,以确定所述第一影像中的曝光异常区域,其中,预设亮度阈值包括第一预设亮度阈值或第二预设亮度阈值,所述第一预设亮度阈值大于所述第二预设亮度阈值,所述过度曝光区域包括亮度信息大于所述第一预设亮度阈值的区域,所述欠曝光区域包括亮度信息小于所述第二预设亮度阈值的区域。其中,第一预设亮度阈值和第二预设亮度阈值可以是预设在拍摄装置内的参数,也可以是根据用户的输入指定的适合的参数,例如第一预设亮度阈值可以为饱和亮度的70%、80%、90%、100%等。第二预设亮度阈值例如可以为饱和亮度的40%、30%、20%、10%等。可以通过将第一影像中的各个像素点的亮度值和亮度阈值进行比较,从而确定过度曝光区域所包括的像素点,以及欠曝光区域所包括的像素点。In one example, analyzing the first image to determine an abnormally exposed area in the first image includes: determining the exposure in the first image based on pixel information of pixels of the first image abnormal area. For example, comparing the brightness information of each area in the first image with a preset brightness threshold to determine an abnormally exposed area in the first image, where the preset brightness threshold includes a first preset brightness threshold or a second preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, the overexposed area includes an area whose brightness information is greater than the first preset brightness threshold, the underexposed area Including an area whose brightness information is less than the second preset brightness threshold. The first preset brightness threshold and the second preset brightness threshold may be preset parameters in the photographing device, or may be suitable parameters specified according to user input, for example, the first preset brightness threshold may be saturated brightness 70%, 80%, 90%, 100%, etc. The second preset brightness threshold may be, for example, 40%, 30%, 20%, 10%, etc. of the saturated brightness. The pixels included in the overexposed area and the pixels included in the underexposed area can be determined by comparing the luminance value of each pixel in the first image with the luminance threshold.
值得一提的是,第一影像中可以既包括过度曝光区域,也还可以包括欠曝光区域,或者,可以仅包括过度曝光区域和欠曝光区域中的一个。It is worth mentioning that the first image may include both an overexposed area and an underexposed area, or may include only one of the overexposed area and the underexposed area.
接着,在步骤S130中,至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围。Next, in step S130, at least the image of the abnormally exposed area is processed to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range.
可以通过本领域技术人员熟知的任意适合的方法对所述曝光异常区域的影像进行处理,以获得处理影像。所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围,所述第二动态范围高于所述第一动态范围,例如,第一影像为标准动态范围图像(包括但不限于JPEG图像),处理影像为高动态范围图像。The image of the abnormally exposed area may be processed by any suitable method known to those skilled in the art to obtain a processed image. The processed image has a second dynamic range, the second dynamic range is higher than the first dynamic range, the second dynamic range is higher than the first dynamic range, for example, the first image is a standard dynamic range image (including but not limited to JPEG images), the processed images are high dynamic range images.
在一个示例中,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层码流和增强层图像码流;解码所述基础层码流和增强层图像码流,以获得基本层图像数据和增强层图像数据;对基本层图像数据和增强层图像数据进行融合,以获得具有所述第二动态范围的第二影像;提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。该处理影像相比第一影像中的曝光异常区域具有更好的亮度和更好的显示效果。In an example, the processing at least the image of the abnormally exposed area to obtain the processed image includes: acquiring image code stream data, wherein the image code stream data includes a base layer code stream and an enhancement layer image code stream ; Decode the base layer code stream and the enhancement layer image code stream to obtain the base layer image data and the enhancement layer image data; fuse the base layer image data and the enhancement layer image data to obtain a second image; extracting the image corresponding to the abnormal exposure area in the second image to obtain the processed image. Compared with the abnormally exposed area in the first image, the processed image has better brightness and better display effect.
在一个示例中,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:当所述第一影像中包括过度曝光区域时,对所述第二影像进行处理,以降低所述第二影像的亮度,例如,通过对第二影像的像素值应用预设的映射函数来降低第二影像的亮度,该预设的映射函数例如可以为非线性映射(例如预设的非线性曲线)或者线性映射(例如对像素值应用类似y=x/2的线性映射),或者,还可以是其他任意适合的能够降低第二影像的亮度的处理方式。In one example, the processing at least the image of the abnormally exposed area to obtain the processed image includes: when the first image includes an overexposed area, processing the second image to reduce For the brightness of the second image, for example, the brightness of the second image is reduced by applying a preset mapping function to the pixel values of the second image. Linear curve) or linear mapping (for example, applying a linear mapping similar to y=x/2 to pixel values), or, it can also be any other suitable processing method that can reduce the brightness of the second image.
当对第二影像进行降低亮度处理后,提取所述第二影像中与所述过度曝光区域对应的影像,以获得所述处理影像,包括:提取所述处理后的第二影像中与所述过度曝光区域对应的影像,以获得所述处理影像。此时提取出的处理影像既具有高动态范围又具有相比第一影像中的过度曝光区域对应的影像更好的亮度。After the brightness reduction processing is performed on the second image, extracting the image corresponding to the overexposed area in the second image to obtain the processed image, comprising: extracting the processed image corresponding to the overexposed area in the second image. The image corresponding to the overexposed area is obtained to obtain the processed image. The processed image extracted at this time has both high dynamic range and better brightness than the image corresponding to the overexposed area in the first image.
在一个示例中,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:当所述第一影像中包括欠曝光区域时,对所述第二影像进行处理,以提高所述第二影像的亮度。例如,通过对第二影像的像素值应用预设的映射函数来提高第二影像的亮度,该预设的映射函数例如可以为非线性映射(例如预设的非线性曲线)或者线性映射(例如对像素值应用类似y=2x的线性映射),或者,还可以是其他任意适合的能够提高第二影像的亮度的处理方式。In one example, the processing at least the image of the abnormally exposed area to obtain the processed image includes: when the first image includes an underexposed area, processing the second image to improve the the brightness of the second image. For example, the brightness of the second image is improved by applying a preset mapping function to the pixel values of the second image, and the preset mapping function may be, for example, a nonlinear mapping (eg, a preset nonlinear curve) or a linear mapping (eg A linear mapping similar to y=2x is applied to the pixel values), or it can be any other suitable processing method that can improve the brightness of the second image.
当对第二影像进行提高亮度处理后,提取所述第二影像中与所述过度曝光区域对应的影像,以获得所述处理影像,包括:提取所述处理后的第二影像中与所述欠曝光区域对应的影像,以获得所述处理影像。此时提取出的处理影像既具有高动态范围又具有相比第一 影像中的过度曝光区域对应的影像更好的亮度。After the brightness enhancement process is performed on the second image, extracting the image corresponding to the overexposed area in the second image to obtain the processed image, comprising: extracting the processed image corresponding to the overexposed area in the second image. image corresponding to the underexposed area to obtain the processed image. The processed image extracted at this time has both high dynamic range and better brightness than the image corresponding to the overexposed area in the first image.
在其他示例中,也可以先提取处理影像,再对处理影像按照前述的基本相同的方法进行降低亮度处理或进行提高亮度处理。In other examples, the processed image may also be extracted first, and then the processed image may be subjected to brightness reduction processing or brightness enhancement processing in substantially the same manner as described above.
在另一个示例中,还可以是先确定区域,只针对曝光异常区域的对应的基础层图像数据和增强层图像数据进行融合,例如,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;对所述基础层图像码流进行解码,以获取基础层图像数据;对所述增强层码流进行解码,以获取增强层图像数据;将所述曝光异常区域对应的基础层图像数据和所述曝光异常区域对应的增强层图像数据进行融合,以获得处理影像。进一步,还可以对处理影像进行亮度处理,例如对于过度曝光区域对应的处理影像,进行降低亮度处理,再例如对于欠曝光区域对应的处理影像,进行提高亮度处理,从而获得更理想的亮度,具体处理方法可以参考前文对第二影像的亮度的处理方法,在此不再重复。In another example, an area may be determined first, and only the corresponding base layer image data and enhancement layer image data of the abnormally exposed area may be fused. For example, at least the image of the abnormally exposed area is processed to Obtaining a processed image includes: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream; decoding the base layer image code stream to obtain base layer image data; The enhancement layer code stream is decoded to obtain enhancement layer image data; the base layer image data corresponding to the abnormal exposure area and the enhancement layer image data corresponding to the abnormal exposure area are fused to obtain a processed image. Further, brightness processing can also be performed on the processed image, for example, brightness reduction processing is performed on the processed image corresponding to the overexposed area, and brightness enhancement processing is performed on the processed image corresponding to the underexposed area, so as to obtain a more ideal brightness. For the processing method, reference may be made to the foregoing processing method for the brightness of the second image, which will not be repeated here.
在本申请实施例中,影像码流数据可以是经过编码器编码后的数据,获取所述获取影像码流数据,包括以下步骤S1至步骤S6:In this embodiment of the present application, the image code stream data may be data encoded by an encoder, and obtaining the obtained image code stream data includes the following steps S1 to S6:
首先,在步骤S1中,获取原始图像数据,对所述原始图像数据做非线性图像变换处理得到待处理图像数据。First, in step S1, the original image data is acquired, and the image data to be processed is obtained by performing nonlinear image transformation processing on the original image data.
原始图像数据为高动态范围的图像数据。原始图像数据包括线性图像数据或者非线性图像数据。线性图像数据可以是通过图像传感器采集的得到的图像数据。非线性图像数据可以是基于多张图像生成的高动态范围图像数据,也可以是通过图像传感器采集的得到的图像数据。The original image data is high dynamic range image data. The original image data includes linear image data or nonlinear image data. The linear image data may be image data acquired by an image sensor. The nonlinear image data may be high dynamic range image data generated based on multiple images, or may be image data acquired by an image sensor.
其中,原始图像数据可以是指图像处理装置的拍摄装置采集的原始图像数据,该原始图像数据可以为线性图像数据,该图像数据可以是线性HDR图像数据。其中,拍摄装置可以是相机、摄像机、摄像头等,如可以通过手机的摄像头来获取到原始图像数据,该原始图像数据可以为16bit(位)的线性图像数据。Wherein, the original image data may refer to the original image data collected by the photographing device of the image processing apparatus, the original image data may be linear image data, and the image data may be linear HDR image data. Wherein, the photographing device may be a camera, a video camera, a camera, etc., for example, the original image data may be obtained through a camera of a mobile phone, and the original image data may be 16-bit (bit) linear image data.
在获取到原始图像数据后,可以从该原始图像数据中获取到待处理图像数据,可以为非线性图像数据,其大小可以为12bit。例如,根据前文所述,手机的摄像头拍摄外部环境的图像,该图像为16bit的线性图像数据。手机中的编码器在获取到该图像数据后,可以通过非线性图像变换,得到12bit的非线性图像数据,作为中间层图像数据,并可以直接作为待处理图像数据,该待处理图像数据可以是非线性HDR图像数据。After the original image data is acquired, the image data to be processed may be acquired from the original image data, which may be non-linear image data, and the size may be 12 bits. For example, according to the foregoing, the camera of the mobile phone captures an image of the external environment, and the image is 16-bit linear image data. After the encoder in the mobile phone obtains the image data, it can obtain 12-bit nonlinear image data through nonlinear image transformation, which can be used as the intermediate layer image data, and can be directly used as the image data to be processed. The image data to be processed can be non-linear image data. Linear HDR image data.
在另一实施方式中,获取原始图像数据,对原始图像数据做图像变换处理得到待处理图像数据。该图像变换处理可以包括线性变换处理、非线性变换处理,或者线性变换处理 与非线性变换组合处理。In another embodiment, original image data is acquired, and image transformation processing is performed on the original image data to obtain image data to be processed. The image transformation processing may include linear transformation processing, nonlinear transformation processing, or a combination of linear transformation processing and nonlinear transformation processing.
接着,在步骤S2中,从所述待处理图像数据或所述原始图像数据中提取预设数据量的基本层图像数据;Next, in step S2, extract the base layer image data of a preset data amount from the to-be-processed image data or the original image data;
此外,基本层图像数据是指基础数据位深的图像数据,即低位深图像数据,其动态范围也是基础动态范围。如8bit图像数据。该基本层图像数据是符合传统显示设备的可展示图像数据的。In addition, the base layer image data refers to the image data of the base data bit depth, that is, the low bit depth image data, and the dynamic range thereof is also the base dynamic range. Such as 8bit image data. The base layer image data is compliant with the displayable image data of conventional display devices.
其中,从待处理图像数据或原始图像数据中提取预设数据量的基本层图像数据,包括:对待处理图像数据或原始图像数据做线性图像变换处理得到预设数据量的基本层图像数据。Wherein, extracting the base layer image data of the preset data amount from the to-be-processed image data or the original image data includes: performing linear image transformation processing on the to-be-processed image data or the original image data to obtain the base layer image data of the preset data amount.
其中,预设数据量可以根据解码器所关联的或所在的电子设备需求而定,如8bit。The preset data amount may be determined according to the requirements of the electronic device associated with or where the decoder is located, such as 8 bits.
例如,根据前文所述,手机中的编码器可以在获取到上述12bit图像数据后,进行线性剪裁,直接得到线性剪裁后的8bit基本层图像数据。For example, according to the foregoing, the encoder in the mobile phone can perform linear cropping after acquiring the above-mentioned 12-bit image data, and directly obtain the linearly cropped 8-bit base layer image data.
需要说明的是,也可以从原始图像数据中做线性图像变换处理得到预设数据量的基本层图像数据。此处就不再赘述,但应理解,基本层图像数据的动态范围是小于待处理图像数据的动态范围的。It should be noted that, the base layer image data of the preset data amount can also be obtained by performing linear image transformation processing from the original image data. It is not repeated here, but it should be understood that the dynamic range of the image data of the base layer is smaller than the dynamic range of the image data to be processed.
接着,在步骤S3中,基于第一预设编码规则对所述基本层图像数据进行编码,得到基本层图像码流;Next, in step S3, the base layer image data is encoded based on the first preset encoding rule to obtain a base layer image code stream;
第一预设编码规则为根据JPEG编码规则确定的编码规则。此外,还可以是根据当前主流图像格式的编码规则确定的编码规则,如TIFF(标签图像文件格式,Tag Image File Format)、BMP(Bitmap,位图)等。以下可以以JPEG为例进行说明:例如,手机中的编码器可以在获取到上述基本层图像数据,根据JPEG编码规则进行编码,得到基本层图像码流。The first preset encoding rule is an encoding rule determined according to the JPEG encoding rule. In addition, it can also be an encoding rule determined according to the encoding rule of the current mainstream image format, such as TIFF (Tag Image File Format, Tag Image File Format), BMP (Bitmap, Bitmap), etc. The following description may be given by taking JPEG as an example: For example, an encoder in a mobile phone may acquire the above-mentioned base layer image data, and encode it according to JPEG encoding rules to obtain a base layer image code stream.
接着,在步骤S4中,基于所述待处理图像数据和所述基本层图像数据计算残差,并基于所述残差确定增强层图像数据;Next, in step S4, a residual is calculated based on the to-be-processed image data and the base layer image data, and enhancement layer image data is determined based on the residual;
在本申请中,残差是指从待处理图像数据除去基本层图像数据所得到的图像数据。可以直接将该残差作为增强层图像数据。其中,增强层图像数据是指高位深图像数据与基本层图像数据之间的图像数据。其动态范围也是高动态范围,是高于基本层图像数据的动态范围的。In this application, residual refers to image data obtained by removing base layer image data from image data to be processed. The residual can be directly used as enhancement layer image data. The enhancement layer image data refers to the image data between the high bit depth image data and the base layer image data. Its dynamic range is also high dynamic range, which is higher than the dynamic range of the base layer image data.
在一个示例中,所述基于所述待处理图像数据和所述基本层图像数据计算残差,包括:获取预处理的基本层图像数据,其中,所述预处理的基本层图像数据包括对所述基本层图像码流解码后获得的基本层图像数据;基于所述待处理图像数据和所述预处理的基本层图 像数据计算残差,例如,从所述待处理图像数据中减去所述预处理的基本层图像数据,得到所述残差。In an example, calculating the residual based on the image data to be processed and the base layer image data includes: acquiring preprocessed base layer image data, wherein the preprocessed base layer image data includes base layer image data obtained after decoding the base layer image code stream; calculating residuals based on the image data to be processed and the preprocessed base layer image data, for example, subtracting the image data from the image data to be processed The residual is obtained by preprocessing the base layer image data.
再例如,所述基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:For another example, the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data includes:
首先,将所述待处理图像数据所表示的动态范围与所述预处理的基本层图像数据所表示的动态范围进行对齐,例如,对齐方式可以为:hdr/16,其中,hdr为待处理图像数据,即上述非线性HDR图像数据。当hdr为12bit,且基本层图像数据为8bit图像数据,则hdr/16可以得到8bit整数和4bit小数,从而与基本层图像数据的动态范围对齐。First, align the dynamic range represented by the image data to be processed and the dynamic range represented by the preprocessed base layer image data, for example, the alignment may be: hdr/16, where hdr is the image to be processed data, that is, the above-mentioned nonlinear HDR image data. When the hdr is 12bit and the base layer image data is 8bit image data, hdr/16 can obtain 8bit integer and 4bit decimal, so as to align with the dynamic range of the base layer image data.
接着,通过所述待处理图像数据的动态范围与基本层图像数据的动态范围的比例,对对齐后的待处理图像数据进行补偿;从将补偿后的待处理图像数据中减去所述预处理的基本层图像数据,得到残差。其中,补偿的方式可以是,例如,对hdr/16的数据进行补偿,将hdr/16*drccoef,其中,*drccoef是基本层图像数据的动态范围与HDR图像(即hdr)数据的动态范围比例的倒数。补偿完,可以再减去预处理的基本层图像数据即可得到增强层图像数据。Then, according to the ratio of the dynamic range of the image data to be processed to the dynamic range of the base layer image data, the aligned image data to be processed is compensated; the preprocessing is subtracted from the compensated image data to be processed The base layer image data is obtained, and the residual is obtained. The compensation method may be, for example, compensating hdr/16 data, and converting hdr/16*drccoef, where *drccoef is the ratio of the dynamic range of the base layer image data to the dynamic range of the HDR image (ie, hdr) data countdown. After the compensation, the preprocessed base layer image data can be subtracted to obtain the enhancement layer image data.
为了能够优化计算方式,减少计算量,提高计算效率和时间,可以对增强层图像的数据进行选择。示例性地,所述基于所述残差确定增强层图像数据,包括:基于所述残差,得到待保留数据;从所述待保留数据中选择保留数据,并作为所述增强层图像数据。In order to optimize the calculation method, reduce the calculation amount, and improve the calculation efficiency and time, the data of the enhancement layer image can be selected. Exemplarily, the determining the enhancement layer image data based on the residual includes: obtaining data to be retained based on the residual; selecting retained data from the data to be retained, and using the data as the enhancement layer image data.
选择保留数据的方式可以为,例如,将(hdr/16*drc coef-base)*2 n,其中,n为想要保留数据的位数。根据前文可知hdr/16可以得到4位小数,所以n最大为4,最小为1。此处可以选择n为3,那么久可以保留三位小数。(hdr/16*drc coef-base)为残差。可以在该残差内加入随机噪声数据。由于在后续图像的编码过程中,其计算过程均是对正整数进行计算的,所以还需要将小数转换为正整数。 The way to choose to keep the data can be, for example, (hdr/16*drc coef -base)*2 n , where n is the number of bits of data you want to keep. According to the previous text, hdr/16 can get 4 decimal places, so the maximum value of n is 4, and the minimum value is 1. Here you can choose n to be 3, then you can keep three decimal places for a long time. (hdr/16*drc coef -base) is the residual. Random noise data can be added to this residual. Since in the encoding process of the subsequent images, the calculation process is performed on positive integers, it is also necessary to convert the decimals into positive integers.
例如,对所述保留数据进行调整,得到具有正整数数据的增强层图像数据。For example, the reserved data is adjusted to obtain enhancement layer image data with positive integer data.
可以通过以下公式(1)来调整:It can be adjusted by the following formula (1):
Figure PCTCN2021071514-appb-000001
Figure PCTCN2021071514-appb-000001
其中,res为增强层图像数据,可以理解,通过2048来调整为正整数。Base可以为预处理的基本层图像数据。Among them, res is the image data of the enhancement layer. It can be understood that it is adjusted to a positive integer through 2048. Base can be the preprocessed base layer image data.
此外,还可以直接:对残差进行调整,得到具有正整数数据的残差,直接作为增强层图像数据。In addition, it is also possible to directly adjust the residual to obtain a residual with positive integer data, which is directly used as the enhancement layer image data.
接着,在步骤S5中,基于第二预设编码规则对所述增强层图像数据进行编码,得到 增强层图像码流。其中,第二预设编码规则是指针对增强层图像数据的编码规则,由此进行编码的。该编码过程可以包括:划分成slice(切片图像数据),DCT(Discrete Cosine Transform,离散余弦变换)变换,量化,Qp map(quantization parameter map,量化参数表)的计算,系数扫描,熵编码等。编码过程可以为本领域技术人员熟知的任意适合的编码方式,在此不再展开描述。Next, in step S5, the enhancement layer image data is encoded based on the second preset encoding rule to obtain an enhancement layer image code stream. Wherein, the second preset encoding rule refers to the encoding rule for the enhancement layer image data, and is encoded accordingly. The encoding process may include: dividing into slices (slice image data), DCT (Discrete Cosine Transform, discrete cosine transform) transformation, quantization, calculation of Qp map (quantization parameter map, quantization parameter table), coefficient scanning, entropy encoding, etc. The encoding process may be any suitable encoding manner well known to those skilled in the art, which will not be described further here.
最后,在步骤S6中,基于所述增强层图像码流和所述基本层图像码流生成所述影像码流数据,例如,将增强层图像码流写入基本层图像码流中的预设字段,以生成所述影像码流数据。其中,预设字段可以根据不同编码规则选择对应的预设字段。例如,对于JPEG所对应的编码规则而言,可以是紧跟APP0应用段的位置。例如,根据前文所述,手机中的编码器找到基本层图像码流的APP0应用段的位置(码流标记字符FF E0),然后读取该应用段的长度,将指针往后移动该长度,就是增强层图像码流的插入的位置,并将增强层图像码流插入到基本层图像码流中,输出最终的影像码流数据。Finally, in step S6, the image code stream data is generated based on the enhancement layer image code stream and the base layer image code stream, for example, the enhancement layer image code stream is written into a preset in the base layer image code stream field to generate the video stream data. Among them, the preset field can select the corresponding preset field according to different encoding rules. For example, for the encoding rule corresponding to JPEG, it may be the position immediately following the APP0 application segment. For example, according to the above, the encoder in the mobile phone finds the position of the APP0 application segment of the base layer image code stream (code stream marker character FF E0), then reads the length of the application segment, and moves the pointer back by this length, It is the insertion position of the enhancement layer image code stream, and the enhancement layer image code stream is inserted into the base layer image code stream, and the final image code stream data is output.
如果基本层图像码流中不存在APP0应用段,则在基本层图像码流的最后或者其它的自定义位置插入增强层图像码流。If the APP0 application segment does not exist in the base layer image code stream, the enhancement layer image code stream is inserted at the last or other custom position of the base layer image code stream.
上述在影像码流数据中保留的增强层图像码流,通过解码该增强层图像码流可以获得增强层图像数据,该增强层图像数据可以用于恢复部分图像中饱和的区域,利用保留的大于基本层图像数据(例如JPEG)动态范围的增强层图像数据,在图像后处理中调节图像的亮度、对比度等参数时利用这些图像数据可以恢复部分图像中饱和的区域,例如降低图像亮度使部分白色的天空恢复成本来的蓝色。The above-mentioned enhancement layer image code stream retained in the image code stream data can obtain enhancement layer image data by decoding the enhancement layer image code stream, and the enhancement layer image data can be used to restore the saturated area in part of the image. The image data of the enhancement layer with the dynamic range of the basic layer image data (such as JPEG) can be used to restore the saturated areas in part of the image when adjusting the brightness, contrast and other parameters of the image in image post-processing, such as reducing the image brightness to make part of the image white The sky is restored to its original blue color.
继续参考图1,在步骤S140中,显示所述第一影像和所述处理影像。Continuing to refer to FIG. 1, in step S140, the first image and the processed image are displayed.
通过显示第一影像和处理影像,以向用户展示处理后的图像所能达到的效果。可以以预设显示方式显示所述第一影像和所述处理影像,包括:针对所述第一影像中的曝光异常区域,交替的显示所述第一影像中的曝光异常区域对应的影像以及所述处理影像,通过该交替的显示,利用图像的跳变来提示用户第一影像中的被处理影像覆盖的区域是曝光异常区域。该交替的显示也即指,通过控制处理影像的显示时序,使其按照预设的频率显示,在其显示时,会覆盖第一影像中的曝光异常区域,而当其在不显示时,则会显示第一影像中的曝光异常区域。或者,还可以以其他的预设显示方式,来实现在对处理影像显示的同时,还能够提示用户第一影像中具有曝光异常区域。By displaying the first image and the processed image, the user can be shown the effect that the processed image can achieve. The first image and the processed image may be displayed in a preset display manner, including: for the abnormally exposed area in the first image, alternately displaying the image corresponding to the abnormally exposed area in the first image and all the images corresponding to the abnormally exposed area in the first image. The processing image is described, and through the alternate display, the user is prompted by the jumping of the image that the area covered by the processed image in the first image is an abnormal exposure area. The alternate display also means that by controlling the display timing of the processed image, it is displayed at a preset frequency. When it is displayed, it will cover the abnormally exposed area in the first image, and when it is not displayed, it will be displayed at a preset frequency. Displays abnormally exposed areas in the first image. Alternatively, other preset display manners can also be used to realize that while displaying the processed image, the user can also be prompted that there is an abnormally exposed area in the first image.
在一个示例中,所述方法还包括:基于所述曝光异常区域,生成用于提示所述曝光异常区域的提示信息;显示所述提示信息,所述提示信息标识出所述第一影像中的曝光异常 区域。例如,该提示信息可以包括预设图案,例如类似斑马线的图案,如图3所示,在所述第一影像中的曝光异常区域以所述预设图案标识出;再例如,所述提示信息包括特定颜色,在所述第一影像中的曝光异常区域以特定颜色标识出,特定颜色可以是任意的能够凸出显示曝光异常区域的颜色,例如红色、黑色、绿色等等。或者,还可以将曝光异常区域以闪烁的方式凸出显示。In one example, the method further includes: based on the abnormal exposure area, generating prompt information for prompting the abnormal exposure area; displaying the prompt information, the prompt information identifying the Expose abnormal areas. For example, the prompt information may include a preset pattern, such as a pattern similar to a zebra crossing. As shown in FIG. 3 , the abnormally exposed area in the first image is identified by the preset pattern; for another example, the prompt information Including a specific color, the abnormally exposed area in the first image is identified with a specific color, and the specific color can be any color that can highlight the abnormally exposed area, such as red, black, green and so on. Alternatively, abnormally exposed areas can be highlighted in a flashing manner.
值得一提的是,当第一影像中包括过度曝光区域和欠曝光区域时,则可以通过相同的提示信息进行提示,或者,也可以以不同的提示信息来区别化的对用户进行提示,例如以不同的预设图案标识出过度曝光区域和欠曝光区域,或者,以不同的特定颜色标识出过度曝光区域和欠曝光区域。It is worth mentioning that when the first image includes an overexposed area and an underexposed area, the same prompt information can be used to prompt the user, or different prompt information can be used to differentiate the prompting to the user, such as Overexposed and underexposed areas are identified in different preset patterns, or overexposed and underexposed areas are identified in different specific colors.
在本申请的实施例中,如图4所示,还可以同时显示所述第一影像201、所述处理影像203和提示信息202例如预设图案(例如类似斑马线),其中,提示信息标识出第一影像中的曝光异常区域,而处理影像可以覆盖提示信息例如类似斑马线的图案。In the embodiment of the present application, as shown in FIG. 4 , the first image 201 , the processed image 203 and the prompt information 202 , such as a preset pattern (such as a zebra crossing), may also be displayed simultaneously, wherein the prompt information identifies the The exposed abnormal area in the first image, and the processed image can cover the prompt information such as a pattern similar to zebra crossing.
在其他示例中,还可以根据用户指令,显示处理影像,例如,当用户通过观察第一影像判断出第一影像中存在过度曝光区域和/或欠曝光区域,或者,通过显示的提示信息获知第一影像中存在过度曝光区域和/或欠曝光区域时,可以手动控制显示处理影像。In other examples, the processed image can also be displayed according to the user's instruction. For example, when the user judges that there is an overexposed area and/or an underexposed area in the first image by observing the first image, or obtains the first image through the displayed prompt information When there are overexposed areas and/or underexposed areas in an image, the processed image can be manually controlled to display.
值得一提的是,在本申请实施例中,第一影像中的曝光异常区域可以是一个或多个。It is worth mentioning that, in this embodiment of the present application, there may be one or more abnormal exposure areas in the first image.
当显示的第一影像中没有曝光异常区域,或者,显示的第一影像中有曝光异常区域,但处理影像的处理效果满足用户需求,则可以通过当前的拍摄参数进行拍摄,而当显示的第一影像中有曝光异常区域,且处理影像的处理效果不满足用户需求时,则可以对当前的拍摄参数做出修正,例如如果存在过度曝光区域,则适当增加快门速度、减小光圈及/或减少ISO感光度;如果存在欠曝光区域,则适当减少快门速度、增大光圈及/或增加ISO感光度等,从而能够辅助用户进行曝光控制,实现准确曝光,提升用户的使用体验。When there is no abnormal exposure area in the displayed first image, or, there is an abnormal exposure area in the displayed first image, but the processing effect of the processed image meets the user's needs, the current shooting parameters can be used for shooting, and when the displayed first image has an abnormal exposure area If there is an abnormal exposure area in an image, and the processing effect of the processed image does not meet the user's needs, the current shooting parameters can be corrected, for example, if there is an overexposed area, appropriately increase the shutter speed, reduce the aperture and/or Reduce the ISO sensitivity; if there is an underexposed area, appropriately reduce the shutter speed, increase the aperture and/or increase the ISO sensitivity, etc., so as to assist the user in exposure control, achieve accurate exposure, and improve the user experience.
至此,完成了对本申请实施例中的图像处理方法的描述,可以理解的是,本申请的上述方法中的各个步骤,在不矛盾的前提下,顺序可以调换或者交替进行。So far, the description of the image processing method in the embodiments of the present application has been completed. It can be understood that the steps in the above-mentioned method of the present application can be exchanged or performed alternately in order on the premise that there is no contradiction.
综上所述,根据本申请的图像处理方法,至少对所述曝光异常区域的影像进行处理,并以预设显示方式显示所述第一影像和所述处理影像,以便用户能够直观的观察到当前拍摄条件下的曝光状态,以及在当前拍摄条件下拍摄的图像经过处理后的效果是否符合用户要求,从而能够辅助用户进行曝光控制,实现准确曝光,提升用户的使用体验。To sum up, according to the image processing method of the present application, at least the image of the abnormally exposed area is processed, and the first image and the processed image are displayed in a preset display mode, so that the user can intuitively observe The exposure state under the current shooting conditions, and whether the processed effect of the image captured under the current shooting conditions meets the user's requirements, so as to assist the user in exposure control, achieve accurate exposure, and improve the user's experience.
下面,参考图5对本申请的图像处理装置进行描述,其中,图5中示出了本申请实施例中的图像处理装置的示意性框图。该图像处理装置可以用于处理前述的图像处理方法。Next, the image processing apparatus of the present application will be described with reference to FIG. 5 , wherein FIG. 5 shows a schematic block diagram of the image processing apparatus in the embodiment of the present application. The image processing apparatus can be used to process the aforementioned image processing method.
该图像处理装置可以是是手持的或者穿戴式的终端设备,例如,智能手机、平板电脑、 桌上型电脑、计算机、相机、摄像机、可穿戴设备(如智能手表)等,或者,其他任意的具有拍摄装置例如摄像头的图像处理装置,例如可移动平台,可移动平台包括但不限于飞行器(包括但不限于无人机)、机器人、车辆或船等。The image processing apparatus may be a handheld or wearable terminal device, for example, a smart phone, a tablet computer, a desktop computer, a computer, a camera, a video camera, a wearable device (such as a smart watch), etc., or any other An image processing device with a photographing device such as a camera, such as a movable platform, the movable platform includes but is not limited to aircraft (including but not limited to drones), robots, vehicles or ships.
拍摄装置可以是具有图像传感器的装置,例如相机、摄像机、摄像头或者还可以是其他装置。图像传感器(本文也称相机传感器)是用于捕获图像数据的器件,其例如可以为CMOS图像传感器、CCD图像传感器等。The photographing device may be a device with an image sensor, such as a camera, a video camera, a camera, or other devices. An image sensor (also referred to herein as a camera sensor) is a device for capturing image data, which may be, for example, a CMOS image sensor, a CCD image sensor, or the like.
在一个示例中,如图5所示,图像处理装置500包括一个或多个处理器501、存储器502、通信接口503、显示单元504等。这些组件通过总线系统和/或其它形式的连接机构(未示出)互连。In one example, as shown in FIG. 5, the image processing apparatus 500 includes one or more processors 501, a memory 502, a communication interface 503, a display unit 504, and the like. These components are interconnected by a bus system and/or other form of connection mechanism (not shown).
存储器502用于存储可执行指令,例如用于存储用于实现根据本申请实施例的图像处理方法100中的相应步骤和程序指令。存储器502可存储操作系统(包括用于处理各种基本系统服务和用于执行硬件相关任务的程序)、至少一个功能所需的应用程序(比如拍摄装置的控制功能、声音播放功能、图像播放功能等)等。这些应用程序中的一些可以经由无线通信从外部服务器下载。其它应用程序可以在制造或出厂时被安装在存储器502内,还可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存(例如SD卡)等。The memory 502 is used for storing executable instructions, for example, for storing corresponding steps and program instructions for implementing the image processing method 100 according to the embodiment of the present application. The memory 502 can store an operating system (including programs for processing various basic system services and for performing hardware-related tasks), an application program required for at least one function (such as a control function of a photographing device, a sound playback function, an image playback function) and many more. Some of these applications can be downloaded from external servers via wireless communication. Other applications may be installed in memory 502 at the time of manufacture or at the factory, and may also include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and /or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and/or cache memory, or the like. The non-volatile memory may include, for example, a read only memory (ROM), a hard disk, a flash memory (eg, an SD card), and the like.
通信接口503可以用于图像处理装置500和其他外部设备之间进行通信,包括有线或者无线方式的通信。通信接口503可以为接入基于通信标准的无线网络,如WiFi(例如WiFi6)、软件无线电(Software-defined radio,简称SDR)、2G、3G、4G、5G或它们的组合。在一个示例性实施例中,通信接口503经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信接口503还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication interface 503 may be used for communication between the image processing apparatus 500 and other external devices, including wired or wireless communication. The communication interface 503 may be for accessing a wireless network based on a communication standard, such as WiFi (eg WiFi6), software-defined radio (SDR for short), 2G, 3G, 4G, 5G or a combination thereof. In an exemplary embodiment, the communication interface 503 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication interface 503 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
可选地,图像处理装置500还包括输入装置(未示出)可以是用户用来输入各种操作的装置,例如可以包括功能键(比如例如,触摸键、按键(例如音量控制按键、开关按键等)、机械键、软键等、操作杆、麦克风和触摸屏等中的一个或多个,或者其他用于使得用户能够输入信息的用户输入装置。数据(例如,音频、视频、图像等)通过输入装置来获得。Optionally, the image processing apparatus 500 further includes an input device (not shown), which may be a device used by the user to input various operations, for example, may include function keys (such as touch keys, keys (such as volume control keys, switch keys, etc.). etc.), mechanical keys, soft keys, etc., one or more of joysticks, microphones, touchscreens, etc., or other user input devices for enabling a user to enter information. Data (eg, audio, video, images, etc.) is passed through input device to obtain.
处理器501可以是中央处理单元(CPU)、图像处理单元(GPU)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者具有数据处理能力和/或指令执行能力的其它形式的处理 单元,并且可以控制拍摄装置中的其它组件以执行期望的功能。处理器501能够执行存储器502中存储的所述指令,以执行本文描述的图像处理方法100的相应步骤,具体地可以参考前文的方法描述。例如,处理器501能够包括一个或多个嵌入式处理器、处理器核心、微型处理器、逻辑电路、硬件有限状态机(FSM)、数字信号处理器(DSP)、ISP、编码器、解码器或它们的组合。The processor 501 may be a central processing unit (CPU), a graphics processing unit (GPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other form of processing with data processing capabilities and/or instruction execution capabilities unit, and can control other components in the camera to perform desired functions. The processor 501 can execute the instructions stored in the memory 502 to execute the corresponding steps of the image processing method 100 described herein. For details, refer to the foregoing method description. For example, processor 501 can include one or more embedded processors, processor cores, microprocessors, logic circuits, hardware finite state machines (FSMs), digital signal processors (DSPs), ISPs, encoders, decoders or their combination.
在一个示例中,处理器501用于执行所述存储器中存储的程序指令,使得一个或多个处理器执行以下步骤:获取拍摄场景的第一动态范围的第一影像;对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围。In one example, the processor 501 is configured to execute program instructions stored in the memory, so that one or more processors perform the following steps: acquiring a first image of a first dynamic range of a shooting scene; performing analysis to determine abnormally exposed areas in the first image, the abnormally exposed areas including overexposed areas and/or underexposed areas; at least processing the images of the abnormally exposed areas to obtain a processed image, wherein the The processed image has a second dynamic range that is higher than the first dynamic range.
在一个示例中,所述处理器501还用于:基于所述曝光异常区域,生成用于提示所述曝光异常区域的提示信息。In an example, the processor 501 is further configured to: generate prompt information for prompting the abnormal exposure area based on the abnormal exposure area.
在一个示例中,所述处理器501用于对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,包括:基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域。例如,将所述第一影像中的各个区域的亮度信息和预设亮度阈值进行比较,以确定所述第一影像中的曝光异常区域,其中,预设亮度阈值包括第一预设亮度阈值或第二预设亮度阈值,所述第一预设亮度阈值大于所述第二预设亮度阈值,所述过度曝光区域包括亮度信息大于所述第一预设亮度阈值的区域,所述欠曝光区域包括亮度信息小于所述第二预设亮度阈值的区域。In an example, the processor 501 is configured to analyze the first image and determine the abnormally exposed area in the first image, including: determining, based on pixel information of pixel points of the first image, the Describe the abnormally exposed area in the first image. For example, comparing the brightness information of each area in the first image with a preset brightness threshold to determine an abnormally exposed area in the first image, where the preset brightness threshold includes a first preset brightness threshold or a second preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, the overexposed area includes an area whose brightness information is greater than the first preset brightness threshold, and the underexposed area Including an area whose brightness information is less than the second preset brightness threshold.
在一个示例中,所述处理器501用于获取拍摄场景的第一动态范围的第一影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;解码所述基础层图像码流,以获得所述第一影像;或者,获取原始影像数据,并基于所述原始影像数据获取拍摄场景的第一动态范围的第一影像。In an example, the processor 501 is configured to acquire a first image of a first dynamic range of a shooting scene, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream; decoding the base layer image code stream to obtain the first image; or, acquiring original image data, and acquiring a first image of a first dynamic range of a shooting scene based on the original image data.
在一个示例中,所述处理器501用于至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;解码所述基础层图像码流和增强层码流,以获得基础层图像数据和增强层图像数据;对基础层图像数据和增强层图像数据进行融合,以获得具有所述第二动态范围的第二影像;提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。In an example, the processor 501 is configured to process at least the image of the abnormally exposed area to obtain the processed image, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and the enhancement layer code stream; decode the base layer image code stream and the enhancement layer code stream to obtain the base layer image data and the enhancement layer image data; fuse the base layer image data and the enhancement layer image data to obtain the A second image with a second dynamic range; extracting an image corresponding to the abnormally exposed area in the second image to obtain the processed image.
在一个示例中,所述处理器501用于至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:当所述第一影像中包括过度曝光区域时,对所述第二影像进行处理,以降低所述第二影像的亮度;或者,当所述第一影像中包括欠曝光区域时,对所述第二影像进行处理,以提高所述第二影像的亮度;所述提取所述第二影像中与所述曝光异常区域 对应的影像,以获得所述处理影像,包括:提取所述处理后的第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。In one example, the processor 501 is configured to process at least the image of the abnormally exposed area to obtain a processed image, including: when the first image includes an overexposed area, processing the second image processing to reduce the brightness of the second image; or, when the first image includes an underexposed area, processing the second image to improve the brightness of the second image; the extracting The image corresponding to the abnormal exposure area in the second image to obtain the processed image includes: extracting the image corresponding to the abnormal exposure area in the processed second image to obtain the processed image image.
在一个示例中,所述处理器501用于至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:当所述第一影像中包括过度曝光区域时,基于预设的映射函数,对第二影像进行处理,以降低第二影像的亮度;或者当所述第一影像中包括欠曝光区域时,基于预设的映射函数,对第二影像进行处理,以提高第二影像的亮度。In one example, the processor 501 is configured to process at least the image of the abnormally exposed area to obtain a processed image, including: when the first image includes an overexposed area, based on a preset mapping function , process the second image to reduce the brightness of the second image; or when the first image includes an underexposed area, process the second image based on a preset mapping function to improve the brightness of the second image brightness.
在一个示例中,所述处理器501用于所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;对所述基础层图像码流进行解码,以获取基础层图像数据;对所述增强层码流进行解码,以获取增强层图像数据;将所述曝光异常区域对应的基础层图像数据和所述曝光异常区域对应的增强层图像数据进行融合,以获得处理影像。In an example, the processor 501 is configured to process at least the image of the abnormally exposed area to obtain the processed image, including: acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and enhancement layer code stream; decode the base layer image code stream to obtain base layer image data; decode the enhancement layer code stream to obtain enhancement layer image data; The image data of the base layer and the image data of the enhancement layer corresponding to the abnormally exposed area are fused to obtain a processed image.
在一个示例中,所述处理器501用于获取影像码流数据,包括:获取原始图像数据,对所述原始图像数据做非线性图像变换处理得到待处理图像数据;从所述待处理图像数据或所述原始图像数据中提取预设数据量的基本层图像数据;基于第一预设编码规则对所述基本层图像数据进行编码,得到基本层图像码流;基于所述待处理图像数据和所述基本层图像数据计算残差,并基于所述残差确定增强层图像数据;基于第二预设编码规则对所述增强层图像数据进行编码,得到增强层图像码流;基于所述增强层图像码流和所述基本层图像码流生成所述影像码流数据。In an example, the processor 501 is configured to acquire image code stream data, including: acquiring original image data, performing nonlinear image transformation processing on the original image data to obtain image data to be processed; or extracting a preset amount of base layer image data from the original image data; encoding the base layer image data based on the first preset coding rule to obtain a base layer image code stream; based on the to-be-processed image data and Calculate residuals from the base layer image data, and determine enhancement layer image data based on the residuals; encode the enhancement layer image data based on a second preset coding rule to obtain an enhancement layer image code stream; The video code stream data is generated from the layer image code stream and the base layer image code stream.
在一个示例中,所述处理器501用于基于所述待处理图像数据和所述基本层图像数据计算残差,包括:获取预处理的基本层图像数据,其中,所述预处理的基本层图像数据包括对所述基本层图像码流解码后获得的基本层图像数据;基于所述待处理图像数据和所述预处理的基本层图像数据计算残差。In an example, the processor 501 is configured to calculate a residual based on the image data to be processed and the base layer image data, including: acquiring preprocessed base layer image data, wherein the preprocessed base layer The image data includes base layer image data obtained after decoding the base layer image code stream; a residual is calculated based on the to-be-processed image data and the preprocessed base layer image data.
在一个示例中,所述处理器501用于基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:从所述待处理图像数据中减去所述预处理的基本层图像数据,得到所述残差。In an example, the processor 501 is configured to calculate the residual based on the to-be-processed image data and the preprocessed base layer image data, including: subtracting the pre-processed image data from the to-be-processed image data Process the base layer image data to obtain the residual.
在一个示例中,所述处理器501用于基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:将所述待处理图像数据所表示的动态范围与所述预处理的基本层图像数据所表示的动态范围进行对齐;通过所述待处理图像数据的动态范围与基本层图像数据的动态范围的比例,对对齐后的待处理图像数据进行补偿;从将补偿后的待处理图像数据中减去所述预处理的基本层图像数据,得到残差。In one example, the processor 501 is configured to calculate the residual based on the to-be-processed image data and the preprocessed base layer image data, including: comparing the dynamic range represented by the to-be-processed image data with the The dynamic range represented by the preprocessed base layer image data is aligned; the aligned image data to be processed is compensated according to the ratio of the dynamic range of the image data to be processed to the dynamic range of the base layer image data; The preprocessed base layer image data is subtracted from the compensated image data to be processed to obtain a residual.
在一个示例中,所述处理器501用于基于所述残差确定增强层图像数据,包括:基于所述残差,得到待保留数据;从所述待保留数据中选择保留数据,并作为所述增强层图像 数据。在一个示例中,所述处理器501用于所述从所述待保留数据中选择保留数据,并作为所述增强层图像数据,包括:对所述保留数据进行调整,得到具有正整数数据的增强层图像数据。In an example, the processor 501 is configured to determine the enhancement layer image data based on the residual, including: obtaining data to be retained based on the residual; selecting retained data from the data to be retained, and using the data as the retained data the enhancement layer image data. In an example, the processor 501 is configured to select the reserved data from the to-be-retained data and use it as the enhancement layer image data, including: adjusting the reserved data to obtain a data with positive integer data. Enhancement layer image data.
可选地,图像处理装置500还包括显示单元504,用于显示由处理器组件产生的图像或视频的器件。显示单元504可以包括,例如,液晶显示(LCD)装置或有机发光二极管(OLED)装置。基于从处理器获取的数据,显示器可以显示各种图像,例如菜单、所选择的操作参数、拍摄模式选择界面、由图像传感器捕获的图像、用处理器等和/或从设备的用户界面接收的其它信息等。当图像处理装置为可移动平台时,则可移动平台和控制终端例如手机、遥控器、眼镜、平板电脑等通信连接,则显示单元可以为该些控制终端的显示屏。Optionally, the image processing apparatus 500 further includes a display unit 504, a device for displaying images or videos generated by the processor component. The display unit 504 may include, for example, a liquid crystal display (LCD) device or an organic light emitting diode (OLED) device. Based on data acquired from the processor, the display may display various images, such as menus, selected operating parameters, a capture mode selection interface, images captured by an image sensor, received by the processor, etc. and/or received from a user interface of the device other information, etc. When the image processing device is a movable platform, the movable platform is connected to a control terminal such as a mobile phone, a remote controller, glasses, a tablet computer, etc., and the display unit may be a display screen of these control terminals.
示例性地,显示单元504用于:显示所述第一影像和所述处理影像,例如针对所述第一影像中的曝光异常区域,交替的显示所述第一影像中的曝光异常区域对应的影像以及所述处理影像。所述提示信息包括预设图案,在所述第一影像中的曝光异常区域以所述预设图案标识出;或者所述提示信息包括特定颜色,在所述第一影像中的曝光异常区域以特定颜色标识出。Exemplarily, the display unit 504 is configured to: display the first image and the processed image, for example, for the abnormal exposure area in the first image, alternately display the corresponding abnormal exposure area in the first image. an image and the processed image. The prompt information includes a preset pattern, and the abnormal exposure area in the first image is identified by the preset pattern; or the prompt information includes a specific color, and the abnormal exposure area in the first image is marked with the preset pattern. identified by a specific color.
所述显示单元还用于显示所述提示信息,所述提示信息标识出所述第一影像中的曝光异常区域,例如,同时显示第一影像、处理影像和提示信息等。The display unit is further configured to display the prompt information, and the prompt information identifies an abnormally exposed area in the first image, for example, the first image, the processed image, and the prompt information are displayed at the same time.
本申请实施例中的图像处理装置由于能够实现前述的图像处理方法,因此也具有前述方法的优点。Since the image processing apparatus in the embodiment of the present application can implement the aforementioned image processing method, it also has the advantages of the aforementioned method.
本申请中的图像处理装置500可以是相机、手机、云台相机、无人机、无人机上的相机、电脑等任意可以处理图像的设备或装置等。The image processing apparatus 500 in this application may be any device or apparatus that can process images, such as a camera, a mobile phone, a PTZ camera, a drone, a camera on a drone, a computer, or the like.
另外,本发明实施例还提供了一种计算机存储介质,其上存储有计算机程序。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器可以运行存储装置存储的所述程序指令,以实现本文所述的本发明实施例中(由处理器实现)的功能以及/或者其它期望的功能,例如以执行根据本申请实施例的图像处理方法100的相应步骤,在所述计算机可读存储介质中还可以存储各种应用程序和各种数据,例如所述应用程序使用和/或产生的各种数据等。In addition, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions stored in the storage device to implement (implemented by the processor) the embodiments of the present invention described herein. function and/or other desired functions, for example, to execute the corresponding steps of the image processing method 100 according to the embodiment of the present application, various application programs and various data may also be stored in the computer-readable storage medium, such as the Various data used and/or generated by the application, etc.
例如,所述计算机存储介质例如可以包括智能电话的存储卡、平板电脑的存储部件、个人计算机的硬盘、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、或者上述存储介质的任意组合。所述计算机可读存储介质可以是一个或多个计算机可读存储介质的任意组合。For example, the computer storage medium may include, for example, a memory card for a smartphone, a storage unit for a tablet computer, a hard disk for a personal computer, read only memory (ROM), erasable programmable read only memory (EPROM), portable compact disk Read only memory (CD-ROM), USB memory, or any combination of the above storage media. The computer-readable storage medium can be any combination of one or more computer-readable storage media.
尽管这里已经参考附图描述了示例实施例,应理解上述示例实施例仅仅是示例性的, 并且不意图将本发明的范围限制于此。本领域普通技术人员可以在其中进行各种改变和修改,而不偏离本发明的范围和精神。所有这些改变和修改意在被包括在所附权利要求所要求的本发明的范围之内。Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above-described example embodiments are exemplary only, and are not intended to limit the scope of the invention thereto. Various changes and modifications can be made therein by those of ordinary skill in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个设备,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该本发明的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如相应的权利要求书所反映的那样,其发明点在于可以用少于某个公开的单个实施例的所有特征的特征来解决相应的技术问题。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it is to be understood that in the description of the exemplary embodiments of the invention, various features of the invention are sometimes grouped together , or in its description. However, this method of the invention should not be interpreted as reflecting the intention that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the corresponding claims reflect, the invention lies in the fact that the corresponding technical problem may be solved with less than all features of a single disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域的技术人员可以理解,除了特征之间相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的替代特征来代替。It will be understood by those skilled in the art that all features disclosed in this specification (including the accompanying claims, abstract and drawings) and any method or apparatus so disclosed may be used in any combination, except that the features are mutually exclusive. Processes or units are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will appreciate that although some of the embodiments described herein include certain features, but not others, included in other embodiments, that combinations of features of different embodiments are intended to be within the scope of the invention within and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微 处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一些模块的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules according to the embodiments of the present invention. The present invention may also be implemented as apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

Claims (37)

  1. 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:
    获取拍摄场景的第一动态范围的第一影像;acquiring a first image of a first dynamic range of the shooting scene;
    对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;Analyzing the first image to determine an abnormally exposed area in the first image, where the abnormally exposed area includes an overexposed area and/or an underexposed area;
    至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围;processing at least the image of the abnormally exposed area to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range;
    显示所述第一影像和所述处理影像。The first image and the processed image are displayed.
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:基于所述曝光异常区域,生成用于提示所述曝光异常区域的提示信息;The method according to claim 1, wherein the method further comprises: based on the abnormal exposure area, generating prompt information for prompting the abnormal exposure area;
    显示所述提示信息,所述提示信息用于标识出所述第一影像中的曝光异常区域。The prompt information is displayed, where the prompt information is used to identify an abnormally exposed area in the first image.
  3. 如权利要求1所述的方法,其特征在于,所述对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,包括:The method of claim 1, wherein the analyzing the first image to determine an abnormally exposed area in the first image comprises:
    基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域。Based on the pixel information of the pixel points of the first image, an abnormally exposed area in the first image is determined.
  4. 如权利要求3所述的方法,其特征在于,所述像素信息包括亮度信息,所述基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域,包括:The method of claim 3, wherein the pixel information includes luminance information, and the determining an abnormally exposed area in the first image based on the pixel information of the pixel points of the first image comprises:
    将所述第一影像中的各个区域的亮度信息和预设亮度阈值进行比较,以确定所述第一影像中的过度曝光区域和/或欠曝光区域,其中,预设亮度阈值包括第一预设亮度阈值或第二预设亮度阈值,所述第一预设亮度阈值大于所述第二预设亮度阈值,所述过度曝光区域包括亮度信息大于所述第一预设亮度阈值的区域,所述欠曝光区域包括亮度信息小于所述第二预设亮度阈值的区域。The brightness information of each area in the first image is compared with a preset brightness threshold to determine an overexposed area and/or an underexposed area in the first image, wherein the preset brightness threshold includes a first preset brightness threshold. Set a brightness threshold or a second preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, and the overexposed area includes an area with brightness information greater than the first preset brightness threshold, so The underexposed area includes an area whose brightness information is less than the second preset brightness threshold.
  5. 如权利要求1所述的方法,其特征在于,所述获取拍摄场景的第一动态范围的第一影像,包括:The method of claim 1, wherein the acquiring the first image of the first dynamic range of the shooting scene comprises:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    解码所述基础层图像码流,以获得所述第一影像;或者,decoding the base layer image code stream to obtain the first image; or,
    获取原始影像数据,并基于所述原始影像数据获取拍摄场景的第一动态范围的第一影像。Obtain original image data, and obtain a first image of a first dynamic range of a shooting scene based on the original image data.
  6. 如权利要求1所述的方法,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The method of claim 1, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    解码所述基础层图像码流和增强层码流,以获得基础层图像数据和增强层图像数据;Decoding the base layer image code stream and the enhancement layer code stream to obtain base layer image data and enhancement layer image data;
    对基础层图像数据和增强层图像数据进行融合,以获得具有所述第二动态范围的第二 影像;fusing the base layer image data and the enhancement layer image data to obtain a second image having the second dynamic range;
    提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。Extracting the image corresponding to the abnormally exposed area in the second image to obtain the processed image.
  7. 如权利要求6所述的方法,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The method according to claim 6, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    当所述第一影像中包括过度曝光区域时,对所述第二影像进行处理,以降低所述第二影像的亮度;或者,When the first image includes an overexposed area, processing the second image to reduce the brightness of the second image; or,
    当所述第一影像中包括欠曝光区域时,对所述第二影像进行处理,以提高所述第二影像的亮度;When the first image includes an underexposed area, processing the second image to improve the brightness of the second image;
    所述提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像,包括:提取所述处理后的第二影像中与所述过度曝光区域和/或欠曝光区域对应的影像,以获得所述处理影像。The extracting the image corresponding to the abnormally exposed area in the second image to obtain the processed image includes: extracting the image corresponding to the overexposed area and/or the underexposed area in the processed second image corresponding images to obtain the processed images.
  8. 如权利要求7所述的方法,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The method of claim 7, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    当所述第一影像中包括过度曝光区域时,基于预设的映射函数,对第二影像进行处理,以降低第二影像的亮度;或者When the first image includes an overexposed area, processing the second image based on a preset mapping function to reduce the brightness of the second image; or
    当所述第一影像中包括欠曝光区域时,基于预设的映射函数,对第二影像进行处理,以提高第二影像的亮度。When the first image includes an underexposed area, the second image is processed based on a preset mapping function to improve the brightness of the second image.
  9. 如权利要求1所述的方法,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The method of claim 1, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    对所述基础层图像码流进行解码,以获取基础层图像数据;Decoding the base layer image code stream to obtain base layer image data;
    对所述增强层码流进行解码,以获取增强层图像数据;Decoding the enhancement layer code stream to obtain enhancement layer image data;
    将所述曝光异常区域对应的基础层图像数据和所述曝光异常区域对应的增强层图像数据进行融合,以获得所述处理影像。The base layer image data corresponding to the abnormal exposure area and the enhancement layer image data corresponding to the abnormal exposure area are fused to obtain the processed image.
  10. 如权利要求1所述的方法,其特征在于,所述显示所述第一影像和所述处理影像,包括:The method of claim 1, wherein the displaying the first image and the processed image comprises:
    针对所述第一影像中的曝光异常区域,交替的显示所述第一影像中的曝光异常区域对应的影像以及所述处理影像。For the abnormally exposed area in the first image, the image corresponding to the abnormally exposed area in the first image and the processed image are alternately displayed.
  11. 如权利要求2所述的方法,其特征在于,所述提示信息包括预设图案,在所述第一影像中的曝光异常区域以所述预设图案标识出;或者The method of claim 2, wherein the prompt information includes a preset pattern, and an abnormally exposed area in the first image is identified by the preset pattern; or
    所述提示信息包括特定颜色,在所述第一影像中的曝光异常区域以特定颜色标识出。The prompt information includes a specific color, and the abnormally exposed area in the first image is marked with a specific color.
  12. 如权利要求1所述的方法,其特征在于,所述处理影像为高动态范围图像,所述 第一影像为标准动态范围图像。The method of claim 1, wherein the processed image is a high dynamic range image, and the first image is a standard dynamic range image.
  13. 如权利要求5或6或9所述的方法,其特征在于,所述获取影像码流数据,包括:The method according to claim 5, 6 or 9, wherein the acquiring image code stream data comprises:
    获取原始图像数据,对所述原始图像数据做非线性图像变换处理得到待处理图像数据;Obtaining original image data, and performing nonlinear image transformation processing on the original image data to obtain image data to be processed;
    从所述待处理图像数据或所述原始图像数据中提取预设数据量的基本层图像数据;Extracting a preset amount of base layer image data from the to-be-processed image data or the original image data;
    基于第一预设编码规则对所述基本层图像数据进行编码,得到基本层图像码流;encoding the base layer image data based on the first preset encoding rule to obtain a base layer image code stream;
    基于所述待处理图像数据和所述基本层图像数据计算残差,并基于所述残差确定增强层图像数据;calculating a residual based on the to-be-processed image data and the base layer image data, and determining enhancement layer image data based on the residual;
    基于第二预设编码规则对所述增强层图像数据进行编码,得到增强层图像码流;encoding the enhancement layer image data based on the second preset encoding rule to obtain an enhancement layer image code stream;
    基于所述增强层图像码流和所述基本层图像码流生成所述影像码流数据。The video code stream data is generated based on the enhancement layer image code stream and the base layer image code stream.
  14. 如权利要求13所述的方法,其特征在于,所述基于所述待处理图像数据和所述基本层图像数据计算残差,包括:The method of claim 13, wherein the calculating a residual based on the to-be-processed image data and the base layer image data comprises:
    获取预处理的基本层图像数据,其中,所述预处理的基本层图像数据包括对所述基本层图像码流解码后获得的基本层图像数据;acquiring preprocessed base layer image data, wherein the preprocessed base layer image data includes base layer image data obtained after decoding the base layer image code stream;
    基于所述待处理图像数据和所述预处理的基本层图像数据计算残差。A residual is calculated based on the image data to be processed and the preprocessed base layer image data.
  15. 根据权利要求14所述的方法,其特征在于,所述基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:The method according to claim 14, wherein the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data comprises:
    从所述待处理图像数据中减去所述预处理的基本层图像数据,得到所述残差。The preprocessed base layer image data is subtracted from the to-be-processed image data to obtain the residual.
  16. 根据权利要求14所述的方法,其特征在于,所述基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:The method according to claim 14, wherein the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data comprises:
    将所述待处理图像数据所表示的动态范围与所述预处理的基本层图像数据所表示的动态范围进行对齐;Aligning the dynamic range represented by the image data to be processed and the dynamic range represented by the preprocessed base layer image data;
    通过所述待处理图像数据的动态范围与基本层图像数据的动态范围的比例,对对齐后的待处理图像数据进行补偿;Compensate the aligned to-be-processed image data according to the ratio of the dynamic range of the to-be-processed image data to the dynamic range of the base layer image data;
    从将补偿后的待处理图像数据中减去所述预处理的基本层图像数据,得到残差。The preprocessed base layer image data is subtracted from the to-be-processed image data to be compensated to obtain a residual.
  17. 根据权利要求13至16任一项所述的方法,其特征在于,所述基于所述残差确定增强层图像数据,包括:The method according to any one of claims 13 to 16, wherein the determining the enhancement layer image data based on the residual comprises:
    基于所述残差,得到待保留数据;Based on the residual, obtain the data to be retained;
    从所述待保留数据中选择保留数据,并作为所述增强层图像数据。Retain data is selected from the to-be-retained data and used as the enhancement layer image data.
  18. 根据权利要求17所述的方法,其特征在于,所述从所述待保留数据中选择保留数据,并作为所述增强层图像数据,包括:The method according to claim 17, wherein the selecting the reserved data from the to-be-reserved data as the enhancement layer image data comprises:
    对所述保留数据进行调整,得到具有正整数数据的增强层图像数据。The reserved data is adjusted to obtain enhancement layer image data with positive integer data.
  19. 一种图像处理装置,其特征在于,所述图像处理装置包括:存储器,用于存储可 执行的程序指令;An image processing device, characterized in that the image processing device comprises: a memory for storing executable program instructions;
    一个或多个处理器,用于执行所述存储器中存储的所述程序指令,使得所述处理器执行以下步骤:one or more processors for executing the program instructions stored in the memory, causing the processors to perform the following steps:
    获取拍摄场景的第一动态范围的第一影像;acquiring a first image of a first dynamic range of the shooting scene;
    对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,所述曝光异常区域包括过度曝光区域和/或欠曝光区域;Analyzing the first image to determine an abnormally exposed area in the first image, where the abnormally exposed area includes an overexposed area and/or an underexposed area;
    至少对所述曝光异常区域的影像进行处理,以获得处理影像,其中所述处理影像具有第二动态范围,所述第二动态范围高于所述第一动态范围;processing at least the image of the abnormally exposed area to obtain a processed image, wherein the processed image has a second dynamic range, and the second dynamic range is higher than the first dynamic range;
    显示单元,用于显示所述第一影像和所述处理影像。The display unit is used for displaying the first image and the processed image.
  20. 如权利要求19所述的图像处理装置,其特征在于,所述处理器还用于:基于所述曝光异常区域,生成用于提示所述曝光异常区域的提示信息;The image processing apparatus according to claim 19, wherein the processor is further configured to: generate prompt information for prompting the abnormal exposure area based on the abnormal exposure area;
    所述显示单元,还用于显示所述提示信息,所述提示信息标识出所述第一影像中的曝光异常区域。The display unit is further configured to display the prompt information, where the prompt information identifies an abnormally exposed area in the first image.
  21. 如权利要求19所述的图像处理装置,其特征在于,所述对所述第一影像进行分析,确定所述第一影像中的曝光异常区域,包括:The image processing apparatus according to claim 19, wherein the analyzing the first image to determine the abnormal exposure area in the first image comprises:
    基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域。Based on the pixel information of the pixel points of the first image, an abnormally exposed area in the first image is determined.
  22. 如权利要求21所述的图像处理装置,其特征在于,所述像素信息包括亮度信息,所述基于所述第一影像的像素点的像素信息,确定所述第一影像中的曝光异常区域,包括:21. The image processing device according to claim 21, wherein the pixel information includes luminance information, and the abnormal exposure area in the first image is determined based on the pixel information of the pixel points of the first image, include:
    将所述第一影像中的各个区域的亮度信息和预设亮度阈值进行比较,以确定所述第一影像中的曝光异常区域,其中,预设亮度阈值包括第一预设亮度阈值或第二预设亮度阈值,所述第一预设亮度阈值大于所述第二预设亮度阈值,所述过度曝光区域包括亮度信息大于所述第一预设亮度阈值的区域,所述欠曝光区域包括亮度信息小于所述第二预设亮度阈值的区域。comparing the brightness information of each area in the first image with a preset brightness threshold to determine an abnormally exposed area in the first image, wherein the preset brightness threshold includes a first preset brightness threshold or a second preset brightness threshold A preset brightness threshold, the first preset brightness threshold is greater than the second preset brightness threshold, the overexposed area includes an area whose brightness information is greater than the first preset brightness threshold, and the underexposed area includes brightness The information is less than the area of the second preset brightness threshold.
  23. 如权利要求19所述的图像处理装置,其特征在于,所述获取拍摄场景的第一动态范围的第一影像,包括:The image processing apparatus according to claim 19, wherein the acquiring the first image of the first dynamic range of the shooting scene comprises:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    解码所述基础层图像码流,以获得所述第一影像;或者,decoding the base layer image code stream to obtain the first image; or,
    获取原始影像数据,并基于所述原始影像数据获取拍摄场景的第一动态范围的第一影像。Obtain original image data, and obtain a first image of a first dynamic range of a shooting scene based on the original image data.
  24. 如权利要求19所述的图像处理装置,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The image processing apparatus according to claim 19, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    解码所述基础层图像码流和增强层码流,以获得基础层图像数据和增强层图像数据;Decoding the base layer image code stream and the enhancement layer code stream to obtain base layer image data and enhancement layer image data;
    对基础层图像数据和增强层图像数据进行融合,以获得具有所述第二动态范围的第二影像;fusing the base layer image data and the enhancement layer image data to obtain a second image with the second dynamic range;
    提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。Extracting the image corresponding to the abnormally exposed area in the second image to obtain the processed image.
  25. 如权利要求24所述的图像处理装置,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The image processing apparatus according to claim 24, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    当所述第一影像中包括过度曝光区域时,对所述第二影像进行处理,以降低所述第二影像的亮度;或者,When the first image includes an overexposed area, processing the second image to reduce the brightness of the second image; or,
    当所述第一影像中包括欠曝光区域时,对所述第二影像进行处理,以提高所述第二影像的亮度;When the first image includes an underexposed area, processing the second image to improve the brightness of the second image;
    所述提取所述第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像,包括:提取所述处理后的第二影像中与所述曝光异常区域对应的影像,以获得所述处理影像。The extracting the image corresponding to the abnormal exposure area in the second image to obtain the processed image includes: extracting the image corresponding to the abnormal exposure area in the processed second image to obtain the processed image The processed image.
  26. 如权利要求25所述的图像处理装置,其特征在于,所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The image processing apparatus according to claim 25, wherein the processing at least the image of the abnormally exposed area to obtain the processed image comprises:
    当所述第一影像中包括过度曝光区域时,基于预设的映射函数,对第二影像进行处理,以降低第二影像的亮度;或者When the first image includes an overexposed area, processing the second image based on a preset mapping function to reduce the brightness of the second image; or
    当所述第一影像中包括欠曝光区域时,基于预设的映射函数,对第二影像进行处理,以提高第二影像的亮度。When the first image includes an underexposed area, the second image is processed based on a preset mapping function to improve the brightness of the second image.
  27. 如权利要求19所述的图像处理装置,其特征在于,The image processing apparatus according to claim 19, wherein:
    所述至少对所述曝光异常区域的影像进行处理,以获得处理影像,包括:The processing at least the image of the abnormally exposed area to obtain the processed image includes:
    获取影像码流数据,其中所述影像码流数据包括基础层图像码流和增强层码流;acquiring image code stream data, wherein the image code stream data includes a base layer image code stream and an enhancement layer code stream;
    对所述基础层图像码流进行解码,以获取基础层图像数据;Decoding the base layer image code stream to obtain base layer image data;
    对所述增强层码流进行解码,以获取增强层图像数据;Decoding the enhancement layer code stream to obtain enhancement layer image data;
    将所述曝光异常区域对应的基础层图像数据和所述曝光异常区域对应的增强层图像数据进行融合,以获得处理影像。The base layer image data corresponding to the abnormal exposure area and the enhancement layer image data corresponding to the abnormal exposure area are fused to obtain a processed image.
  28. 如权利要求19所述的图像处理装置,其特征在于,所述显示单元还用于:针对所述第一影像中的曝光异常区域,交替的显示所述第一影像中的曝光异常区域对应的影像以及所述处理影像和。19. The image processing apparatus according to claim 19, wherein the display unit is further configured to: for the abnormally exposed areas in the first image, alternately display the images corresponding to the abnormally exposed areas in the first image. images and the processed images and.
  29. 如权利要求20所述的图像处理装置,其特征在于,所述提示信息包括预设图案,在所述第一影像中的曝光异常区域以所述预设图案标识出;或者The image processing apparatus according to claim 20, wherein the prompt information includes a preset pattern, and an abnormally exposed area in the first image is identified by the preset pattern; or
    所述提示信息包括特定颜色,在所述第一影像中的曝光异常区域以特定颜色标识出。The prompt information includes a specific color, and the abnormally exposed area in the first image is marked with a specific color.
  30. 如权利要求19所述的图像处理装置,其特征在于,所述处理影像为高动态范围 图像,所述第一影像为标准动态范围图像。The image processing apparatus according to claim 19, wherein the processed image is a high dynamic range image, and the first image is a standard dynamic range image.
  31. 如权利要求23或24或27所述的图像处理装置,其特征在于,所述获取影像码流数据,包括:The image processing apparatus according to claim 23 or 24 or 27, wherein the acquiring the video code stream data comprises:
    获取原始图像数据,对所述原始图像数据做非线性图像变换处理得到待处理图像数据;Obtaining original image data, and performing nonlinear image transformation processing on the original image data to obtain image data to be processed;
    从所述待处理图像数据或所述原始图像数据中提取预设数据量的基本层图像数据;Extracting a preset amount of base layer image data from the to-be-processed image data or the original image data;
    基于第一预设编码规则对所述基本层图像数据进行编码,得到基本层图像码流;encoding the base layer image data based on the first preset encoding rule to obtain a base layer image code stream;
    基于所述待处理图像数据和所述基本层图像数据计算残差,并基于所述残差确定增强层图像数据;calculating a residual based on the to-be-processed image data and the base layer image data, and determining enhancement layer image data based on the residual;
    基于第二预设编码规则对所述增强层图像数据进行编码,得到增强层图像码流;encoding the enhancement layer image data based on the second preset encoding rule to obtain an enhancement layer image code stream;
    基于所述增强层图像码流和所述基本层图像码流生成所述影像码流数据。The video code stream data is generated based on the enhancement layer image code stream and the base layer image code stream.
  32. 如权利要求31所述的图像处理装置,其特征在于,所述基于所述待处理图像数据和所述基本层图像数据计算残差,包括:The image processing apparatus according to claim 31, wherein the calculating a residual based on the to-be-processed image data and the base layer image data comprises:
    获取预处理的基本层图像数据,其中,所述预处理的基本层图像数据包括对所述基本层图像码流解码后获得的基本层图像数据;acquiring preprocessed base layer image data, wherein the preprocessed base layer image data includes base layer image data obtained after decoding the base layer image code stream;
    基于所述待处理图像数据和所述预处理的基本层图像数据计算残差。A residual is calculated based on the image data to be processed and the preprocessed base layer image data.
  33. 根据权利要求32所述的图像处理装置,其特征在于,所述基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:The image processing apparatus according to claim 32, wherein the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data comprises:
    从所述待处理图像数据中减去所述预处理的基本层图像数据,得到所述残差。The preprocessed base layer image data is subtracted from the to-be-processed image data to obtain the residual.
  34. 根据权利要求33所述的图像处理装置,其特征在于,所述基于所述待处理图像数据和所述预处理的基本层图像数据计算所述残差,包括:The image processing apparatus according to claim 33, wherein the calculating the residual based on the to-be-processed image data and the preprocessed base layer image data comprises:
    将所述待处理图像数据所表示的动态范围与所述预处理的基本层图像数据所表示的动态范围进行对齐;Aligning the dynamic range represented by the image data to be processed and the dynamic range represented by the preprocessed base layer image data;
    通过所述待处理图像数据的动态范围与基本层图像数据的动态范围的比例,对对齐后的待处理图像数据进行补偿;Compensate the aligned to-be-processed image data according to the ratio of the dynamic range of the to-be-processed image data to the dynamic range of the base layer image data;
    从将补偿后的待处理图像数据中减去所述预处理的基本层图像数据,得到残差。The preprocessed base layer image data is subtracted from the to-be-processed image data to be compensated to obtain a residual.
  35. 根据权利要求31至34任一项所述的图像处理装置,其特征在于,所述基于所述残差确定增强层图像数据,包括:The image processing apparatus according to any one of claims 31 to 34, wherein the determining the enhancement layer image data based on the residual comprises:
    基于所述残差,得到待保留数据;Based on the residual, obtain the data to be retained;
    从所述待保留数据中选择保留数据,并作为所述增强层图像数据。Retain data is selected from the to-be-retained data and used as the enhancement layer image data.
  36. 根据权利要求35所述的图像处理装置,其特征在于,所述从所述待保留数据中选择保留数据,并作为所述增强层图像数据,包括:The image processing apparatus according to claim 35, wherein the selection of reserved data from the to-be-reserved data as the enhancement layer image data comprises:
    对所述保留数据进行调整,得到具有正整数数据的增强层图像数据。The reserved data is adjusted to obtain enhancement layer image data with positive integer data.
  37. 一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现1至18任一项所述的图像处理方法。A computer storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the image processing method described in any one of 1 to 18 is implemented.
PCT/CN2021/071514 2021-01-13 2021-01-13 Image processing method and apparatus, and storage medium WO2022151054A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/071514 WO2022151054A1 (en) 2021-01-13 2021-01-13 Image processing method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/071514 WO2022151054A1 (en) 2021-01-13 2021-01-13 Image processing method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2022151054A1 true WO2022151054A1 (en) 2022-07-21

Family

ID=82447719

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/071514 WO2022151054A1 (en) 2021-01-13 2021-01-13 Image processing method and apparatus, and storage medium

Country Status (1)

Country Link
WO (1) WO2022151054A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116277982A (en) * 2023-03-10 2023-06-23 深圳市纵维立方科技有限公司 Printing control method, photo-curing three-dimensional printer and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176010A1 (en) * 2001-03-16 2002-11-28 Wallach Bret A. System and method to increase effective dynamic range of image sensors
CN104052933A (en) * 2013-03-15 2014-09-17 聚晶半导体股份有限公司 Method for determining dynamic range mode, and image obtaining apparatus
CN107613218A (en) * 2017-09-15 2018-01-19 维沃移动通信有限公司 The image pickup method and mobile terminal of a kind of high dynamic range images
CN110493538A (en) * 2019-08-16 2019-11-22 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176010A1 (en) * 2001-03-16 2002-11-28 Wallach Bret A. System and method to increase effective dynamic range of image sensors
CN104052933A (en) * 2013-03-15 2014-09-17 聚晶半导体股份有限公司 Method for determining dynamic range mode, and image obtaining apparatus
CN107613218A (en) * 2017-09-15 2018-01-19 维沃移动通信有限公司 The image pickup method and mobile terminal of a kind of high dynamic range images
CN110493538A (en) * 2019-08-16 2019-11-22 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116277982A (en) * 2023-03-10 2023-06-23 深圳市纵维立方科技有限公司 Printing control method, photo-curing three-dimensional printer and readable storage medium

Similar Documents

Publication Publication Date Title
CN111263208B (en) Picture synthesis method and device, electronic equipment and storage medium
WO2018019206A1 (en) Systems and methods for changing operation modes of the optical filter of an imaging device
US9351002B2 (en) Image processing apparatus, image pickup apparatus, computer, image processing method and computer readable non-transitory medium
KR102385188B1 (en) Electronic device and method for processing image data in the electronic device
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
WO2016110188A1 (en) Method and electronic device for aesthetic enhancements of face in real-time video
CN107704798B (en) Image blurring method and device, computer readable storage medium and computer device
US8860840B2 (en) Light source estimation device, light source estimation method, light source estimation program, and imaging apparatus
WO2014174347A1 (en) Image processing method and apparatus and electronic device
US20140321739A1 (en) Image processing method and apparatus and electronic device
US20130236161A1 (en) Image processing device and image processing method
US9432574B2 (en) Method of developing an image from raw data and electronic apparatus
US10771754B2 (en) Image white balance correction method and electronic device
WO2022151054A1 (en) Image processing method and apparatus, and storage medium
US8934042B2 (en) Candidate image presenting method using thumbnail image and image signal processing device and imaging device performing the same
US20200106821A1 (en) Video processing apparatus, video conference system, and video processing method
CN107481199B (en) Image defogging method and device, storage medium and mobile terminal
US20150269423A1 (en) Image processing device, image processing method, program recording medium
WO2022151053A1 (en) Data processing method, apparatus and system, and computer storage medium
US20200294211A1 (en) Image display apparatus, image supply apparatus, and control method thereof
KR101871946B1 (en) Apparatus, method and program of image processing
JP2008067298A (en) Photography apparatus and program
JP2012175500A (en) Image processing method, control program, and image processing device
KR100686358B1 (en) Image improving system and method thereof
JP2016052081A (en) Imaging apparatus, and method and program for storing image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21918270

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21918270

Country of ref document: EP

Kind code of ref document: A1