WO2023173882A1 - 生成对数曲线的方法、设备和存储介质 - Google Patents

生成对数曲线的方法、设备和存储介质 Download PDF

Info

Publication number
WO2023173882A1
WO2023173882A1 PCT/CN2022/142068 CN2022142068W WO2023173882A1 WO 2023173882 A1 WO2023173882 A1 WO 2023173882A1 CN 2022142068 W CN2022142068 W CN 2022142068W WO 2023173882 A1 WO2023173882 A1 WO 2023173882A1
Authority
WO
WIPO (PCT)
Prior art keywords
curve
log
mobile device
scene
log curve
Prior art date
Application number
PCT/CN2022/142068
Other languages
English (en)
French (fr)
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 EP22896825.1A priority Critical patent/EP4274249A4/en
Publication of WO2023173882A1 publication Critical patent/WO2023173882A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/82Camera processing pipelines; Components thereof for controlling camera response irrespective of the scene brightness, e.g. gamma correction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • 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
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors

Definitions

  • the present application relates to the field of imaging technology, and in particular, to a method, device and storage medium for generating a logarithmic curve.
  • the logarithm (LOG) curve is a commonly used curve on digital camera equipment (such as various digital cameras).
  • the LOG curve reflects the mapping relationship between the light intensity in the scene and the brightness value recorded by the camera equipment.
  • the camera equipment converts the linear signal representing the light intensity output by the photosensitive element into a code value representing the brightness in the image data according to the LOG curve.
  • the present application provides a method, device and storage medium for generating a logarithmic curve, so as to provide a logarithmic curve suitable for mobile devices that can take pictures, and improve the user experience when taking pictures on mobile devices.
  • the first aspect of this application provides a method for generating a logarithmic curve, including:
  • the mobile device takes photos in LOG mode, the LOG curve is used to convert the original signal representing the brightness output by the photosensitive element into a coded value;
  • T_scene_reflection is greater than 0.0028:
  • T_scene_reflection is not greater than 0.0028:
  • T_scene_reflection is the scene reflectance
  • Y_cv is the normalized coding value
  • a logarithmic curve is designed that matches the performance of the mobile device's photosensitive element, so that the mobile device can fully utilize the performance of the mobile device's photosensitive element when shooting in LOG mode and improve the user experience.
  • the coding value corresponding to -6 levels is 128, -5
  • the encoding value corresponding to the file is 149
  • the encoding value corresponding to the -4 file is 184
  • the encoding value corresponding to the -3 file is 235
  • the encoding value corresponding to the -2 file is 302
  • the encoding value corresponding to the -1 file is 381,0 file
  • the corresponding coding value is 468
  • the coding value corresponding to the 1st gear is 560
  • the coding value corresponding to the 4th gear is 845
  • the coding value corresponding to the 5th gear is 942;
  • the scene reflectivity corresponding to level 0 is 18%.
  • the 8-bit encoding value determined according to the LOG curve is 24, the 10-bit encoding value determined according to the LOG curve is 95, and according to The IRE value determined by the LOG curve is 3.5%;
  • the 8-bit encoding value determined according to the LOG curve is 116
  • the 10-bit encoding value determined according to the LOG curve is 468
  • the IRE value determined according to the LOG curve is 46.1%
  • the 8-bit encoding value determined according to the LOG curve is 236, the 10-bit encoding value determined according to the LOG curve is 948, and the IRE value determined according to the LOG curve is 100.9%.
  • the method further includes:
  • T_scene_reflection 10 (Y_cv-0.6813)/0.3145 -0.0142;
  • T_scene_reflection (Y_cv-0.0928641)/11.4695.
  • Mobile devices can use the inverse LOG curve to convert LOG mode photos or videos into non-LOG mode photos or videos. Therefore, determining the inverse LOG curve can facilitate users to convert between photos or videos in different modes.
  • the mobile device stores a table representing the LOG curve, where the table includes multiple abscissas and corresponding ordinates on the LOG curve.
  • the data in the table can be used to quickly convert the encoding value without calculation, which helps to save the computing resources of the mobile device.
  • the mobile device stores a computer-executable function representing the LOG curve.
  • Storing LOG curves in the form of executable functions can reduce the storage resources required to store LOG curves.
  • the dynamic range of the photosensitive element of the mobile device is determined based on the number of identifiable light spots in the Raw image of the detection device captured by the mobile device.
  • the detection device displays multiple light spots of different brightness. light spot.
  • the color space corresponding to the LOG curve is the color space ITU-R BT.2020. That is to say, the color of the LOG mode photos or videos captured by the mobile device can be expressed in the color space ITU-R BT.2020.
  • the color space ITU-R BT.2020 contains most of the colors within the range that the human eye can recognize. Therefore, using the color space ITU-R BT.2020 to express colors can obtain a more colorful LOG mode. Photo or video.
  • a second aspect of the application provides an electronic device, including a memory and one or more processors;
  • the memory is used to store computer programs
  • the one or more processors are configured to execute the computer program, and are specifically configured to implement the method for generating a logarithmic curve provided in any one of the first aspects of this application.
  • a third aspect of this application provides a computer storage medium for storing a computer program.
  • the computer program When executed, it is specifically used to implement the method for generating a logarithmic curve provided in any one of the first aspects of this application.
  • Embodiments of the present application provide a method, device, and storage medium for generating a logarithmic curve.
  • the method includes: determining the dynamic range of the photosensitive element of the mobile device and the encoding depth of the mobile device; obtaining multiple numerical points within the dynamic range, and the numerical points Including files within the dynamic range and corresponding encoding values; curve fitting is performed based on multiple numerical points to obtain a LOG curve.
  • the LOG curve is used to convert the original signal representing the brightness output by the photosensitive element. is the coded value.
  • this solution can obtain a LOG curve that meets the performance of the mobile device's photosensitive element, which helps to fully utilize the capabilities of the mobile device's photosensitive element during photography.
  • Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a system configured with a logarithmic curve provided by an embodiment of the present application
  • Figure 3 is a flow chart of a method for generating a logarithmic curve provided by an embodiment of the present application
  • Figure 4 is a schematic diagram of a logarithmic curve provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of another logarithmic curve provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of an antilog curve provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a color space suitable for LOG mode provided by an embodiment of the present application.
  • one or more refers to one, two or more than two; "and/or” describes the association relationship of associated objects, indicating that three relationships can exist; for example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural.
  • the character "/" generally indicates that the related objects are in an "or” relationship.
  • the embodiment of the present application provides an electronic device 100, as shown in Figure 1, which may specifically include: a processor 110, an external memory 120, an internal memory (also called “memory”) 121, a universal serial bus, USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D , sensor module 180, button 190, motor 191, indicator 192, camera 193, screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a communication processor (communication processor, CP, also called a modem), a graphics processor (graphics processor) processing unit, GPU), etc.
  • application processor application processor, AP
  • communication processor communication processor
  • CP communication processor
  • graphics processor graphics processor
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • the camera 193 may include one or more cameras.
  • the camera 193 may include one or more rear cameras installed on the back of the electronic device, and one or more rear cameras installed on the front of the electronic device (the side where the screen is located is the front). Front camera.
  • Screen 194 may contain one or more screens. Electronic devices display videos, images, and a series of graphical user interfaces through screens. In some embodiments, the screen 194 can be combined with the touch sensor 180K to form a touch screen, and the user can interact with the electronic device by clicking or sliding on the touch screen (with a finger or a stylus).
  • the audio playback device connected to the electronic device 100 may be a wired headset inserted into the headphone interface 170D of the electronic device, or may be a Bluetooth headset, a Bluetooth speaker, and other devices that are communicatively connected to the electronic device through the wireless communication module 160 of the electronic device.
  • the camera 193 includes a photosensitive element, which may be a Complementary Metal-Oxide-Semiconductor (CMOS) sensor or a Charge-coupled Device (CCD).
  • CMOS Complementary Metal-Oxide-Semiconductor
  • CCD Charge-coupled Device
  • the internal memory stores preconfigured LOG curves of the electronic device 100 .
  • the processor When the electronic device 100 takes pictures (referring to taking photos or recording videos) in LOG mode, the processor receives the original signal output by the camera indicating the light intensity (ie, brightness), and then calls the LOG curve of the internal memory to convert the original signal into the corresponding Encode the value to obtain a photo or video in LOG mode.
  • the light intensity ie, brightness
  • the advantage of shooting in LOG mode is that the original signal with corresponding weak light intensity can be encoded into a mid-tone encoding value, so the photos or videos in LOG mode are more in line with the human eye's LOG response to light.
  • the rule is that it is often more sensitive to dark details and less sensitive to bright details, maximizing the retention of dark information in photos or videos.
  • Electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different component configuration.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the electronic device may be a user equipment (UE), for example, it may be a mobile terminal (such as a user's mobile phone), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a netbook, or a personal digital assistant. (personal digital assistant, PDA) and other equipment.
  • UE user equipment
  • PDA personal digital assistant
  • the photosensitive elements of different camera equipment usually have different dynamic ranges.
  • the dynamic range of the photosensitive elements of special camera equipment such as digital cameras can reach 16 stops (stops) or higher, while the dynamic range of mobile devices such as mobile phones and tablet computers can reach 16 stops or higher.
  • the camera's photosensitive element has a smaller dynamic range, generally only about 11 stops.
  • the dynamic range of the photosensitive element can be understood as the range from the lower limit to the upper limit of the brightness that the photosensitive element can feel when shooting a frame of image.
  • the dynamic range can be measured in steps. For each step difference, the brightness difference is doubled, that is, the brightness of the 1st gear is twice the brightness of the 0th gear, and the brightness of the 2nd gear is twice the brightness of the 1st gear. That is to say, in a frame of images captured by special camera equipment such as digital cameras, the highest brightness can reach a maximum of 2.16 times the lowest brightness. In a frame of images captured by mobile devices such as mobile phones, the highest brightness can reach a maximum of 2.16 times the lowest brightness. About 2 11 times.
  • this application provides a method for generating a logarithmic curve, and a logarithmic curve generated based on this method and suitable for mobile devices.
  • the logarithmic curve generated by the solution of this application can adapt to the dynamic range of the mobile device, so that when the mobile device takes pictures based on the logarithmic curve, it can obtain better photos or videos.
  • This embodiment of the present application provides a system for configuring a logarithmic curve of a mobile device.
  • This system includes a host computer 201, a mobile device 202 and a detection device 203.
  • the structure of the mobile device 202 may refer to the electronic device 100 shown in FIG. 1 .
  • the host computer 201 and the mobile device 202 are connected.
  • the detection device 203 includes one or more light-emitting devices. After the detection device is started, the light-emitting devices can form multiple light spots of different brightnesses arranged in sequence on the detection device. The brightness of each light spot is one step different from the brightness of its adjacent light spots. , for example, the brightness of the second light spot is 2 times the brightness of the first light spot, the brightness of the third light spot is 2 times the brightness of the second light spot, and so on.
  • the mobile device 202 takes a photo of the detection device and obtains a Raw image of the detection device.
  • Raw images namely images in Raw format
  • a Raw image can be understood as raw data in which the camera's photosensitive element converts the captured brightness signal into a digital signal.
  • a RAW file records the original signal of the photosensitive element in a linear manner, and also records some metadata (Meta data) generated by the shooting, such as ISO (International Organization for Standardization, International Organization for Standardization) settings, shutter speed , aperture value, white balance, etc.) files.
  • Raw format is a format that has not been processed by ISP non-linearity and has not been compressed. The full name of Raw format is RAW Image Format.
  • the mobile device 202 uploads the Raw image of the detection device to the host computer 201, and the tester can view the Raw image of the detection device through the dedicated software on the host computer 201.
  • the number of identifiable light spots on the Raw image of the detection device reflects the dynamic range of the photosensitive element of the mobile device 202 . For example, if up to 11 light spots can be identified from the brightest to the darkest in the Raw image of the detection device, it can be considered that the dynamic range of the photosensitive element of the mobile device 202 is 11 stops.
  • the encoding values corresponding to the binning within the dynamic range can be set based on the balance between sensitivity and dynamic range, as well as the strategic preferences of mobile devices for shooting highlights and low lights.
  • the host computer 201 executes a curve fitting algorithm based on these data to calculate a LOG curve suitable for the mobile device 202.
  • the host computer 201 After generating the LOG curve, the host computer 201 writes the LOG curve into the mobile device 202 .
  • the mobile device 202 can use the LOG curve to convert the original brightness signal output by the camera into a non-linear coded value.
  • inventions of the present application provide a method for generating a logarithmic curve. Please refer to Figure 3.
  • the method may include the following steps.
  • the host computer 201 can execute preset computer instructions to implement various steps in the method of this implementation.
  • the dynamic range of the photosensitive element can be pre-calibrated by the manufacturer. It can also be obtained by taking the Raw image test of the detection device using the system shown in Figure 2.
  • the advantage of detecting the dynamic range by shooting the Raw image of the detection device is that a more accurate dynamic range of the photosensitive element can be obtained, making the generated LOG curve more consistent with the performance of the photosensitive element.
  • Coding depth also known as bit depth, represents the number of bits occupied by a coding value representing brightness in a mobile device.
  • bit depth represents the number of bits occupied by a coding value representing brightness in a mobile device.
  • a common bit depth for mobile devices can be 10 bits, which means that in the photos or videos taken by the mobile device, an encoding value representing brightness will occupy 10 bits.
  • the encoding depth of the mobile device determines the range of the encoding value of the mobile device. For example, if the encoding depth is 8 bits, the encoding value range of the mobile device is [0,255]; if the encoding depth is 10 bits, the encoding value range of the mobile device is [0,1023].
  • step S301 determines whether the dynamic range determined in step S301 is an integer, it can be rounded to perform subsequent steps.
  • Step S302 is equivalent to determining the encoding values corresponding to different levels of brightness within the dynamic range of the photosensitive element of the mobile device.
  • step S302 first, the 0 level can be used as a benchmark, and the dynamic range of the photosensitive element can be divided into several levels above the 0 level and several levels below the 0 level, and then corresponding encoding values can be set for several of the levels. , multiple numerical points can be obtained.
  • the encoding value can be set based on the dynamic range of the photosensitive element in step S301, the encoding depth and exposure strategy preference of the mobile device, and related experience values. This embodiment does not limit the specific setting method.
  • the coding value corresponding to the highest level of brightness in the dynamic range can be close to the upper limit of the coding value range
  • the coding value corresponding to the lowest level of brightness can be close to the lower limit of the coding value range
  • the coding value corresponding to level 0 can be Set in the middle of the encoding value range.
  • the dynamic range of 11 stops can be divided as follows: 5 stops can be set above the 0 stop, and 6 stops can be set below the 0 stop, that is, the dynamic range of the photosensitive element can be divided according to the upper 5 stops and the lower 6 stops. scope.
  • dynamic range division method can be adjusted according to the application scenarios and requirements of different mobile devices.
  • the above division method is only an example.
  • the encoding values of the darkest point and the brightest point can be further set according to the encoding depth. Taking the encoding depth of 10 bits as an example, the encoding value of the darkest point can be set to 95, and the encoding value of the brightest point can be set to 942.
  • the darkest point represents the pixel with the lowest brightness in the image, and the brightest point represents the pixel with the highest brightness in the image.
  • Stop represents the files within the dynamic range
  • Code Value (abbreviated as CV) represents the coding value corresponding to each file.
  • CV Code Value
  • the numerical points shown in Table 1 are only an exemplary setting.
  • the encoding value corresponding to each gear in the dynamic range can be adjusted within a certain range.
  • the encoding value corresponding to gear 0 can be in the middle section of [0,1023], that is, in the range of 300 to 500. Adjustment.
  • the set files are not limited to Table 1.
  • the encoding value corresponding to the -3 file may be set instead.
  • LOG curve can be expressed by formula (1) in the following form:
  • a, b, c and d are parameters that need to be determined through curve fitting, and y and x represent the ordinate and abscissa of the curve.
  • step S303 the encoding values of several levels set in S302 and the corresponding scene reflectance are input into the curve fitting software in the host computer 201, and the function shown in formula (1) is designated as the fitting function, and then A, b, c and d in formula (1) can be calculated through curve fitting software. Once the parameters a, b, c and d are determined, it is equivalent to generating a LOG curve.
  • the curve fitting process can be implemented using any curve fitting software in the relevant technical field, and this embodiment is not limited to this.
  • T_scene_reflection is the scene reflectance
  • Stop represents the number of gears
  • 0.18 is the scene reflectance corresponding to gear 0.
  • the brightness of the light received by the photosensitive element can be expressed by the scene reflectance.
  • the coded values in the set numerical points can also be converted into normalized coded values (denoted as Y_cv) before performing curve fitting. That is to say, when performing curve fitting, the normalized encoding value is used as the dependent variable and the scene reflectance is used as the independent variable.
  • the value range of the normalized encoding value is [0, 1]. Divide the encoding value by the upper limit of the encoding value at the corresponding encoding depth to get the corresponding normalized encoding value. Conversely, multiply the normalized encoding value by the upper limit of the encoding value at a specific encoding depth to get the encoding depth. The encoding value corresponding to the normalized encoding value.
  • the coding value 468 corresponds to a normalized coding value of 468/1023, which is 0.45748.
  • a normalized coding value of 0.3 corresponds to a coding value of 10 bits, which is 0.3*1023, or 536. (Keep the integer part).
  • T_scene_reflection is greater than 0.0028:
  • T_scene_reflection is not greater than 0.0028:
  • the curve corresponding to formula (3) is the LOG curve generated based on the numerical points set in Table 1.
  • the form of the LOG curve can be seen in Figure 4.
  • the applicable range of the LOG curve can be expanded, so that a LOG curve can be applied to other devices with similar dynamic range but different encoding depths.
  • the LOG curve generated with the normalized encoding value as the ordinate can be directly applied to two devices with different encoding depths but the same dynamic range of the photosensitive elements without adjustment.
  • the LOG curve can be represented by a variety of different abscissas and ordinates, and is not limited to the scene reflectance and normalized encoding values shown in Figure 4.
  • the ordinate of the LOG curve can be IRE, the code value (Code Value, CV) at an 8-bit coding depth, or the code value at a 10-bit coding depth.
  • IRE is a unit in video measurement, used to express the brightness level in the video signal.
  • the full name of IRE is Institute of Radio Engineers. Please refer to Table 2.
  • Table 2 lists the values of the above ordinate corresponding to the scene reflectivity of 0%, 18% (ie 0.18) and 600% in the LOG curve shown in formula (3).
  • the LOG curve shown in Figure 4 with the scene reflectance as the abscissa and the normalized encoding value as the ordinate can also be converted into the LOG curve shown in Figure 5 with stop as the abscissa and 10-bit encoding depth.
  • the encoding value is the LOG curve of the ordinate.
  • the generated logarithmic curve can be written by the host computer to the corresponding mobile device and stored in the memory of the mobile device.
  • mobile devices can store logarithmic curves in different forms.
  • the mobile device can store the generated logarithmic curve in the form of a table.
  • the table includes multiple points on the logarithmic curve. Each point includes a value representing brightness and the corresponding value of the brightness in the logarithmic curve. Encoded value.
  • the mobile device can look up the corresponding brightness encoding value in the table based on the original signal output by the camera's photosensitive element, thereby obtaining photos or videos in LOG mode.
  • the advantage of storing LOG curves in table form is that there is no need to calculate the corresponding encoding value when shooting in LOG mode, saving computing resources on mobile devices.
  • the mobile device may store the logarithmic curve in the form of a computer-executable function, including the values of a, b, c, and d shown in formula (1).
  • the mobile device can call this function to calculate the original signal output by the camera's photosensitive element and obtain the corresponding encoding value.
  • Storing logarithmic curves in the form of executable functions can reduce the storage space occupied by logarithmic curves.
  • LOG mode photos or videos can retain more dark information, but the contrast is lower. Therefore, after shooting, LOG mode photos or videos often need to be post-processed. You need to convert photos or videos in LOG mode to photos or videos in non-LOG mode.
  • the mobile device can pre-store the antilog curve.
  • the abscissa of the antilog curve represents the encoding value, and the ordinate represents the brightness.
  • the mobile device can convert the LOG mode photos or videos according to the antilog curve.
  • the encoded value in is restored to the original signal representing brightness, and then converted based on the original signal representing brightness to obtain a non-LOG mode photo or video.
  • the antilog curve i.e., the inverse LOG curve
  • the logarithmic curve shown in formula (3) can be expressed by the following formula (4):
  • T_scene_reflection 10 (Y_cv-0.6813)/0.3145 -0.0142
  • T_scene_reflection (Y_cv-0.0928641)/11.4695
  • the abscissa and ordinate of the antilog curve stored by the mobile device can also be adjusted according to the situation, and the mobile device can also store the antilog curve in the form of a table or an executable function.
  • a LOG curve is generated that conforms to the characteristics of the mobile device, so that when the mobile device takes pictures in LOG mode, it can maximize the use of the dynamic range of the photosensitive element, which is conducive to preservation in photos and videos in LOG mode. Details in shadows and highlights.
  • a mobile device When a mobile device takes pictures in LOG mode, it can select any color space according to requirements and hardware performance. This embodiment does not limit the color space used in LOG mode. For example, when a mobile device takes pictures in LOG mode, the color space ITU-R BT.2020 can be used.
  • FIG. 7 for a schematic diagram of the color space ITU-R BT.2020.
  • the area 701 surrounded by irregular curves in Figure 7 represents the color range that can be recognized by the human eye
  • the triangular area 702 represents the color range that can be represented by the color space ITU-R BT.2020.
  • the three vertices 710, 711 and 712 of the triangular area represent pure green, pure blue and pure red in sequence, and the point 713 within the triangular area represents white.
  • the coordinates of the above points in Figure 7 can be found in Table 3 below.
  • the color space ITU-R BT.2020 can represent most of the colors that can be recognized by the human eye. Based on the color space ITU-R BT.2020, photos or videos with richer colors can be obtained.
  • An embodiment of the present application provides an electronic device, including a memory and one or more processors.
  • Memory is used to store computer programs.
  • One or more processors are used to execute a computer program, specifically to implement the method for generating a logarithmic curve provided in any embodiment of the present application.
  • the above-mentioned electronic device may be the host computer 201 in the system shown in FIG. 2 .
  • Embodiments of the present application also provide a computer storage medium for storing a computer program.
  • the computer program When executed, it is specifically used to implement the method for generating a logarithmic curve provided by any embodiment of the present application.
  • the computer storage medium mentioned above may be a storage medium in the host computer 201 in the system shown in FIG. 2 .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

本申请实施例提供一种生成对数曲线的方法、设备和存储介质,方法包括:确定移动设备的感光元件的动态范围和移动设备的编码深度;获得动态范围内的多个数值点,数值点包括动态范围内的档和对应的编码值;根据多个数值点进行曲线拟合,得到LOG曲线,在移动设备以LOG模式摄像时,LOG曲线用于将感光元件输出的表示亮度的原始信号转换为编码值。本方案通过检测移动设备感光元件的动态范围并据此生成对数曲线,可以获得符合移动设备感光元件性能的LOG曲线,有助于摄像时充分发挥移动设备感光元件的能力。

Description

生成对数曲线的方法、设备和存储介质
本申请要求在2022年3月15日提交中华人民共和国国家知识产权局,申请号为202210255727.9,发明名称为“生成对数曲线的方法、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及摄像技术领域,尤其涉及一种生成对数曲线的方法、设备和存储介质。
背景技术
对数(Logarithm,LOG)曲线,是数字式的摄像设备(如各类数码相机)上常用的曲线,LOG曲线反映了场景中光照强度和摄像设备记录的亮度值之间的映射关系。摄像时,摄像设备根据LOG曲线将感光元件输出的表示光照强度的线性信号转换为图像数据中表示亮度的编码值(code value)。
目前的对数曲线大多针对专用摄像设备,如数码相机设计。而由于专用摄像设备和通用的移动设备之间感光元件能力的差异,专用摄像设备的LOG曲线不适用于移动设备。
发明内容
本申请提供了一种生成对数曲线的方法、设备和存储介质,以提供一种适用于可拍照的移动设备的对数曲线,改善移动设备摄像时的用户体验。
为了实现上述目的,本申请提供了以下技术方案:
本申请第一方面提供一种生成对数曲线的方法,包括:
确定移动设备的感光元件的动态范围和所述移动设备的编码深度;
获得所述动态范围内的多个数值点,所述数值点包括所述动态范围内的档和对应的编码值;
根据多个所述数值点进行曲线拟合,得到LOG曲线,在所述移动设备以LOG模式摄像时,所述LOG曲线用于将所述感光元件输出的表示亮度的原始信号转换为编码值;
以场景反射率为横坐标,归一化编码值为纵坐标时,所述LOG曲线的公式为:
若T_scene_reflection大于0.0028:
Y_cv=0.3145×log 10(5.555556×T_scene_reflection+0.07907)+0.4471;
若T_scene_reflection不大于0.0028:
Y_cv=11.4695×T_scene_reflection+0.0928641;
其中,T_scene_reflection为所述场景反射率,Y_cv为所述归一化编码值。
本方案的有益效果在于:
根据移动设备感光元件的动态范围,设计符合移动设备感光元件性能的对数曲线,使得移动设备在LOG模式下摄像时能够充分发挥移动设备的感光元件的性能,改善用户的使用体验。
在一些可选的实施例中,所述移动设备的编码深度为10比特,且所述动态范围为11档时,所述多个数值点中,-6档对应的编码值为128,-5档对应的编码值为149,-4档对 应的编码值为184,-3档对应的编码值为235,-2档对应的编码值为302,-1档对应的编码值为381,0档对应的编码值为468,1档对应的编码值为560,2档对应的编码值为654,3档对应的编码值为749,4档对应的编码值为845,5档对应的编码值为942;
其中,0档对应的场景反射率为18%。
在一些可选的实施例中,所述场景反射率为0%时,根据所述LOG曲线确定的8比特的编码值为24,根据所述LOG曲线确定的10比特的编码值为95,根据所述LOG曲线确定的IRE值为3.5%;
所述场景反射率为18%时,根据所述LOG曲线确定的8比特的编码值为116,根据所述LOG曲线确定的10比特的编码值为468,根据所述LOG曲线确定的IRE值为46.1%;
所述场景反射率为600%时,根据所述LOG曲线确定的8比特的编码值为236,根据所述LOG曲线确定的10比特的编码值为948,根据所述LOG曲线确定的IRE值为100.9%。
在一些可选的实施例中,所述根据多个所述数值点进行曲线拟合,得到LOG曲线之后,还包括:
确定所述LOG曲线对应的反LOG曲线;
以场景反射率为纵坐标,归一化编码值为横坐标时,所述反LOG曲线的公式为:
若Y_cv大于0.1251:
T_scene_reflection=10 (Y_cv-0.6813)/0.3145-0.0142;
若Y_cv不大于0.1251:
T_scene_reflection=(Y_cv-0.0928641)/11.4695。
本实施例的有益效果在于:
移动设备可以利用反LOG曲线,将LOG模式的照片或视频转换为非LOG模式的照片或视频,因此,确定反LOG曲线可以方便用户在不同模式的照片或视频间转换。
在一些可选的实施例中,所述移动设备存储表示所述LOG曲线的表格,所述表格包括所述LOG曲线上的多个横坐标和对应的纵坐标。
本实施例的有益效果在于:
当移动设备在LOG模式下摄像时,可以利用表格中的数据快速的转换出编码值而无须进行计算,有助于节约移动设备的计算资源。
在一些可选的实施例中,所述移动设备存储表示所述LOG曲线的计算机可执行函数。
本实施例的有益效果在于:
以可执行函数的形式存储LOG曲线,可以减少存储LOG曲线所需的占用的存储资源。
在一些可选的实施例中,所述移动设备的感光元件的动态范围,根据所述移动设备拍摄的检测装置的Raw图像中可识别的光斑数量确定,所述检测装置显示多个不同亮度的光斑。
在一些可选的实施例中,所述LOG曲线对应的色彩空间为色彩空间ITU-R BT.2020。也就是说,当移动设备拍摄得到的LOG模式的照片或视频的颜色可以用色彩空间ITU-R BT.2020表示。
本实施例的有益效果在于:
与其他色彩空间相比,色彩空间ITU-R BT.2020包含人眼可识别范围内的绝大部分颜 色,因此使用色彩空间ITU-R BT.2020表示颜色,可以获得色彩更丰富的LOG模式的照片或视频。
本申请第二方面提供一种电子设备,包括存储器和一个或多个处理器;
所述存储器用于存储计算机程序;
所述一个或多个处理器用于执行所述计算机程序,具体用于实现本申请第一方面任意一项所提供的生成对数曲线的方法。
本申请第三方面提供一种计算机存储介质,用于存储计算机程序,所述计算机程序被执行时,具体用于实现本申请第一方面任意一项所提供的生成对数曲线的方法。
本申请实施例提供一种生成对数曲线的方法、设备和存储介质,方法包括:确定移动设备的感光元件的动态范围和移动设备的编码深度;获得动态范围内的多个数值点,数值点包括动态范围内的档和对应的编码值;根据多个数值点进行曲线拟合,得到LOG曲线,在移动设备以LOG模式摄像时,LOG曲线用于将感光元件输出的表示亮度的原始信号转换为编码值。本方案通过检测移动设备感光元件的动态范围并据此生成对数曲线,可以获得符合移动设备感光元件性能的LOG曲线,有助于摄像时充分发挥移动设备感光元件的能力。
附图说明
图1为本申请实施例提供的一种电子设备的结构示意图;
图2为本申请实施例提供的一种配置对数曲线的***的结构示意图;
图3为本申请实施例提供的一种生成对数曲线的方法的流程图;
图4为本申请实施例提供的一种对数曲线的示意图;
图5为本申请实施例提供的另一种对数曲线的示意图;
图6为本申请实施例提供的一种反对数曲线的示意图;
图7为本申请实施例提供的一种适用于LOG模式的色彩空间的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
本申请实施例提供一种电子设备100,如图1所示,其具体可以包括:处理器110,外部存储器120,内部存储器(也称“内存”)121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,屏幕194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180 可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),通信处理器(communication processor,CP,也可以称为调制解调器),图形处理器(graphics processing unit,GPU)等。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
摄像头193可以包括一个或多个摄像头,例如,摄像头193可以包括安装于电子设备背面的一个或多个后置摄像头,以及安装于电子设备正面(以屏幕所在的一面为正面)的一个或多个前置摄像头。
屏幕194可以包含一个或多个屏幕。电子设备通过屏幕显示视频,图像以及一系列图形用户界面。在一些实施例中,屏幕194可以和触摸传感器180K组合为触摸屏,用户可以通过(用手指或触控笔)在触摸屏上点击或者滑动的方式和电子设备交互。
其中,电子设备100连接的音频播放设备,可以是***电子设备的耳机接口170D的有线耳机,也可以是通过电子设备的无线通信模块160和电子设备通信连接的蓝牙耳机、蓝牙音箱等设备。
摄像头193包括感光元件,感光元件可以是互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)传感器,或者电荷耦合器件(Charge-coupled Device,CCD)。感光元件受到环境光照射时会产生表示光照强度的线性的原始信号,表示光照强度的原始信号经处理器转换得到的编码值,就是电子设备100拍摄得到的图像数据。
内部存储器存储有预先配置的电子设备100的LOG曲线。
当电子设备100在LOG模式下摄像(指拍照或录视频)时,处理器接收摄像头输出的表示光照强度(即亮度)的原始信号,然后调用内部存储器的LOG曲线,将原始信号转换为对应的编码值,从而获得LOG模式的照片或视频。
与非LOG模式相比,在LOG模式下摄像的好处在于,可以将对应的光照强度较弱的原始信号编码为中间调的编码值,因此LOG模式的照片或视频更符合人眼对光线LOG感应规则,即对暗部细节往往更敏感,而对亮部细节则感知较不敏感,最大化的保留照片或视频中暗部的信息。
以上是以电子设备100为例对本申请实施例作出的具体说明。应该理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件.软件.或硬件和软件的组合中实现。
本申请实施例提供的电子设备可以是用户设备(user equipment,UE),例如可以为移动终端(例如用户手机)、平板电脑、桌面型、膝上型笔记本电脑、手持计算机、上网本、个 人数字助理(personal digital assistant,PDA)等设备。
不同的摄像设备的感光元件通常具有不同的动态范围,比如,数码相机等专用的摄像设备,其感光元件的动态范围可以达到16档(stops)或更高,而手机和平板电脑等移动设备的摄像头的感光元件则具有较小的动态范围,一般只有11档左右。
感光元件的动态范围,可以理解为,拍摄一帧图像时,感光元件能感受到的亮度下限到上限的范围。动态范围可以用档来计量,每差一档,则亮度差一倍,即1档的亮度为0档的亮度的两倍,2档的亮度又为1档的亮度的两倍。也就是说,数码相机等专用摄像设备拍摄出的一帧图像中,最高亮度最大可以达到最低亮度的2 16倍,而手机等移动设备拍摄出的一帧图像中,最高亮度最大可以达到最低亮度的2 11倍左右。
由于动态范围的差异,直接将专用摄像设备的LOG曲线应用在移动设备上,无法充分发挥移动设备的感光元件的性能,导致拍摄出的照片和视频的效果不好。
针对上述问题,本申请提供了一种生成对数曲线的方法,以及基于该方法生成的适用于移动设备的对数曲线。通过本申请的方案生成的对数曲线,能够适配移动设备的动态范围,使得移动设备基于该对数曲线摄像时,获得效果更好的照片或视频。
本申请实施例提供了一种用于配置移动设备的对数曲线的***,请参见图2,本***包括上位机201,移动设备202和检测装置203。移动设备202的结构可以参见图1所示的电子设备100。上位机201和移动设备202连接。
检测装置203包括一个或多个发光器件,检测装置启动后,发光器件可以在检测装置上形成顺序排列的多个不同亮度的光斑,每一个光斑的亮度都与其相邻的光斑的亮度差一档,例如,第二个光斑的亮度为第一个光斑的亮度的2倍,第三个光斑的亮度为第二个光斑的亮度的2倍,以此类推。
在检测装置启动后,移动设备202对检测装置拍照,获得检测装置的Raw图像。
Raw图像,即Raw格式的图像,是指未经加工图像。进一步地,Raw图像可以理解为,摄像头的感光元件将捕捉到的亮度信号转化为数字信号的原始数据。RAW文件是一种以线性的方式记录了感光元件的原始信号,同时记录了由拍摄所产生的一些元数据(Meta data,如感光度ISO(InternationalOrganization for Standardization,国际标准化组织)的设置、快门速度、光圈值、白平衡等)的文件。Raw格式是未经ISP非线性处理、也未经压缩的格式。Raw格式的全称是RAW Image Format。
移动设备202将检测装置的Raw图像上传到上位机201,测试人员可以通过上位机201上专用的软件查看检测装置的Raw图像。而检测装置的Raw图像上可识别的光斑的数量,就反映了移动设备202的感光元件的动态范围。例如,若检测装置的Raw图像上,从最亮到最暗最多可识别出11个光斑,则可以认为移动设备202的感光元件的动态范围为11档。
确定动态范围后,可以根据感光度和动态范围的平衡,以及根据移动设备拍摄高光及暗光的策略偏好来设定动态范围内部分档对应的编码值。
设定好的编码值和对应的档输入到上位机201后,上位机201根据这些数据执行曲线拟合算法,即可计算得到适合移动设备202的LOG曲线。
生成LOG曲线后,上位机201将LOG曲线写入移动设备202。当移动设备202在LOG模式下摄像时,移动设备202就可以利用LOG曲线将摄像头输出的亮度的原始信号转换为 非线性的编码值。
基于图2所示的***,本申请实施例提供了一种生成对数曲线的方法,请参见图3,该方法可以包括如下步骤。
在一些可选的实施例中,上位机201可以执行预设的计算机指令,从而实现本实施的方法中的各个步骤。
S301,确定移动设备的感光元件的动态范围和移动设备的编码深度。
感光元件的动态范围,可以使用生产厂商预先标定好的数值。也可以利用图2所示的***,通过拍摄检测装置的Raw图像测试得到。
通过拍摄检测装置的Raw图像检测动态范围的好处在于,可以获得感光元件更准确的动态范围,使得生成的LOG曲线更符合感光元件的性能。
编码深度,又称bit深度,表示移动设备中一个表示亮度的编码值所占用的比特数。作为一个示例,移动设备常见的bit深度可以为10比特(bit),表示该移动设备拍摄的照片或视频中,一个表示亮度的编码值会占用10个bit。
移动设备的编码深度,决定了移动设备的编码值的取值范围。例如,若编码深度为8bit,则该移动设备的编码值的取值范围为[0,255],若编码深度为10bit,则该移动设备的编码值的取值范围为[0,1023]。
需要说明,若步骤S301中确定的动态范围不为整数,可以将其取整以便执行后续步骤。
示例性的,若S301中确定移动设备的动态范围为10,6档,后续步骤可以按动态范围为11档来执行。
S302,获得动态范围内的多个数值点。
数值点,可以理解为动态范围内,不同档的亮度和编码值的对应关系。步骤S302,相当于确定移动设备的感光元件的动态范围内,不同档的亮度分别对应多大的编码值。
在步骤S302中,首先可以将0档作为基准,在将感光元件的动态范围划分为0档以上的若干档,以及0档以下的若干档,然后针对其中的几个档设定对应的编码值,即可得到多个数值点。
编码值的设定可以以步骤S301中感光元件的动态范围,移动设备的编码深度和曝光策略偏好,以及相关的经验值来设定。本实施例对具体的设定方法不做限定。
一般的,动态范围内最高档的亮度对应的编码值可以接近编码值取值范围的上限,最低档的亮度对应的编码值可以接近编码值取值范围的下限,0档对应的编码值则可以设定在编码值取值范围的中间段内。
作为一个示例,11档的动态范围可以按如下方式划分:在0档以上可以设置5档,0档之下可以设置6个档,即按上5档,下6档的方式划分感光元件的动态范围。
需要说明,对动态范围的划分方式可以根据不同移动设备的应用场景和需求而调整,以上划分方式仅为一种示例。
完成动态范围的划分后,可以进一步根据编码深度设定最暗点和最亮点的编码值。以编码深度10bit为示例,最暗点的编码值可以设定为95,最亮点的编码值可以设定为942。最暗点表示图像中亮度最低的像素点,最亮点表示图像中亮度最高的像素点。
基于上5档,下6档,以及上述最暗点和最亮点的编码值,可以设定如表1所示的5 个数值点。表1中Stop表示动态范围内的档,Code Value(缩写为CV)表示每一档对应的编码值。例如,-6档对应的编码值为128,0档对应的编码值为468,5档对应的编码值为942。
表1
Stop -6 -5 -4 -3 -2 -1
CodeValue 128 149 184 235 302 381
Stop 0 1 2 3 4 5
CodeValue 468 560 654 749 845 942
可以理解,表1所示的数值点仅为一种示例性的设置。在一些可选的实施例中,动态范围内各档对应的编码值可以在一定范围内调整,例如0档对应的编码值可以在[0,1023]的中间段,即在300到500范围内调整。并且,设定的档也不限于表1,例如,也可以不设定-4档对应的编码值,而改为设定-3档的编码值。
表1中,动态范围内的最低档(即-6档)的编码值高于前述最暗点的编码值,这样设定的作用在于:
可以提高屏幕上显示的LOG模式的照片和视频中暗部的亮度,使得LOG模式的照片和视频在屏幕上显示时,能够呈现更多暗部的细节。
S303,根据多个数值点进行曲线拟合,得到LOG曲线。
一般的,LOG曲线可以用如下形式的公式(1)表示:
y=a×log 10(b×x+c)+d
其中a,b,c和d为需要通过曲线拟合确定的参数,y和x表示曲线的纵坐标和横坐标。
在步骤S303中,将S302中设定的若干档的编码值和对应的场景反射率输入上位机201中的曲线拟合软件,并将公式(1)所示的函数指定为拟合函数,就可以通过曲线拟合软件计算得到公式(1)中的a,b,c和d,确定了参数a,b,c和d,就相当于生成了一条LOG曲线。
曲线拟合的过程可以利用相关技术领域中任意一款曲线拟合软件实现,本实施例对此不做限定。
其中,档和场景反射率的换算关系可以用如下公式(2)表示:
T_scene_reflection=0.18×2 Stop
T_scene_reflection为场景反射率,Stop表示档数,0.18为0档对应的场景反射率,在摄像技术领域,感光元件受到的光照的亮度可以用场景反射率表示。
在一些可选的实施例中,还可以在进行曲线拟合前将设定好的数值点中的编码值转换为归一化编码值(记为Y_cv)。也就是说,进行曲线拟合时,以归一化编码值作为因变量,以场景反射率作为自变量进行拟合。
归一化编码值的取值范围为[0,1]。将编码值除以对应编码深度下的编码值上限,即可得到对应的归一化编码值,反之,将归一化编码值乘以特定编码深度下的编码值上限,即可得到该编码深度下归一化编码值对应的编码值。
例如,对于10bit的编码深度,编码值468对应的归一化编码值为468/1023,即0.45748,归一化编码值0.3在10bit的编码深度下对应的编码值则为0.3*1023,即536(保留整数部 分)。
结合表1的示例,将表1中各个数值点转换为对应的场景反射率和归一化编码值之后,经过曲线拟合,可以得到如下的公式(3):
若T_scene_reflection大于0.0028:
Y_cv=0.3145×log 10(5.555556×T_scene_reflection+0.07907)+0.4471
若T_scene_reflection不大于0.0028:
Y_cv=11.4695×T_scene_reflection+0.0928641
公式(3)对应的曲线,就是根据表1中设定的数值点生成的LOG曲线,该LOG曲线的形式可以参见图4。
以归一化编码值作为LOG曲线的纵坐标的好处在于:
可以扩展LOG曲线的适用范围,使得一条LOG曲线可以适用于具有相近的动态范围,但是编码深度不同的其他设备。也就是说,以归一化编码值为纵坐标生成的LOG曲线可以不经调整而直接适用于编码深度不同,但感光元件的动态范围相同的两台设备。
需要说明,在移动设备中,LOG曲线可以采用多种不同的横坐标和纵坐标表示,而不限于图4所示的场景反射率和归一化编码值。
作为示例,LOG曲线的纵坐标可以是IRE,可以是8bit的编码深度下的编码值(Code Value,CV),还可以是10bit的编码深度下的编码值。其中,IRE是视频测量中的单位,用于表示视频信号中亮度电平的高低。IRE的全称为Institute of Radio Engineers,无线电工程学会。请参见表2,表2列举了公式(3)所示的LOG曲线中,0%,18%(即0.18),600%的场景反射率对应的上述纵坐标的值。
表2
Figure PCTCN2022142068-appb-000001
示例性的,图4所示的以场景反射率为横坐标,以归一化编码值为纵坐标的LOG曲线,也可以转换为图5所示的以stop为横坐标,以10bit编码深度下的编码值为纵坐标的LOG曲线。
如前文所述,生成的对数曲线可以由上位机写入对应的移动设备,存储在移动设备的存储器中。根据实际需求,移动设备在可以用不同的形式存储对数曲线。
在一些示例中,移动设备可以用表格的形式存储生成的对数曲线,表格中包括对数曲线上的多个点,每一个点包括一个表示亮度的数值和在对数曲线中该亮度对应的编码值。在LOG模式下摄像时,移动设备根据摄像头的感光元件输出的原始信号,即可在表格中查找得到对应亮度的编码值,从而获得LOG模式的照片或视频。
以表格形式存储LOG曲线的好处在于,在LOG模式下摄像时不需要计算对应的编码值,节约移动设备的计算资源。
在另一些示例中,移动设备可以用计算机可执行的函数的形式存储对数曲线,函数中包括公式(1)所示的a,b,c和d的数值。在LOG模式下摄像时,移动设备可以调用该 函数计算摄像头的感光元件输出的原始信号,获得对应的编码值。
以可执行的函数的形式存储对数曲线,可以减少对数曲线占用的存储空间。
和非LOG模式的照片或视频相比,LOG模式的照片或视频可以保留更多暗部的信息,但是对比度较低,因此拍摄结束后,经常需要对LOG模式的照片或视频进行后处理,此时就需要将LOG模式的照片或视频,转换为非LOG模式的照片或视频。
为了实现上述转换,移动设备可以预先存储反对数曲线。反对数曲线的横坐标表示编码值,纵坐标则表示亮度,当需要将LOG模式的照片或视频转换为非LOG模式的照片或视频时,移动设备可以根据反对数曲线将LOG模式的照片或视频中的编码值还原为表示亮度的原始信号,再基于表示亮度的原始信号转换得到非LOG模式的照片或视频。
示例性的,和公式(3)所示的对数曲线的反对数曲线(即反LOG曲线)可以用如下公式(4)表示:
若Y_cv大于0.1251:
T_scene_reflection=10 (Y_cv-0.6813)/0.3145-0.0142
若Y_cv不大于0.1251:
T_scene_reflection=(Y_cv-0.0928641)/11.4695
公式(4)表示的反对数曲线的图像可以参见图6。公式(4)中参数的含义和公式(3)一致,不再赘述。
和对数曲线类似的,移动设备存储的反对数曲线的横坐标和纵坐标也可以根据情况而调整,并且移动设备也可以用表格或可执行的函数的形式存储反对数曲线。
本申请所提供的生成对数曲线的方法的有益效果在于:
根据移动设备的感光元件的动态范围,生成符合移动设备特性的LOG曲线,使得移动设备在LOG模式下摄像时,能够最大化利用感光元件的动态范围,有利于在LOG模式的照片和视频中保留暗部和高光的细节。
移动设备在LOG模式下摄像时,可以根据需求和硬件性能选用任意一种色彩空间,本实施例对LOG模式下使用的色彩空间不做限定。示例性的,移动设备在LOG模式下摄像时,可以使用色彩空间ITU-R BT.2020。
请参见图7,为色彩空间ITU-R BT.2020的示意图。图7中不规则曲线包围的区域701,表示人眼可识别的色彩范围,三角形区域702表示色彩空间ITU-R BT.2020能够表示的色彩范围。三角形区域的三个顶点710,711和712,依次表示纯绿色,纯蓝色和纯红色,三角形区域内的点713则表示白色。以上各点在图7中的坐标可以参见下述表3。
表3
表示的颜色 横坐标 纵坐标
白色 0.3127 0.3290
纯红色 0.708 0.292
纯绿色 0.170 0.797
纯蓝色 0.131 0.046
可以看出,色彩空间ITU-R BT.2020能够表示人眼可识别的绝大部分色彩,基于色彩空间ITU-R BT.2020摄像,可以获得色彩更丰富的照片或视频。
本申请实施例提供一种电子设备,包括存储器和一个或多个处理器。
存储器用于存储计算机程序。
一个或多个处理器用于执行计算机程序,具体用于实现本申请任一实施例所提供的生成对数曲线的方法。
在一些可选的实施例中,上述电子设备可以是图2所示的***中的上位机201。
本申请实施例还提供一种计算机存储介质,用于存储计算机程序,该计算机程序被执行时,具体用于实现本申请任一实施例所提供的生成对数曲线的方法。
在一些可选的实施例中,上述计算机存储介质,可以是图2所示的***中上位机201内的存储介质。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请实施例涉及的多个,是指大于或等于两个。需要说明的是,在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。

Claims (10)

  1. 一种生成对数曲线的方法,其特征在于,包括:
    确定移动设备的感光元件的动态范围和所述移动设备的编码深度;
    获得所述动态范围内的多个数值点,所述数值点包括所述动态范围内的档和对应的编码值;
    根据多个所述数值点进行曲线拟合,得到LOG曲线,在所述移动设备以LOG模式摄像时,所述LOG曲线用于将所述感光元件输出的表示亮度的原始信号转换为编码值;
    以场景反射率为横坐标,归一化编码值为纵坐标时,所述LOG曲线的公式为:
    若T_scene_reflection大于0.0028:
    Y_cv=0.3145×log 10(5.555556×T_scene_reflection+0.07907)+0.4471;
    若T_scene_reflection不大于0.0028:
    Y_cv=11.4695×T_scene_reflection+0.0928641;
    其中,T_scene_reflection为所述场景反射率,Y_cv为所述归一化编码值。
  2. 根据权利要求1所述的方法,其特征在于,所述移动设备的编码深度为10比特,且所述动态范围为11档时,所述多个数值点中,-6档对应的编码值为128,-5档对应的编码值为149,-4档对应的编码值为184,-3档对应的编码值为235,-2档对应的编码值为302,-1档对应的编码值为381,0档对应的编码值为468,1档对应的编码值为560,2档对应的编码值为654,3档对应的编码值为749,4档对应的编码值为845,5档对应的编码值为942;
    其中,0档对应的场景反射率为18%。
  3. 根据权利要求1所述的方法,其特征在于,所述场景反射率为0%时,根据所述LOG曲线确定的8比特的编码值为24,根据所述LOG曲线确定的10比特的编码值为95,根据所述LOG曲线确定的IRE值为3.5%;
    所述场景反射率为18%时,根据所述LOG曲线确定的8比特的编码值为116,根据所述LOG曲线确定的10比特的编码值为468,根据所述LOG曲线确定的IRE值为46.1%;
    所述场景反射率为600%时,根据所述LOG曲线确定的8比特的编码值为236,根据所述LOG曲线确定的10比特的编码值为948,根据所述LOG曲线确定的IRE值为100.9%。
  4. 根据权利要求1所述的方法,其特征在于,所述根据多个所述数值点进行曲线拟合,得到LOG曲线之后,还包括:
    确定所述LOG曲线对应的反LOG曲线;
    以场景反射率为纵坐标,归一化编码值为横坐标时,所述反LOG曲线的公式为:
    若Y_cv大于0.1251:
    T_scene_reflection=10 (Y_cv-0.6813)/0.3145-0.0142;
    若Y_cv不大于0.1251:
    T_scene_reflection=(Y_cv-0.0928641)/11.4695。
  5. 根据权利要求1至4任意一项所述的方法,其特征在于,所述移动设备存储表示所述LOG曲线的表格,所述表格包括所述LOG曲线上的多个横坐标和对应的纵坐标。
  6. 根据权利要求1至4任意一项所述的方法,其特征在于,所述移动设备存储表示所述LOG曲线的计算机可执行函数。
  7. 根据权利要求1至6任意一项所述的方法,其特征在于,所述移动设备的感光元件的动态范围,根据所述移动设备拍摄的检测装置的Raw图像中可识别的光斑数量确定,所述检测装置显示多个不同亮度的光斑。
  8. 根据权利要求1至6任意一项所述的方法,其特征在于,所述LOG曲线对应的色彩空间为色彩空间ITU-R BT.2020。
  9. 一种电子设备,其特征在于,包括存储器和一个或多个处理器;
    所述存储器用于存储计算机程序;
    所述一个或多个处理器用于执行所述计算机程序,具体用于实现如权利要求1至8任意一项所述的生成对数曲线的方法。
  10. 一种计算机存储介质,其特征在于,用于存储计算机程序,所述计算机程序被执行时,具体用于实现如权利要求1至8任意一项所述的生成对数曲线的方法。
PCT/CN2022/142068 2022-03-15 2022-12-26 生成对数曲线的方法、设备和存储介质 WO2023173882A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22896825.1A EP4274249A4 (en) 2022-03-15 2022-12-26 LOGARITHMIC CURVE GENERATION METHOD, AND DEVICE AND STORAGE MEDIUM

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210255727.9A CN116805992B (zh) 2022-03-15 2022-03-15 生成对数曲线的方法、设备和存储介质
CN202210255727.9 2022-03-15

Publications (1)

Publication Number Publication Date
WO2023173882A1 true WO2023173882A1 (zh) 2023-09-21

Family

ID=87047629

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142068 WO2023173882A1 (zh) 2022-03-15 2022-12-26 生成对数曲线的方法、设备和存储介质

Country Status (3)

Country Link
EP (1) EP4274249A4 (zh)
CN (1) CN116805992B (zh)
WO (1) WO2023173882A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130329084A1 (en) * 2012-06-07 2013-12-12 Qbiz, Llc Method and System of Image Capture Based on Logarithmic Conversion
CN113096035A (zh) * 2021-03-31 2021-07-09 康佳集团股份有限公司 高动态范围图像生成方法、装置、智能终端及存储介质
CN113542608A (zh) * 2021-07-15 2021-10-22 腾讯科技(深圳)有限公司 图像处理方法及装置
CN113824913A (zh) * 2021-08-12 2021-12-21 荣耀终端有限公司 视频处理方法、装置、电子设备和存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7428011B1 (en) * 1999-09-02 2008-09-23 Fujifilm Corporation Wide dynamic range electronic image recording and reproducing system
US7525579B2 (en) * 2004-12-27 2009-04-28 Konica Minolta Holdings, Inc. Image sensing apparatus and image processing method for use therein
US8358351B2 (en) * 2009-06-05 2013-01-22 Apple Inc. Automatic tone mapping for cameras
ES2769593T3 (es) * 2013-07-16 2020-06-26 Koninklijke Philips Nv Procedimiento y aparato para crear una función EOTF para un mapeo de código universal para una imagen HDR
GB2575122B (en) * 2018-06-29 2021-12-01 Imagination Tech Ltd Mapping an n-bit number to an m-bit number
CN113009462A (zh) * 2019-12-20 2021-06-22 华为技术有限公司 数据处理方法、装置及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130329084A1 (en) * 2012-06-07 2013-12-12 Qbiz, Llc Method and System of Image Capture Based on Logarithmic Conversion
CN113096035A (zh) * 2021-03-31 2021-07-09 康佳集团股份有限公司 高动态范围图像生成方法、装置、智能终端及存储介质
CN113542608A (zh) * 2021-07-15 2021-10-22 腾讯科技(深圳)有限公司 图像处理方法及装置
CN113824913A (zh) * 2021-08-12 2021-12-21 荣耀终端有限公司 视频处理方法、装置、电子设备和存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4274249A4

Also Published As

Publication number Publication date
CN116805992B (zh) 2024-04-19
EP4274249A1 (en) 2023-11-08
CN116805992A (zh) 2023-09-26
EP4274249A4 (en) 2024-06-05

Similar Documents

Publication Publication Date Title
KR102149187B1 (ko) 전자 장치와, 그의 제어 방법
WO2020034737A1 (zh) 成像控制方法、装置、电子设备以及计算机可读存储介质
US9536479B2 (en) Image display device and method
CN112449120B (zh) 高动态范围视频生成方法及装置
CN111510698A (zh) 图像处理方法、装置、存储介质及移动终端
US9122098B2 (en) Image display device, photography device, image display system and method that adjusts display backlight luminance based on image tag information
WO2019011148A1 (zh) 白平衡处理方法和装置
US11032484B2 (en) Image processing apparatus, imaging apparatus, image processing method, imaging method, and program
WO2023124123A1 (zh) 图像处理方法及其相关设备
WO2020006907A1 (zh) 一种拍摄控制方法、终端及计算机可读存储介质
WO2022151852A1 (zh) 图像处理方法、装置、***、电子设备以及存储介质
CN114463191A (zh) 一种图像处理方法及电子设备
WO2024027331A1 (zh) 拍照方法和相关装置
WO2024093545A1 (zh) 拍照方法及电子设备
WO2023173882A1 (zh) 生成对数曲线的方法、设备和存储介质
CN116055699B (zh) 一种图像处理方法及相关电子设备
WO2020155072A1 (zh) 一种混合图层处理方法及装置
WO2023123601A1 (zh) 图像色彩处理方法、装置和电子设备
CN117133252B (zh) 图像处理方法和电子设备
WO2023035919A1 (zh) 控制曝光的方法、装置与电子设备
CN116668862B (zh) 图像处理方法与电子设备
WO2022227200A1 (zh) 一种拍摄分辨率的调整方法及装置、智能设备
WO2023240624A1 (zh) 亮度调整方法及装置、存储介质
CN115529448B (zh) 图像处理方法及相关装置
WO2023131028A1 (zh) 图像处理方法及其相关设备

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022896825

Country of ref document: EP

Effective date: 20230530