Image Processing Method, Apparatus, Electronic Device, and Storage Medium

By acquiring images multiple times in medical imaging and adjusting exposure parameters according to user operations and historical brightness values, the overexposure or underexposure caused by incorrect automatic exposure is solved, and the image quality is improved.

CN115914848BActive Publication Date: 2025-06-27JIANGXI YUANSAI MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211713141.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2025-06-27
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

In the field of medical imaging, especially during surgical and endoscopic image acquisition, incorrect automatic exposure often leads to overexposed or underexposed images and loss of tissue details.

Method used

By acquiring the image to be processed multiple times, determining the image brightness value based on user operation conditions or pixel values, constructing a historical brightness value sequence, calculating the image exposure value, and adjusting the exposure parameters of the image when the difference between the exposure value and the target value exceeds the threshold.

Benefits of technology

It effectively improves the exposure accuracy of images, ensures clear capture of human tissue details, and improves the image quality of medical imaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914848B_ABST
    Figure CN115914848B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, apparatus, electronic device, and storage medium, which acquire and display an image to be processed multiple times. When the image to be processed is acquired each time, a corresponding image brightness value is determined according to the operation situation of the user with respect to the image to be processed or the pixel values of the image to be processed. A historical brightness value sequence including a preset initial brightness value and the image brightness values corresponding to the images to be processed acquired historically is determined, so as to determine the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence. In response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, the exposure parameters of the image to be processed are adjusted according to the image exposure value, and the adjusted image to be processed is displayed. The present disclosure adjusts the exposure value of the image to be processed according to the brightness of the image itself, the operation situation of the user, or the brightness of the images acquired historically, so that the image is displayed with correct exposure parameters, and the quality of the displayed image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular, to an image processing method, apparatus, electronic device, and storage medium. Background Art

[0002] With the progress of electronic imaging technology, it has become possible to apply miniaturized cameras in the field of medical surgery. The automatic exposure of the imaging device has a decisive impact on the image quality. Incorrect exposure will cause overexposure or underexposure. Overexposure will cause a large amount of bright part details in the image to be lost, and underexposure will cause a large amount of dark part details in the image to be lost. In the field of medical imaging, due to the relatively complex internal environment of the human body and the different reflection levels of different tissues, the viscous tissue fluid in the human body will form a stable reflective film on the surface of the internal tissues, which is prone to overexposure. At the same time, when collecting images of the human body cavity through an endoscope, local underexposure usually occurs due to the low light in the deep part of the cavity. Therefore, in the medical imaging scenario, the details of various tissues of the human body are usually not captured due to incorrect exposure. Summary of the Invention

[0003] In view of this, the present disclosure provides an image processing method, apparatus, electronic device, and storage medium, aiming to accurately expose the image to improve the quality of the acquired image.

[0004] According to a first aspect of the present disclosure, there is provided an image processing method, the method comprising:

[0005] Obtaining and displaying the image to be processed multiple times;

[0006] In each case of obtaining the image to be processed, determining a corresponding image brightness value according to the operation condition of the user on the image to be processed or the pixel value of the image to be processed;

[0007] Determining a historical brightness value sequence, the historical brightness value sequence including a preset initial brightness value and the image brightness values corresponding to the historically obtained images to be processed;

[0008] Determining an image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence;

[0009] In response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, adjusting the exposure parameter of the image to be processed according to the image exposure value, and displaying the adjusted image to be processed.

[0010] In a possible implementation manner, the determining a corresponding image brightness value according to the operation condition of the user on the image to be processed or the pixel value of the image to be processed includes:

[0011] Determine the target area in the image to be processed according to the operation of the user on the image to be processed or the pixel values of the image to be processed;

[0012] Determine the brightness value of the target area as the image brightness value.

[0013] In a possible implementation, the determining the target area in the image to be processed according to the operation of the user on the image to be processed or the pixel values of the image to be processed includes:

[0014] In response to the user clicking on the image to be processed, determine the touch screen area clicked by the user in the image to be processed as the target area;

[0015] In response to the user not clicking on the image to be processed, determine the target area in the image to be processed according to the pixel values of the image to be processed.

[0016] In a possible implementation, the determining the target area in the image to be processed according to the pixel values of the image to be processed includes:

[0017] Determine the overexposed pixels in the image to be processed as the pixels with pixel values greater than the pixel value threshold;

[0018] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being greater than the proportion threshold, divide the image to be processed into multiple image areas with the same size, and determine the target area among the multiple image areas;

[0019] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being less than or equal to the proportion threshold, determine all areas of the image to be processed as the target area.

[0020] In a possible implementation, the dividing the image to be processed into multiple image areas with the same size and determining the target area among the multiple image areas includes:

[0021] Divide the image to be processed into multiple image areas with the same size;

[0022] Determine the corresponding brightness value according to the pixel value of each pixel in the image area;

[0023] Determine the image area with the largest corresponding brightness value as the target area.

[0024] In a possible implementation, the determining the corresponding brightness value according to the pixel value of each pixel in the image area includes:

[0025] Calculate the average value of all pixel values of each color channel in the image area as the channel feature value;

[0026] Calculate the weighted sum of the channel feature values of each of the color channels to obtain the corresponding brightness value.

[0027] In a possible implementation, determining the brightness value of the target region as the image brightness value includes:

[0028] Calculate the mean value of all pixel values of each color channel in the target region as the channel feature value;

[0029] Calculate the weighted sum of the channel feature values of each of the color channels to obtain the corresponding brightness value as the image brightness value.

[0030] In a possible implementation, determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence includes:

[0031] Add the image brightness value to the last position of the historical brightness value sequence to obtain a target exposure value sequence;

[0032] Filter the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed.

[0033] In a possible implementation, filtering the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed includes:

[0034] Input the target exposure sequence into the formula Perform filtering to obtain the image exposure value of the image to be processed, where h(k) is the filter coefficient, k is the period for obtaining the image to be processed, Yin is the target exposure sequence, n is the length of the target exposure sequence, N is the filter order, and Yout is the image exposure value.

[0035] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed includes:

[0036] Determine an exposure parameter table including exposure levels and corresponding exposure parameters;

[0037] Determine the adjustment level according to the exposure value difference between the image exposure value and the target exposure value;

[0038] Determine the original level corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and determine the target level according to the original level and the adjustment level;

[0039] Adjust the exposure parameter of at least part of the region in the image to be processed to the exposure parameter of the target level, and display the adjusted image to be processed.

[0040] In a possible implementation, determining the adjustment gear according to the exposure value difference between the image exposure value and the target exposure value includes:

[0041] Input the exposure value difference of the current image to be processed into the formula Calculate the adjustment gear, where D(t) is the exposure value difference of the current image to be processed, D(i) is the exposure value difference corresponding to the image to be processed obtained for the i-th time, and kp, ki, and kd are all preset regulation coefficients.

[0042] In a possible implementation, determining the original gear corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and determining the target gear according to the original gear and the adjustment gear includes:

[0043] Determine the original gear corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and calculate the sum of the original gear and the adjustment gear to obtain a candidate gear;

[0044] In response to the candidate gear being included in the exposure parameter table, determine the candidate gear as the target gear;

[0045] In response to the maximum gear in the exposure parameter table being less than the candidate gear, determine the maximum gear as the target gear;

[0046] In response to the minimum gear in the exposure parameter table being greater than the candidate gear, determine the minimum gear as the target gear.

[0047] In a possible implementation, the image to be processed is obtained by an endoscope. Adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes:

[0048] In response to the endoscope having a corresponding light source and the maximum gear in the exposure parameter table being less than the candidate gear, increase the light source brightness of the endoscope;

[0049] In response to the endoscope having a corresponding light source and the minimum gear in the exposure parameter table being greater than the candidate gear, decrease the light source brightness of the endoscope.

[0050] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes:

[0051] In response to the endoscope not having a corresponding light source and the maximum gear in the exposure parameter table being less than the candidate gear, perform an inverse gamma operation on the image to be processed;

[0052] In response to the endoscope not having a corresponding light source and the minimum gear in the exposure parameter table being greater than the candidate gear, perform an inverse gamma operation on the image to be processed, and perform a gamma operation on the result of the inverse gamma operation multiplied by the ratio of the target exposure value to the image exposure value.

[0053] In a possible implementation manner, the adjusting the exposure parameter of at least a part of the area in the image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed includes:

[0054] In response to the image to be processed being clicked by the user, adjust the exposure parameter of the target area in the image to be processed to the exposure parameter of the target gear, and display the adjusted image to be processed;

[0055] In response to the image to be processed not being clicked by the user, adjust the exposure parameter of the whole image to be processed to the exposure parameter of the target gear, and display the adjusted image to be processed.

[0056] According to a second aspect of the present disclosure, there is provided an image processing apparatus, the apparatus includes:

[0057] An image acquisition module, configured to acquire and display the image to be processed multiple times;

[0058] A brightness value determination module, configured to determine a corresponding image brightness value according to the operation situation of the user on the image to be processed or the pixel value of the image to be processed each time the image to be processed is acquired;

[0059] A sequence determination module, configured to determine a historical brightness value sequence, the historical brightness value sequence including a preset initial brightness value and the image brightness values corresponding to the historically acquired images to be processed;

[0060] An exposure value determination module, configured to determine the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence;

[0061] A parameter adjustment module, configured to, in response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, adjust the exposure parameter of the image to be processed according to the image exposure value, and display the adjusted image to be processed.

[0062] In a possible implementation manner, the determining a corresponding image brightness value according to the operation situation of the user on the image to be processed or the pixel value of the image to be processed includes:

[0063] Determine a target area in the image to be processed according to the operation situation of the user on the image to be processed or the pixel value of the image to be processed;

[0064] Determine the brightness value of the target area as the image brightness value.

[0065] In a possible implementation, the determining the target area in the image to be processed according to the operation situation of the user on the image to be processed or the pixel values of the image to be processed includes:

[0066] In response to the user clicking on the image to be processed, determine the touch screen area clicked by the user in the image to be processed as the target area;

[0067] In response to the user not clicking on the image to be processed, determine the target area in the image to be processed according to the pixel values of the image to be processed.

[0068] In a possible implementation, the determining the target area in the image to be processed according to the pixel values of the image to be processed includes:

[0069] Determine the overexposed pixels as the pixels in the image to be processed whose pixel values are greater than the pixel value threshold;

[0070] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being greater than the proportion threshold, divide the image to be processed to obtain a plurality of image areas with the same size, and determine the target area among the plurality of image areas;

[0071] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being less than or equal to the proportion threshold, determine all areas of the image to be processed as the target area.

[0072] In a possible implementation, the dividing the image to be processed to obtain a plurality of image areas with the same size and determining the target area among the plurality of image areas includes:

[0073] Divide the image to be processed to obtain a plurality of image areas with the same size;

[0074] Determine the corresponding brightness value according to the pixel value of each pixel in the image area;

[0075] Determine the image area with the largest corresponding brightness value as the target area.

[0076] In a possible implementation, the determining the corresponding brightness value according to the pixel value of each pixel in the image area includes:

[0077] Calculate the mean value of all pixel values of each color channel in the image area as the channel feature value;

[0078] Calculate the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value.

[0079] In a possible implementation, determining the brightness value of the target area as the image brightness value includes:

[0080] Calculating the average value of all pixel values of each color channel in the target area as the channel feature value;

[0081] Calculating the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value as the image brightness value.

[0082] In a possible implementation, determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence includes:

[0083] Adding the image brightness value to the last position of the historical brightness value sequence to obtain a target exposure value sequence;

[0084] Filtering the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed.

[0085] In a possible implementation, filtering the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed includes:

[0086] Inputting the target exposure sequence into the formula for filtering to obtain the image exposure value of the image to be processed, where h(k) is the filter coefficient, k is the period for obtaining the image to be processed, Yin is the target exposure sequence, n is the length of the target exposure sequence, N is the filter order, and Yout is the image exposure value.

[0087] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed includes:

[0088] Determining an exposure parameter table including exposure levels and corresponding exposure parameters;

[0089] Determining an adjustment level according to the exposure value difference between the image exposure value and the target exposure value;

[0090] Determining the original level corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and determining the target level according to the original level and the adjustment level;

[0091] Adjusting the exposure parameter of at least part of the area in the image to be processed to the exposure parameter of the target level and displaying the adjusted image to be processed.

[0092] In a possible implementation, determining the adjustment gear according to the exposure value difference between the image exposure value and the target exposure value includes:

[0093] Input the exposure value difference of the current image to be processed into the formula Calculate the adjustment gear, where D(t) is the exposure value difference of the current image to be processed, D(i) is the exposure value difference corresponding to the image to be processed obtained for the i-th time, and kp, ki, and kd are all preset regulation coefficients.

[0094] In a possible implementation, determining the original gear corresponding to the exposure parameter of the current image to be processed in the exposure parameter table and determining the target gear according to the original gear and the adjustment gear includes:

[0095] Determine the original gear corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and calculate the sum of the original gear and the adjustment gear to obtain a candidate gear;

[0096] In response to the candidate gear being included in the exposure parameter table, determine the candidate gear as the target gear;

[0097] In response to the maximum gear in the exposure parameter table being less than the candidate gear, determine the maximum gear as the target gear;

[0098] In response to the minimum gear in the exposure parameter table being greater than the candidate gear, determine the minimum gear as the target gear.

[0099] In a possible implementation, the image to be processed is obtained by an endoscope. Adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes:

[0100] In response to the endoscope having a corresponding light source and the maximum gear in the exposure parameter table being less than the candidate gear, increase the light source brightness of the endoscope;

[0101] In response to the endoscope having a corresponding light source and the minimum gear in the exposure parameter table being greater than the candidate gear, decrease the light source brightness of the endoscope.

[0102] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes:

[0103] In response to the endoscope not having a corresponding light source and the maximum gear in the exposure parameter table being less than the candidate gear, perform an inverse gamma operation on the image to be processed;

[0104] In response to the endoscope not having a corresponding light source and the minimum gear in the exposure parameter table being greater than the candidate gear, perform an inverse gamma operation on the image to be processed, and perform a gamma operation on the result of the inverse gamma operation multiplied by the ratio of the target exposure value to the image exposure value.

[0105] In a possible implementation manner, the adjusting the exposure parameters of at least some regions in the image to be processed to the exposure parameters of the target gear and displaying the adjusted image to be processed includes:

[0106] In response to the image to be processed being clicked by the user, adjust the exposure parameters of the target region in the image to be processed to the exposure parameters of the target gear, and display the adjusted image to be processed;

[0107] In response to the image to be processed not being clicked by the user, adjust the exposure parameters of the entire image to be processed to the exposure parameters of the target gear, and display the adjusted image to be processed.

[0108] According to a third aspect of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to implement the above method when executing the instructions stored in the memory.

[0109] According to a fourth aspect of the present disclosure, there is provided a non-volatile computer-readable storage medium, on which computer program instructions are stored, wherein, the computer program instructions implement the above method when executed by a processor.

[0110] According to a fifth aspect of the present disclosure, there is provided a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, when the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0111] In the embodiments of the present disclosure, a to-be-processed image is acquired and displayed multiple times. Each time the to-be-processed image is acquired, a corresponding image brightness value is determined according to the operation situation of the user with respect to the to-be-processed image or the pixel values of the to-be-processed image. A historical brightness value sequence including a preset initial brightness value and the image brightness values corresponding to the historically acquired to-be-processed images is determined, so as to determine the image exposure value of the to-be-processed image according to the image brightness value and the historical brightness value sequence. In response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, the exposure parameter of the to-be-processed image is adjusted according to the image exposure value, and the adjusted to-be-processed image is displayed. The present disclosure adjusts the exposure value of the to-be-processed image according to the brightness of the image itself, the operation situation of the user, or the brightness of the historically acquired images, so that the image is displayed with correct exposure parameters, and the quality of the displayed image is improved.

[0112] Other features and aspects of the present disclosure will become clear from the following detailed description of the exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] The accompanying drawings, which are included in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the present disclosure together with the specification, and are used to explain the principles of the present disclosure.

[0114] Figure 1 A flowchart showing an image processing method according to an embodiment of the present disclosure;

[0115] Figure 2 A schematic diagram showing a process of determining a target area according to an embodiment of the present disclosure;

[0116] Figure 3 A schematic diagram showing an image processing apparatus according to an embodiment of the present disclosure;

[0117] Figure 4 A schematic diagram showing an electronic device according to an embodiment of the present disclosure;

[0118] Figure 5 A schematic diagram showing another electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0119] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the drawings denote elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0120] The special term "exemplary" here means "serving as an example, embodiment, or illustrative". Any embodiment described as "exemplary" here does not necessarily have to be construed as superior to or better than other embodiments.

[0121] In addition, to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present disclosure can still be implemented without some of these specific details. In some instances, methods, means, elements, and circuits well-known to those skilled in the art are not described in detail so as to highlight the gist of the present disclosure.

[0122] In a possible implementation manner, the image processing method according to the embodiments of the present disclosure can be executed by an electronic device such as a processor, a terminal device, or a server. Among them, the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., a fixed or mobile terminal. The server can be a single server or a server cluster composed of multiple servers. The electronic device can implement the image processing method according to the embodiments of the present disclosure by the processor calling computer-readable instructions stored in the memory.

[0123] Figure 1 A flowchart showing an image processing method according to an embodiment of the present disclosure is shown. As Figure 1 shown, the image processing method may include the following steps S10 - S50.

[0124] Step S10: Obtain and display the image to be processed multiple times.

[0125] In a possible implementation manner, the electronic device can obtain and display the image to be processed multiple times. The image to be processed is an image that needs to be subjected to exposure processing and can be obtained periodically according to a preset frequency. Among them, the electronic device can obtain the image to be processed by collecting through any connected or built-in image acquisition device, or directly receive the image to be processed collected by the image acquisition device of other devices. Further, after each acquisition of the image to be processed, the electronic device displays the image to be processed through a connected or built-in display device, and the user can perform human-computer interaction with the electronic device through the image to be processed displayed on the display device.

[0126] Optionally, the image acquisition device for collecting the image to be processed according to the embodiments of the present disclosure can be selected according to the application scenario. For example, in an application scenario of collecting environmental images, the image acquisition device can be any camera device. In an application scenario of collecting images of the internal cavity of the human body, the image acquisition device can be an endoscope.

[0127] Step S20: In the case of obtaining the image to be processed each time, determine the corresponding image brightness value according to the operation situation of the user on the image to be processed or the pixel value of the image to be processed.

[0128] In a possible implementation, after the electronic device acquires the image to be processed each time, it first determines the operation situation of the user with respect to the image to be processed and the pixel value of each pixel in the image to be processed. Then, it determines the corresponding image brightness value according to the operation situation of the user with respect to the image to be processed or the pixel value of the image to be processed. Among them, the operation situation of the user is used to indicate whether the user clicks on the image to be processed through the display device that displays the image to be processed, and the pixel value of the image to be processed is used to determine the overexposure situation of the image to be processed. That is, the electronic device can preset multiple ways to determine the image brightness value in advance, and after obtaining and displaying the image to be processed, it selects a way to determine the image brightness value according to whether the user clicks on the image to be processed and the overexposure degree of the image to be processed.

[0129] Optionally, the electronic device can first determine the target area in the image to be processed according to the operation situation of the user with respect to the image to be processed or the pixel value of the image to be processed, and then determine the brightness value of the target area as the image brightness value. That is, the electronic device can also select a way to determine the target area in the image to be processed according to whether the user clicks on the image to be processed and the overexposure degree of the image to be processed, and then further determine the image brightness value. Exemplarily, the electronic device can first make a preliminary judgment on the target area according to the operation situation of the user with respect to the image to be processed, and determine the target area according to the pixel value of the image to be processed when it is unable to judge.

[0130] Exemplarily, the electronic device can, in response to the user clicking on the image to be processed, determine the touch screen area clicked by the user in the image to be processed as the target area. In response to the user not clicking on the image to be processed, it determines the target area in the image to be processed according to the pixel value of the image to be processed. That is, when the user clicks on the image to be processed, the touch screen area clicked by the user in the image to be processed is directly determined as the target area. Optionally, the touch screen area can be determined according to the user's click position and a preset area size. For example, after detecting the user's click position, a preset size area centered on the user's click position is determined in the image to be processed as the touch screen area.

[0131] Optionally, in the case where the user does not click on the image to be processed, the overexposure situation of each pixel in the image to be processed can be determined according to the pixel value, and the target area can be determined according to the overexposure situation of each pixel. That is, the pixels in the image to be processed with pixel values greater than the pixel value threshold are determined as overexposed pixels. In response to the proportion of overexposed pixels in all pixels of the image to be processed being greater than the proportion threshold, the image to be processed is divided into multiple image regions of the same size, and the target area is determined in the image regions. In response to the proportion of overexposed pixels in all pixels of the image to be processed being less than or equal to the proportion threshold, the entire area of the image to be processed is determined as the target area. Among them, the pixel value threshold can be determined according to the maximum pixel value that the image acquisition device for acquiring the image to be processed can obtain, that is, it can be calculated by obtaining the maximum pixel value and a preset ratio. For example, in the case where the maximum pixel value that the image acquisition device can obtain is 1023 and the preset ratio is 90%, the pixel value threshold can be determined to be 920, and then the pixels in the image to be processed with pixel values greater than 920 are determined as overexposed pixels.

[0132] Further, after determining the overexposed pixels in the image to be processed, the electronic device can determine the target area according to the size relationship between the proportion of overexposed pixels in all pixels of the image to be processed and the proportion threshold. Among them, the electronic device can directly calculate the ratio of the number of overexposed pixels to the number of all pixels. In the case where this ratio is less than the proportion threshold, the entire area of the image to be processed is directly determined as the target area. In the case where this ratio is greater than the proportion threshold, the image to be processed is divided into multiple image regions of the same size, and the target area is determined in the image regions. Optionally, the multiple image regions obtained by dividing the image to be processed in the embodiments of the present disclosure have the same size.

[0133] Alternatively, the electronic device can first divide the image to be processed into multiple image regions, compare the ratio of the number of overexposed pixels to the number of all pixels in each image region with a preset regional threshold, and determine the region as an overexposed region in the case where it is greater than the regional threshold. Further, compare the ratio of the proportion of the overexposed regions in all the image regions in the image to be processed with the proportion threshold. In the case where this ratio is less than the proportion threshold, the entire image regions of the image to be processed are directly determined as the target area. In the case where this ratio is greater than the proportion threshold, the target area is determined among the multiple image regions obtained by division. Alternatively, the electronic device can also compare the ratio of the number of pixels included in the overexposed regions to the number of pixels included in the image to be processed, and compare the size of this ratio with the proportion threshold. In the case where this ratio is less than the proportion threshold, the entire image regions of the image to be processed are directly determined as the target area. In the case where this ratio is greater than the proportion threshold, the target area is determined among the multiple image regions obtained by division.

[0134] Optionally, when the electronic device needs to divide the image to be processed to obtain multiple image regions and determine the target region therefrom, it can first divide the image to be processed to obtain multiple image regions of the same size, then determine the corresponding brightness value according to the pixel value of each pixel in the image region, and then determine the image region with the largest corresponding brightness value as the target region. Among them, the process of determining the brightness value of each image region can be to calculate the mean value of all pixel values of each color channel in the image region as the channel feature value, and then calculate the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value. For example, for each color channel R, it can be obtained through Calculating the pixel value R(i) of each pixel i in the image region in this color channel to obtain the corresponding channel feature value Rmean. Further, calculating the weighted sum of each channel feature value to obtain the brightness value of the image region. For example, when the image to be processed includes four color channels R, Gr, Gb, and B, the brightness value Y can be calculated by the formula Y = 0.2990 * R + 0.5870 * 0.5 * (Gr + Gb) + 0.1140 * B, where the weight of each color channel can be preset in advance. After obtaining each image region, determine the region with the largest brightness value among them as the target region.

[0135] Figure 2 A schematic diagram showing a process of determining a target region according to an embodiment of the present disclosure. As Figure 2 shown, after the electronic device obtains the image to be processed each time, it displays the image to be processed 20 through the display device, and detects whether the image to be processed is clicked by the user 21 within a preset time period. When the image to be processed is clicked by the user, directly determine the touch screen area clicked by the user as the target region 27. When the image to be processed is not clicked by the user, then determine the overexposed pixels 22 in the image to be processed, and determine whether the proportion of overexposed pixels is greater than a preset proportion threshold 23. When the proportion of overexposed pixels in the image to be processed is greater than the preset proportion threshold, determine multiple image regions 24 by dividing the image to be processed, and select the image region with the largest brightness value as the target region 25 by calculating the brightness value of each image region.

[0136] In a possible implementation manner, after the electronic device determines the target region, it can determine the brightness value of the target region in the same manner as the above-mentioned manner of determining the brightness value of the image region to obtain the image brightness value. That is, it can calculate the mean value of all pixel values of each color channel in the target region as the channel feature value, and then calculate the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value as the image brightness value. The specific calculation process will not be elaborated here.

[0137] Step S30: Determine the historical brightness value sequence.

[0138] In a possible implementation, an electronic device determines a sequence of historical brightness values, which includes a preset initial brightness value and the image brightness values corresponding to the to-be-processed images obtained historically. The preset initial brightness value is the first brightness value in the sequence of historical brightness values, and the other image brightness values included in the sequence of historical brightness values are sorted according to the acquisition order of the corresponding to-be-processed images. That is, when the current to-be-processed image is the to-be-processed image acquired for the first time, the sequence of historical brightness values only includes the initial brightness value. When the current to-be-processed image is not the to-be-processed image acquired for the first time, the sequence of historical brightness values includes the initial brightness value and the image brightness values corresponding to each to-be-processed image acquired before the current to-be-processed image.

[0139] Step S40: Determine the image exposure value of the to-be-processed image according to the image brightness value and the sequence of historical brightness values.

[0140] In a possible implementation, after determining the image brightness value and the sequence of historical brightness values corresponding to the current to-be-processed image, the electronic device can determine the image exposure value of the to-be-processed image according to the image brightness value and the sequence of historical brightness values. Exemplarily, the image brightness value can be added to the last position of the sequence of historical brightness values to obtain a target exposure value sequence, and then the target exposure sequence is filtered by a preset filter to obtain the image exposure value of the to-be-processed image. Among them, the preset filter can be any filter such as a FIR (Finite Impulse Response) filter, an IIR (Infinite Impulse Response) filter, a Wiener filter, a Bayesian filter, a Kalman filter, etc.

[0141] Optionally, in the case of filtering by a FIR filter, the target exposure sequence can be input into the formula for filtering to obtain the image exposure value of the to-be-processed image, where h(k) is the filter coefficient, k is the period of obtaining the to-be-processed image, Yin is the target exposure sequence, n is the length of the target exposure sequence, N is the filter order, and Yout is the image exposure value.

[0142] Step S50: In response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, adjust the exposure parameter of the to-be-processed image according to the image exposure value, and display the adjusted to-be-processed image.

[0143] In a possible implementation, when the electronic device determines the image exposure value corresponding to the image to be processed, it calculates the difference between the image exposure value and a preset target exposure value to determine whether the exposure parameters of the current image to be processed need to be adjusted. Among them, after obtaining the image to be processed, the image to be processed is first displayed on the display device with the initial exposure parameters. When the image exposure value of the image to be processed is calculated, it is determined whether the exposure parameters need to be adjusted according to the difference between the image exposure value and the target exposure value. In the case where the exposure parameters do not need to be adjusted, the image to be processed is still displayed with the current exposure parameters. In the case where the exposure parameters need to be adjusted, after adjusting the exposure parameters, the image to be processed is redisplayed with the new exposure parameters. Optionally, the initial exposure parameters of each acquired image to be processed can be the same as the exposure parameters finally used to display the previous image to be processed.

[0144] Optionally, in the case where the exposure parameters need to be adjusted, the electronic device can first determine an exposure parameter table including exposure levels and corresponding exposure parameters. Determine the adjustment level according to the exposure value difference between the image exposure value and the target exposure value. Determine the original level corresponding to the exposure parameters of the current image to be processed in the exposure parameter table, and determine the target level according to the original level and the adjustment level. Adjust the exposure parameters of at least part of the area in the image to be processed to the exposure parameters of the target level, and display the adjusted image to be processed. The process of determining the differential adjustment level can be to input the exposure value difference of the current image to be processed into the formula to calculate the adjustment level, where D(t) is the exposure value difference of the current image to be processed, D(i) is the exposure value difference corresponding to the i-th acquired image to be processed, and kp, ki, and kd are all preset regulation coefficients. When the value calculated by the formula is a non-integer, rounding can be performed according to the preset rounding rule.

[0145] Optionally, the exposure parameter table can be as follows, which includes exposure levels and corresponding exposure parameters. The exposure parameters can include gain values and exposure times.

[0146] Exposure level Gain value Exposure time 1 1 0.0288 2 1 0.0576 3 1 0.0864 4 1 0.1152 5 2 0.1440 6 2 0.1728 … … …

[0147] In a possible implementation, since the exposure levels in the exposure parameter table are limited, the target level determined by the electronic device needs to be one of the exposure levels included in the exposure parameter table. Therefore, the process for the electronic device to determine the target level can be to determine the original level corresponding to the exposure parameters of the current image to be processed in the exposure parameter table, and calculate the sum of the original level and the adjustment level to obtain a candidate level. In response to the candidate level being included in the exposure parameter table, the candidate level is determined as the target level. In response to the maximum level in the exposure parameter table being less than the candidate level, the maximum level is determined as the target level. In response to the minimum level in the exposure parameter table being greater than the candidate level, the minimum level is determined as the target level. That is, when the candidate level is in the exposure parameter table, the candidate level is determined as the target level. When the candidate level is not in the exposure parameter table, the exposure level closest to the candidate level is selected as the target level.

[0148] Optionally, when the maximum level in the exposure parameter table is less than the candidate level, it can be determined that the ambient light for capturing the image to be processed is relatively dim. When the minimum level in the exposure parameter table is greater than the candidate level, it can be determined that the ambient light for capturing the image to be processed is relatively bright. Therefore, when the candidate level is not included in the exposure parameter table, the exposure of the image to be processed can be adjusted to be close to the required target exposure value by adjusting the ambient light. Exemplarily, when the image to be processed is obtained through an endoscope, the endoscope includes a camera for capturing images and a light source for supplementary lighting. Therefore, in response to the endoscope having a corresponding light source and the maximum level in the exposure parameter table being less than the candidate level, the brightness of the light source of the endoscope is increased. In response to the endoscope having a corresponding light source and the minimum level in the exposure parameter table being greater than the candidate level, the brightness of the light source of the endoscope is decreased.

[0149] Further, when the candidate level is not included in the exposure parameter table and the ambient light source cannot be adjusted, the electronic device can also make the exposure of the image to be processed close to the required target exposure value by performing arithmetic processing on the image to be processed. Exemplarily, when the image to be processed is obtained through an endoscope, in response to the endoscope not having a corresponding light source and the maximum level in the exposure parameter table being less than the candidate level, inverse gamma arithmetic processing is performed on the image to be processed. In response to the endoscope not having a corresponding light source and the minimum level in the exposure parameter table being greater than the candidate level, inverse gamma arithmetic processing is performed on the image to be processed, and gamma arithmetic processing is performed on the product of the result of the inverse gamma arithmetic processing and the ratio of the target exposure value to the image exposure value.

[0150] Optionally, the process of inverse gamma operation is used to convert the image to be processed displayed on the display device from the non-linear sRGB space to the linear RGB space. When the maximum gear in the exposure parameter table is less than the candidate gear, the formula for performing the inverse gamma operation on the image to be processed may include Formula 1, Formula 2, and Formula 3.

[0151]

[0152]

[0153] P ′ = C ′ * N Formula 3

[0154] Wherein, N is a preset normalization constant. For example, for an 8-bit image to be processed, N can be set to 256, and for a 10-bit image to be processed, it can be set to 1024. P is the image pixel value at each pixel position in the image to be processed before the inverse gamma operation, and C is the image pixel value after normalization processing. C ′ is the pixel value after normalization obtained after the inverse gamma operation, and P ′ is the pixel value obtained after the inverse gamma operation.

[0155] Furthermore, when the minimum gear in the exposure parameter table is less than the candidate gear, the formula for performing the operation on the image to be processed may include Formula 4, Formula 5, Formula 6, and Formula 7.

[0156]

[0157]

[0158]

[0159] P″ = C ′ * N Formula 7

[0160] Wherein, N is a preset normalization constant, P is the image pixel value after the inverse gamma operation, Y target is the target brightness value after the inverse gamma operation, Y is the picture brightness value after the inverse gamma operation, C is the image pixel value after normalization, C ′ is the pixel value after normalization processing after performing the gamma operation, and P″ is the image pixel value after performing the gamma operation.

[0161] In a possible implementation, after adjusting the exposure parameter, the electronic device displays the image to be processed according to the adjusted exposure parameter. Among them, since the user usually needs to obtain the image details of the touch screen area when clicking on the image to be processed, that is, the electronic device can adjust the exposure parameter according to the user's click situation. That is, in response to the image to be processed being clicked by the user, the exposure parameter of the target area in the image to be processed is adjusted to the exposure parameter of the target gear, and the adjusted image to be processed is displayed. In response to the image to be processed not being clicked by the user, the exposure parameter of the entire image to be processed is adjusted to the exposure parameter of the target gear, and the adjusted image to be processed is displayed.

[0162] Based on the above technical features, the embodiments of the present disclosure can adjust the exposure value of the image to be processed by the brightness of the image itself, the user operation situation, or the brightness of the historically acquired image, so that the image is displayed with the correct exposure parameter, improving the quality of the displayed image. At the same time, in the case where the exposure parameter of the current image cannot reach the expected level, the image quality is further adjusted by adjusting the light source brightness or performing gamma operation, further improving the quality of the displayed image. At the same time, the image processing method of the embodiments of the present disclosure has the characteristics of low computational complexity and fast convergence speed, and is easy to be deployed in hardware with poor computing power, increasing the universality of the method.

[0163] Figure 3 FIG. shows a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure. As Figure 3 shown, the image processing apparatus of the embodiments of the present disclosure may include:

[0164] An image acquisition module 30, configured to acquire and display the image to be processed multiple times;

[0165] A brightness value determination module 31, configured to determine the corresponding image brightness value according to the user's operation situation of the image to be processed or the pixel value of the image to be processed each time the image to be processed is acquired;

[0166] A sequence determination module 32, configured to determine a historical brightness value sequence, where the historical brightness value sequence includes a preset initial brightness value and the image brightness values corresponding to the historically acquired images to be processed;

[0167] An exposure value determination module 33, configured to determine the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence;

[0168] A parameter adjustment module 34, configured to, in response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, adjust the exposure parameter of the image to be processed according to the image exposure value, and display the adjusted image to be processed.

[0169] In a possible implementation, determining a corresponding image brightness value according to the operation situation of the user on the image to be processed or the pixel values of the image to be processed includes:

[0170] Determining a target area in the image to be processed according to the operation situation of the user on the image to be processed or the pixel values of the image to be processed;

[0171] Determining the brightness value of the target area as the image brightness value.

[0172] In a possible implementation, determining a target area in the image to be processed according to the operation situation of the user on the image to be processed or the pixel values of the image to be processed includes:

[0173] In response to the user clicking on the image to be processed, determining the touch screen area clicked by the user in the image to be processed as the target area;

[0174] In response to the user not clicking on the image to be processed, determining a target area in the image to be processed according to the pixel values of the image to be processed.

[0175] In a possible implementation, determining a target area in the image to be processed according to the pixel values of the image to be processed includes:

[0176] Determining pixels with pixel values greater than the pixel value threshold in the image to be processed as overexposed pixels;

[0177] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being greater than the proportion threshold, dividing the image to be processed into multiple image areas of the same size, and determining a target area among the multiple image areas;

[0178] In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being less than or equal to the proportion threshold, determining all areas of the image to be processed as the target area.

[0179] In a possible implementation, dividing the image to be processed into multiple image areas of the same size and determining a target area among the multiple image areas includes:

[0180] Dividing the image to be processed into multiple image areas of the same size;

[0181] Determining corresponding brightness values according to the pixel values of each pixel in the image area;

[0182] Determining the image area with the largest corresponding brightness value as the target area.

[0183] In a possible implementation, determining the corresponding brightness value according to the pixel value of each pixel in the image region includes:

[0184] Calculating the mean value of all pixel values of each color channel in the image region as the channel feature value;

[0185] Calculating the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value.

[0186] In a possible implementation, determining the brightness value of the target region as the image brightness value includes:

[0187] Calculating the mean value of all pixel values of each color channel in the target region as the channel feature value;

[0188] Calculating the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value as the image brightness value.

[0189] In a possible implementation, determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence includes:

[0190] Adding the image brightness value to the last position of the historical brightness value sequence to obtain a target exposure value sequence;

[0191] Filtering the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed.

[0192] In a possible implementation, filtering the target exposure sequence through a preset filter to obtain the image exposure value of the image to be processed includes:

[0193] Inputting the target exposure sequence into the formula for filtering to obtain the image exposure value of the image to be processed, where h(k) is the filter coefficient, k is the period for obtaining the image to be processed, Yin is the target exposure sequence, n is the length of the target exposure sequence, N is the filter order, and Yout is the image exposure value.

[0194] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed includes:

[0195] Determining an exposure parameter table including exposure levels and corresponding exposure parameters;

[0196] Determining the adjustment level according to the exposure value difference between the image exposure value and the target exposure value;

[0197] Determine the original gear corresponding to the exposure parameter of the currently described image to be processed in the exposure parameter table, and determine the target gear according to the original gear and the adjustment gear;

[0198] Adjust the exposure parameter of at least part of the area in the image to be processed to the exposure parameter of the target gear, and display the adjusted image to be processed.

[0199] In a possible implementation manner, the determining the adjustment gear according to the exposure value difference between the image exposure value and the target exposure value includes:

[0200] Input the exposure value difference of the currently processed image into the formula Calculate to obtain the adjustment gear, where D(t) is the exposure value difference of the currently processed image, D(i) is the exposure value difference corresponding to the image to be processed obtained for the i-th time, and kp, ki, and kd are all preset regulation coefficients.

[0201] In a possible implementation manner, the determining the original gear corresponding to the exposure parameter of the currently described image to be processed in the exposure parameter table, and determining the target gear according to the original gear and the adjustment gear includes:

[0202] Determine the original gear corresponding to the exposure parameter of the currently described image to be processed in the exposure parameter table, and calculate the sum of the original gear and the adjustment gear to obtain a candidate gear;

[0203] In response to the candidate gear being included in the exposure parameter table, determine the candidate gear as the target gear;

[0204] In response to the maximum gear in the exposure parameter table being less than the candidate gear, determine the maximum gear as the target gear;

[0205] In response to the minimum gear in the exposure parameter table being greater than the candidate gear, determine the minimum gear as the target gear.

[0206] In a possible implementation manner, the image to be processed is obtained by an endoscope. The adjusting the exposure parameter of the image to be processed according to the image exposure value, and displaying the adjusted image to be processed further includes:

[0207] In response to the endoscope having a corresponding light source, and the maximum gear in the exposure parameter table being less than the candidate gear, increase the brightness of the light source of the endoscope;

[0208] In response to the endoscope having a corresponding light source, and the minimum gear in the exposure parameter table being greater than the candidate gear, decrease the brightness of the light source of the endoscope.

[0209] In a possible implementation, adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes:

[0210] In response to the endoscope not having a corresponding light source and the maximum gear in the exposure parameter table being less than the candidate gear, performing an inverse gamma operation on the image to be processed;

[0211] In response to the endoscope not having a corresponding light source and the minimum gear in the exposure parameter table being greater than the candidate gear, performing an inverse gamma operation on the image to be processed and performing a gamma operation on the result of the inverse gamma operation multiplied by the ratio of the target exposure value to the image exposure value.

[0212] In a possible implementation, adjusting the exposure parameter of at least a part of the regions in the image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed includes:

[0213] In response to the image to be processed being clicked by the user, adjusting the exposure parameter of the target region in the image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed;

[0214] In response to the image to be processed not being clicked by the user, adjusting the exposure parameter of the whole image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed.

[0215] In some embodiments, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0216] The embodiments of the present disclosure also propose a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above methods are implemented. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0217] The embodiments of the present disclosure also propose an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to implement the above methods when executing the instructions stored in the memory.

[0218] The embodiments of the present disclosure also provide a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in the processor of the electronic device, the processor in the electronic device executes the above methods.

[0219] Figure 4 FIG. 2 is a schematic diagram showing an electronic device 800 according to an embodiment of the present disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0220] Referring to Figure 4 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0221] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-described method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0222] The memory 804 is configured to store various types of data to support the operation of the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0223] The power component 806 provides power to various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0224] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0225] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0226] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0227] The sensor component 814 includes one or more sensors for providing status assessments of various aspects of the electronic device 800. For example, the sensor component 814 can detect the on / off state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800. The sensor component 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 814 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0228] The communication component 816 is configured to facilitate communication, in a wired or wireless manner, between the electronic device 800 and other devices. The electronic device 800 may access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further 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.

[0229] In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method.

[0230] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of the electronic device 800 to complete the above-described method.

[0231] Figure 5 A schematic diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 may be provided as a server or a terminal device. Referring to Figure 5 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above-described method.

[0232] The electronic device 1900 may further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.

[0233] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, and the computer program instructions can be executed by a processing component 1922 of the electronic device 1900 to complete the above method.

[0234] The present disclosure may be a system, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium having thereon computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0235] A computer-readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device, such as a punch card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not construed as an instantaneous signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.

[0236] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0237] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the present disclosure.

[0238] Aspects of the present disclosure are described herein with reference to the flowchart and / or block diagram of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer - readable program instructions.

[0239] These computer - readable program instructions can be provided to a processor of a general - purpose computer, a special - purpose computer, or other programmable data - processing apparatus to produce a machine such that when the instructions are executed by the processor of the computer or other programmable data - processing apparatus, a device is produced that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions can also be stored in a computer - readable storage medium, which causes a computer, a programmable data - processing apparatus, and / or other devices to operate in a particular manner, so that the computer - readable medium storing the instructions includes a manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0240] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0241] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by special-purpose hardware-based systems that perform the specified functions or acts, or by combinations of special-purpose hardware and computer instructions.

[0242] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the market, or to enable other ordinary skilled artisans in the art to understand the embodiments disclosed herein.

Claims

1. An image processing method, characterized in that, The method includes: Obtaining and displaying the image to be processed multiple times; In each case of obtaining the image to be processed, determining a corresponding image brightness value according to the operation of the user on the image to be processed or the pixel values of the image to be processed; Determining a historical brightness value sequence, where the historical brightness value sequence includes a preset initial brightness value and the image brightness values corresponding to the historically obtained images to be processed; Determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence; In response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold, adjusting the exposure parameters of the image to be processed according to the image exposure value and displaying the adjusted image to be processed; Wherein, determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence includes: Adding the image brightness value to the last position of the historical brightness value sequence to obtain a target exposure value sequence; Filtering the target exposure value sequence through a preset filter to obtain the image exposure value of the image to be processed.

2. The method according to claim 1, wherein Determining the corresponding image brightness value according to the operation of the user on the image to be processed or the pixel values of the image to be processed includes: Determining a target area in the image to be processed according to the operation of the user on the image to be processed or the pixel values of the image to be processed; Determining the brightness value of the target area as the image brightness value.

3. The method according to claim 2, wherein Determining the target area in the image to be processed according to the operation of the user on the image to be processed or the pixel values of the image to be processed includes: In response to the user clicking on the image to be processed, determining the touch screen area clicked by the user in the image to be processed as the target area; In response to the user not clicking on the image to be processed, determining the target area in the image to be processed according to the pixel values of the image to be processed.

4. The method according to claim 3, wherein Determining the target area in the image to be processed according to the pixel values of the image to be processed includes: Determining the pixels with pixel values greater than the pixel value threshold in the image to be processed as overexposed pixels; In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being greater than the proportion threshold, dividing the image to be processed into multiple image areas of the same size and determining the target area among the multiple image areas; In response to the proportion of the overexposed pixels in all the pixels of the image to be processed being less than or equal to the proportion threshold, determining all areas of the image to be processed as the target area.

5. The method according to claim 4, characterized in that, Dividing the image to be processed into multiple image areas of the same size and determining the target area among the multiple image areas includes: Dividing the image to be processed into multiple image areas of the same size; Determining the corresponding brightness value according to the pixel value of each pixel in the image area; Determining the image area with the largest corresponding brightness value as the target area.

6. The method according to claim 5, characterized in that Determining the corresponding brightness value according to the pixel value of each pixel in the image area includes: Calculating the mean value of all pixel values of each color channel in the image area as the channel feature value; Calculating the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value.

7. The method according to any one of claims 2-6, characterized in that, Determining the brightness value of the target area as the image brightness value includes: Calculating the mean value of all pixel values of each color channel in the target area as the channel feature value; Calculating the weighted sum of the channel feature values of each color channel to obtain the corresponding brightness value as the image brightness value.

8. The method according to claim 7, wherein Filtering the target exposure value sequence through a preset filter to obtain the image exposure value of the image to be processed, including: Input the target exposure value sequence into the formula Perform filtering to obtain the image exposure value of the image to be processed. Here, h(k) is the filter coefficient, k is the period for obtaining the image to be processed, Yin is the target exposure value sequence, n is the length of the target exposure value sequence, N is the filter order, and Yout is the image exposure value.

9. The method according to any one of claims 1 to 6, characterized in that, Adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed, including: Determining an exposure parameter table including exposure levels and corresponding exposure parameters; Determining an adjustment level according to the exposure value difference between the image exposure value and the target exposure value; Determining the original level corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and determining the target level according to the original level and the adjustment level; Adjusting the exposure parameter of at least part of the area in the image to be processed to the exposure parameter of the target level and displaying the adjusted image to be processed.

10. The method according to claim 9, wherein Determining the adjustment level according to the exposure value difference between the image exposure value and the target exposure value includes: Input the exposure value difference of the current image to be processed into the formula Calculate the adjustment gear. Among them, D(t) is the exposure value difference of the current image to be processed, D(i) is the exposure value difference corresponding to the image to be processed obtained for the i-th time, and kp, ki, and kd are all preset regulation coefficients.

11. The method according to claim 9, wherein Determining the original level corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and determining the target level according to the original level and the adjustment level includes: Determining the original level corresponding to the exposure parameter of the current image to be processed in the exposure parameter table, and calculating the sum of the original level and the adjustment level to obtain a candidate level; In response to the candidate level being included in the exposure parameter table, determining the candidate level as the target level; In response to the maximum level in the exposure parameter table being less than the candidate level, determining the maximum level as the target level; In response to the minimum level in the exposure parameter table being greater than the candidate level, determining the minimum level as the target level.

12. The method according to claim 11, wherein The image to be processed is obtained through an endoscope. Adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes: In response to the endoscope having a corresponding light source and the maximum level in the exposure parameter table being less than the candidate level, increasing the light source brightness of the endoscope; In response to the endoscope having a corresponding light source and the minimum level in the exposure parameter table being greater than the candidate level, decreasing the light source brightness of the endoscope.

13. The method according to claim 12, characterized in that, Adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed further includes: In response to the endoscope not having a corresponding light source and the maximum level in the exposure parameter table being less than the candidate level, performing an inverse gamma operation on the image to be processed; In response to the endoscope not having a corresponding light source and the minimum level in the exposure parameter table being greater than the candidate level, performing an inverse gamma operation on the image to be processed and performing a gamma operation on the product of the result of the inverse gamma operation and the ratio of the target exposure value to the image exposure value.

14. The method according to claim 9, wherein Adjusting the exposure parameter of at least a part of the image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed includes: In response to the image to be processed being clicked by the user, adjusting the exposure parameter of the target area in the image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed; In response to the image to be processed not being clicked by the user, adjusting the exposure parameter of the whole image to be processed to the exposure parameter of the target gear and displaying the adjusted image to be processed.

15. An image processing apparatus, characterized in that, The device includes: An image acquisition module for acquiring and displaying the image to be processed multiple times; A brightness value determination module for determining the corresponding image brightness value according to the operation situation of the user on the image to be processed or the pixel value of the image to be processed each time the image to be processed is acquired; A sequence determination module for determining a historical brightness value sequence, where the historical brightness value sequence includes a preset initial brightness value and the image brightness values corresponding to the historically acquired images to be processed; An exposure value determination module for determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence; A parameter adjustment module for adjusting the exposure parameter of the image to be processed according to the image exposure value and displaying the adjusted image to be processed in response to the difference between the image exposure value and a preset target exposure value being greater than a difference threshold; Wherein, determining the image exposure value of the image to be processed according to the image brightness value and the historical brightness value sequence includes: Adding the image brightness value to the last position of the historical brightness value sequence to obtain a target exposure value sequence; Filtering the target exposure value sequence through a preset filter to obtain the image exposure value of the image to be processed.

16. An electronic device, characterized in that, Includes: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to implement the method according to any one of claims 1 to 14 when executing the instructions stored in the memory.

17. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that, The computer program instructions implement the method according to any one of claims 1 to 14 when executed by the processor.

Citation Information

Patent Citations

  • Endoscope camera and self-adaptive dynamic imaging method thereof

    CN110830731A

  • Image exposure imaging method, imaging device and readable storage medium

    CN114025082A