Brightness adjusting method and scanning equipment

By acquiring images in the scanning device, determining the metering area, generating a mask and adjusting the exposure parameters, the problem of low brightness adjustment efficiency of the scanning device is solved, and the optimal brightness adjustment is achieved.

CN119729225AActive Publication Date: 2025-03-28SHINING 3D TECH CO LTD

Patent Information

Application Number
CN202510240118.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-03-28
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

The existing scanning devices have low brightness adjustment efficiency and cannot ensure optimal brightness when scanning target objects.

Method used

By collecting the first image, the metering area is determined based on the preset area of ​​interest, and the object segmentation is performed to generate the object mask. If the gray value of the object mask is not within the preset range, the exposure parameters are adjusted based on the correlation between the gray value and the exposure parameters, so that they are within the preset range.

Benefits of technology

Improves the efficiency of brightness adjustment, ensures optimal brightness when scanning the target object, and avoids inefficiency in adjusting brightness with fixed step length.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729225A_ABST
    Figure CN119729225A_ABST
Patent Text Reader

Abstract

The invention provides a brightness adjusting method and scanning equipment, and the method comprises the steps: collecting a first image according to the current exposure parameter of the scanning equipment; based on a preset region of interest, determining a photometric region on the first image; performing object segmentation on the photometric area to generate an object mask; if the first gray value of the object mask is not in the preset gray range, the current exposure parameter is adjusted to be a target exposure parameter corresponding to a second gray value based on the incidence relation between the gray value and the exposure parameter, and the second gray value is in the preset gray range. According to the method, the brightness adjustment efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of display technology, and in particular to a brightness adjustment method and a scanning device. Background Art

[0002] When the scanning device is running, the automatic exposure mode is generally set for the camera module. In the automatic exposure mode, the camera module will automatically adjust the exposure parameters to meet the brightness requirements. However, the current automatic exposure mode usually adjusts the brightness in fixed steps, which is inefficient. In addition, the relevant technology has limitations in optimizing the brightness of the scanning target object. It can only ensure that the brightness in the area or at a certain point meets the brightness requirements, and cannot ensure the optimal brightness when scanning the target object. Summary of the invention

[0003] The embodiments of the present application disclose a brightness adjustment method and a scanning device, which solve the technical problems of low brightness adjustment efficiency in the related art and failure to ensure optimal brightness when scanning a target object.

[0004] The present application provides a brightness adjustment method, the method comprising: acquiring a first image according to a current exposure parameter of a scanning device; determining a photometric area on the first image based on a preset region of interest; performing object segmentation on the photometric area to generate an object mask; if a first grayscale value of the object mask is not within a preset grayscale range, based on a correlation between the grayscale value and the exposure parameter, adjusting the current exposure parameter to a target exposure parameter corresponding to a second grayscale value, the second grayscale value being within the preset grayscale range.

[0005] In some embodiments of the present application, adjusting the current exposure parameter to the target exposure parameter corresponding to the second grayscale value based on the association relationship between the grayscale value and the exposure parameter includes: determining a linear interval based on the association relationship; if the first grayscale value is within the linear interval, calculating a first adjustment ratio based on the first grayscale value and the second grayscale value; determining the target exposure parameter based on the first adjustment ratio and the current exposure parameter; and updating the current exposure parameter using the target exposure parameter.

[0006] In some embodiments of the present application, based on the association between the grayscale value and the exposure parameter, adjusting the current exposure parameter to the target exposure parameter corresponding to the second grayscale value includes: determining a linear interval and a nonlinear interval based on the association; if the first grayscale value is within the nonlinear interval, obtaining an intermediate grayscale value located in the linear interval based on a preset interval adjustment ratio and the first grayscale value; calculating a second adjustment ratio based on the intermediate grayscale value and the second grayscale value, the second grayscale value being within the preset grayscale range; determining the target exposure parameter based on the second adjustment ratio and the current exposure parameter; and updating the current exposure parameter using the target exposure parameter.

[0007] In some embodiments of the present application, determining the photometric area on the first image based on a preset region of interest includes: responding to a setting instruction for the region of interest, determining the coordinates of the region of interest in an image coordinate system; and determining the photometric area based on the coordinates.

[0008] In some embodiments of the present application, the object segmentation of the metering area to generate an object mask includes: determining a grayscale histogram according to pixel values ​​of the metering area; determining a main body within the metering area based on the grayscale histogram; and obtaining the object mask based on pixel positions of pixel points corresponding to the main body.

[0009] In some embodiments of the present application, determining the main part within the metering area based on the grayscale histogram includes: determining discrete data of pixel grayscale values ​​corresponding to the metering area based on the grayscale histogram, the discrete data including the distribution of the pixel grayscale values ​​within the metering area; determining the main body distribution information of the metering area according to the discrete data; if the main body distribution information represents that the metering area includes a single subject, taking the single subject as the main body part; if the main body distribution information represents that the metering area includes multiple subjects, determining the main body part from the multiple subjects based on a preset grayscale threshold.

[0010] In some embodiments of the present application, determining the main body part from the multiple bodies based on a preset grayscale threshold includes: dividing the metering area into a first sub-area greater than the grayscale threshold and a second sub-area less than or equal to the grayscale threshold based on the grayscale threshold and the grayscale histogram; obtaining a first proportion based on the first sub-area and the metering area; obtaining a second proportion based on the second sub-area and the metering area; if the first proportion is greater than the second proportion, taking the first sub-area as the main body part; if the second proportion is greater than the first proportion, taking the second sub-area as the main body part.

[0011] In some embodiments of the present application, the method also includes: obtaining a mask area corresponding to pixel points in the first image that are within the grayscale range; performing histogram equalization on the mask area to obtain a second image; coloring the second image using a preset color spectrum to obtain a third image, wherein the color spectrum is determined based on the conversion of the original color of the display interface to the color space; and displaying the third image through the display interface.

[0012] In some embodiments of the present application, the method further includes: acquiring a fourth image based on the target exposure parameters; updating the first image using the fourth image; obtaining a mask area corresponding to the fourth image, and continuing to perform a histogram equalization step on the mask area.

[0013] The present application also provides a scanning device, which includes a processor and a memory, and the processor is used to implement the brightness adjustment method when executing a computer program stored in the memory.

[0014] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the brightness adjustment method is implemented.

[0015] In the brightness adjustment method provided in the present application, according to the current exposure parameters of the scanning device, a first image is collected, and the first image is used to determine whether the current exposure parameters currently set by the scanning device meet the preset requirements. Based on the preset region of interest, a photometric area on the first image is determined, so as to determine whether the current exposure parameters meet the preset requirements through the photometric area. The photometric area is segmented to generate an object mask, and the object mask is extracted through a grayscale threshold to evaluate whether the first grayscale value of the object mask is within a preset grayscale range. If the first grayscale value is not within the preset grayscale range, based on the correlation between the grayscale value and the exposure parameter, the current exposure parameter is adjusted to the target exposure parameter corresponding to the second grayscale value, thereby improving the efficiency of brightness adjustment and avoiding adjusting the brightness based on a fixed step size. In addition, through the predetermined region of interest, it is possible to ensure that the brightness of the region of interest is optimal. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic diagram of the structure of the scanning device provided in an embodiment of the present application.

[0017] Figure 2 It is a flow chart of the brightness adjustment method provided in an embodiment of the present application.

[0018] Figure 3 It is a curve diagram of the correlation between grayscale value and exposure parameters provided in the embodiment of the present application.

[0019] Figure 4 It is a flowchart of adjusting the current exposure parameters to the target exposure parameters provided by an embodiment of the present application.

[0020] Figure 5 This is a curve diagram of the correlation between grayscale values ​​and exposure parameters provided by another embodiment of the present application. DETAILED DESCRIPTION

[0021] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given by way of example for reference.

[0022] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0023] When the scanning device is running, the automatic exposure mode is generally set for the camera module. In the automatic exposure mode, the camera module will automatically adjust the exposure parameters to meet the brightness requirements. However, the current automatic exposure mode usually adjusts the brightness in fixed steps, which is inefficient. In addition, the relevant technology has limitations in optimizing the brightness of the scanning target object. It can only ensure that the brightness in the area or at a certain point meets the brightness requirements, and cannot ensure the optimal brightness when scanning the target object.

[0024] In order to solve the technical problems of low brightness adjustment efficiency and inability to ensure optimal brightness when scanning the target object in the related art, the present application proposes a brightness adjustment method and a scanning device, which determines the photometric area on the first image through a preset area of ​​interest. By evaluating the grayscale value of the photometric area, the current exposure parameter is adjusted to the target exposure parameter, so that the brightness of the area of ​​interest is optimized, ensuring the optimal brightness when scanning the target object and meeting user needs. In addition, based on the correlation between the grayscale value and the exposure parameter, the efficiency of brightness adjustment can be improved, avoiding the use of a fixed step size to adjust the brightness. The structure of the scanning device is first described below.

[0025] Figure 1 Schematic diagram of the structure of the scanning device provided in the embodiment of the present application. Figure 1As shown, the scanning device 10 may include a display device 100, a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104 and a bus 105. The processor 103 is coupled to the display device 100, the communication interface 101, the memory 102, and the I / O interface 104 through the bus 105.

[0026] The display device 100 may be a touch screen, which is an inductive touch-sensitive liquid crystal display device. Alternatively, the display device 100 may be a non-touch screen. In addition, the display device 100 may be an external display screen of the scanning device 10, or the scanning device 10 may be connected to an electronic device (such as a computer) for communication, and the scanning device 10 displays the scanning result through a display device on the electronic device.

[0027] The communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as Universal Serial Bus (USB), Controller Area Network (CAN), etc. The wireless communication module may provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc. The memory 102 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 103, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0028] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.

[0029] The non-volatile memory may also store executable programs and user and application data, etc., and may be pre-loaded into the random access memory for direct reading and writing by the processor 103. The non-volatile memory may include a disk storage device and a flash memory.

[0030] The memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include a plurality of instructions, and when the plurality of instructions are executed by the processor 103, the brightness adjustment method executed on the scanning device 10 can be implemented.

[0031] In other embodiments, the scanning device 10 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the scanning device 10 .

[0032] The processor 103 may include one or more processing units, for example, the processor 103 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0033] The processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute a computer program stored in the memory 102 to implement the above-mentioned brightness adjustment method.

[0034] The I / O interface 104 is used to provide a channel for user input or output. For example, the I / O interface 104 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.

[0035] The bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , and the I / O interface 104 in the scanning device 10 .

[0036] The indication Figure 1 It is only an example of the scanning device 10 and does not constitute a limitation of the scanning device 10. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the scanning device 10 may also include input and output devices, network access devices, etc.

[0037] Figure 2 is a flowchart of a brightness adjustment method provided in an embodiment of the present application, which is applied to a scanning device (eg Figure 1 According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

[0038] Step S201: acquiring a first image according to current exposure parameters of a scanning device.

[0039] In some embodiments of the present application, in order to improve the accuracy of the scanning device, the scanning device can be fixed at a specified position. In actual application scenarios, the scanning device can also perform mobile scanning as required, and the present application does not limit the state of the scanning device during scanning.

[0040] The scanning device may include a display device, and a display interface for realizing user interaction may be displayed on the display device. A plurality of controls may be provided on the display interface, and each control has a corresponding function. For example, a start control is used to trigger the scanning device to wake up an internal program and start running, and a mode setting control is used to set the running mode of the scanning device. In another embodiment, a plurality of physical buttons may also be provided on the scanning device, and when the scanning device detects that any physical button is triggered, the scanning device executes the operation corresponding to the any physical button. For example, when the device start button is triggered, the scanning device wakes up the internal program and starts running, and when the mode setting physical button is triggered, the scanning device enters the mode corresponding to the mode setting physical button.

[0041] After the scanning device is started, in order to improve the operating efficiency of the scanning device, it can be operated based on the historical setting parameters of the scanning device. The historical setting parameters of the scanning device may include an operating mode, a scanning parameter, etc. For example, when the historical setting parameters of the scanning device include an automatic exposure mode, after the scanning device is currently started, the scanning device may automatically turn on the automatic exposure mode.

[0042] When the scanning device enters the automatic exposure mode, the scanning device can automatically set the initial exposure parameters and use the initial exposure parameters as the current exposure parameters. The initial exposure parameters can be randomly set according to the current scene and the characteristics of the scanned object, or can be set according to historical setting parameters. This application does not limit the setting method of the initial exposure parameters. In addition, when the scanning device enters the automatic exposure mode, the exposure parameters can be dynamically adjusted according to the current scene and the characteristics of the scanned object, and the exposure parameters adjusted in real time can be used as the current exposure parameters.

[0043] In some embodiments of the present application, the scanning device can capture a first image under current exposure parameters in real time during operation, so as to effectively adjust the exposure parameters of the scanning device by subsequently analyzing the first image.

[0044] Step S202: determining a light measurement area on the first image based on a preset region of interest.

[0045] In some embodiments of the present application, the scanning device may include a display device, on which a display interface for implementing user interaction may be displayed, and the user may perform operations such as clicking and sliding on the display interface. When the scanning device detects a setting instruction triggered by a setting operation on the display interface, the region of interest set by the setting operation may be determined.

[0046] The shape of the region of interest may be circular, rectangular or polygonal. The shape and size of the region of interest may be randomly set on the display interface, and the position of the region of interest on the display interface may be dragged. There is no restriction on the shape, size, and position of the region of interest on the display interface, and they may be set according to actual needs.

[0047] In some embodiments of the present application, after the scanning device determines the region of interest, the coordinates of the region of interest in the image coordinate system can be obtained. The image coordinate system can be set based on the scanning range of the scanning device, and the image coordinate system corresponding to the region of interest and the image coordinate system corresponding to the first image can be the same image coordinate system. Based on the coordinates of the region of interest in the image coordinate system, the photometric area can be determined on the first image. Among them, if the region of interest is a circular area, the photometric area is also a circular area, and if the region of interest is a rectangular area, the photometric area is also a rectangular area. The present application does not limit the shape of the region of interest.

[0048] In one example, assuming that the region of interest is a rectangular region, and the four vertex coordinates are (10, 15), (20, 15), (20, 20), (10, 20). The scanning device can determine the photometric region on the first image according to (10, 15), (20, 15), (20, 20), (10, 20), and the vertex coordinates of the photometric region are (10, 15), (20, 15), (20, 20), (10, 20).

[0049] In some other embodiments of the present application, the scanning device can be connected to an electronic device having a display interface, and the user can perform setting operations such as clicking and sliding on the display interface of the electronic device. When the user performs a setting operation on the display interface of the electronic device, the electronic device can send the region of interest indicated by the setting operation to the scanning device through a setting instruction. The scanning device receives the setting instruction and obtains the region of interest by parsing the setting instruction.

[0050] Among them, since the device coordinate system of the region of interest on the display interface of the electronic device is different from the image coordinate system of the first image, the coordinates of the region of interest in the device coordinate system can be converted to the image coordinate system to determine the coordinates of the region of interest in the image coordinate system.

[0051] Specifically, the scanning device obtains the resolution of the electronic device from the setting instruction. According to the resolution of the electronic device, the resolution of the first image, and the coordinates of the region of interest in the device coordinate system, a coordinate conversion ratio is obtained. According to the coordinate conversion ratio, the coordinates of the region of interest in the device coordinate system are converted to the image coordinate system, and the scanning device can determine the photometric area according to the coordinates of the region of interest in the image coordinate system.

[0052] Step S203, performing object segmentation on the light metering area to generate an object mask.

[0053] In some embodiments of the present application, after the photometric area is determined, the pixel grayscale value of each pixel in the photometric area can be obtained. A grayscale histogram is constructed according to the pixel grayscale values. According to the grayscale histogram, discrete data of the pixel grayscale values ​​corresponding to the photometric area can be determined, and the discrete data includes the distribution of the pixel grayscale values ​​in the photometric area. Specifically, according to the grayscale histogram, the mean and median of the pixel grayscale values ​​of the pixel points in the entire photometric area can be counted. According to the difference between the mean and the median, the discrete data is determined. If the difference between the mean and the median is less than a preset difference threshold, it means that the mean and the median are close and the degree of discreteness is small, and the discrete data can be recorded as the degree of discreteness is less than the preset discrete threshold. If the difference between the mean and the median is greater than or equal to the preset difference threshold, it means that the mean and the median are greatly different and the degree of discreteness is large, and the discrete data can be recorded as the degree of discreteness is greater than or equal to the preset discrete threshold.

[0054] In addition, the standard deviation between each pixel point and the mean value in the light metering area can be calculated, and the discrete data can be determined by the standard deviation. If the standard deviation is greater than the preset standard deviation threshold, it means that the distribution of the pixel grayscale values ​​is relatively dispersed, and the discrete data can be recorded as the degree of dispersion being greater than or equal to the preset discrete threshold. If the standard deviation is less than or equal to the preset standard deviation threshold, it means that the pixel grayscale values ​​are relatively concentrated near the mean value and the degree of dispersion is small, and the discrete data can be recorded as the degree of dispersion being less than the preset discrete threshold.

[0055] In some embodiments of the present application, after the discrete data is determined, the subject distribution information of the light metering area can be determined according to the discrete data. Specifically, if the discrete degree represented by the discrete data is less than a preset discrete threshold, it is determined that the light metering area includes a single subject, and the subject distribution information can be represented as the light metering area including a single subject. In the case where the light metering area includes a single subject, the single subject is regarded as the subject part.

[0056] If the discrete data represents a discrete degree greater than or equal to a preset discrete threshold, it is determined that the photometric area includes multiple subjects, and the subject distribution information can be characterized as the photometric area including multiple subjects. In the case where the photometric area includes multiple subjects, the subject part can be determined from the multiple subjects based on a preset grayscale threshold.

[0057] Specifically, based on the grayscale threshold and the grayscale histogram, the photometric area is divided into a first sub-area greater than the grayscale threshold and a second sub-area less than or equal to the grayscale threshold. Based on the first sub-area and the photometric area, a first proportion of the first sub-area in the photometric area is calculated. Based on the second sub-area and the photometric area, a second proportion of the second sub-area in the photometric area is calculated. If the first proportion is greater than the second proportion, the first sub-area is used as the main part of the photometric area. If the second proportion is greater than the first proportion, the second sub-area is used as the main part of the photometric area. If the first proportion is the same as the second proportion, the first sub-area or the second sub-area is randomly used as the main part of the photometric area.

[0058] After the main part of the light metering area is determined, the pixel positions of the pixels corresponding to the main part are extracted to generate an object mask.

[0059] Step S204: if the first grayscale value of the object mask is not within the preset grayscale range, based on the association between the grayscale value and the exposure parameter, the current exposure parameter is adjusted to a target exposure parameter corresponding to the second grayscale value.

[0060] In some embodiments of the present application, based on the Gaussian weight rule, the normalized weighted grayscale under the object mask is calculated and recorded as the first grayscale value. If the first grayscale value is not within the preset grayscale range, it means that the brightness of the metering area under the current exposure parameters does not meet the preset requirements, that is, the main body brightness of the metering area is not optimal. In the case where the first grayscale value is not within the preset grayscale range, the correlation relationship between the grayscale value and the exposure parameter is obtained. The correlation relationship can be presented by a relationship curve, and the linear interval and the nonlinear interval can be driven by the relationship curve. Figure 3 Describe. Figure 3 In the coordinate system shown, the abscissa represents the exposure parameter Exp, the ordinate represents the gray value Gray, and the relationship curve includes a linear interval and a nonlinear interval.

[0061] By determining whether the first gray value is in a linear interval or a nonlinear interval, the current exposure parameter is adjusted to a target exposure parameter corresponding to the second gray value using a corresponding interval rule, wherein the second gray value is within a preset gray range. How to adjust the current exposure parameter to the target exposure parameter corresponding to the second gray value based on the interval rule can be referred to in Figure 4 The embodiment shown.

[0062] Based on the above embodiment, according to the current exposure parameters of the scanning device, a first image is collected, and the first image is used to determine whether the current exposure parameters currently set by the scanning device meet the preset requirements. Based on the preset region of interest, a photometric area on the first image is determined, so as to determine whether the current exposure parameters meet the preset requirements through the photometric area. The photometric area is segmented to generate an object mask, and the object mask is extracted through a grayscale threshold to evaluate whether the first grayscale value of the object mask is within a preset grayscale range. If the first grayscale value is not within the preset grayscale range, based on the correlation between the grayscale value and the exposure parameter, the current exposure parameter is adjusted to the target exposure parameter corresponding to the second grayscale value, thereby improving the efficiency of brightness adjustment and avoiding brightness adjustment based on a fixed step size. In addition, through the predetermined region of interest, it can be ensured that the brightness of the region of interest is optimal.

[0063] In other embodiments of the present application, after the scanning device captures the first image, the first image can be processed to be displayed on the display interface. Specifically, the pixel points in the first image that belong to the grayscale range are obtained, and the area corresponding to the pixel is used as the mask area. The mask area is histogram equalized to adjust the contrast of the mask area on the first image to obtain the second image. The second image is colored using a preset color spectrum to obtain a third image. It is expressed as follows: I(x,y) = Cmap(h, s, H(x,y)), where Cmap represents the color spectrum, which is generated by converting the original color C of the display interface to the color space HSV; h represents hue; s represents saturation; H(x,y) represents the second image; and I(x,y) represents the third image. Among them, the display interface can be a display interface on a scanning device, or a display interface on an electronic device that is communicatively connected to the scanning device. After the third image is determined, the third image is displayed on the display interface.

[0064] Wherein, if the display interface is a display interface of an electronic device, the scanning device can send the first image to the electronic device after acquiring the first image. After receiving the first image, the electronic device adjusts the contrast, hue, saturation, etc. of the first image in the above manner, thereby displaying the third image on the display interface of the electronic device. By generating the third image on the electronic device, the amount of calculation of the scanning device is reduced.

[0065] In some embodiments of the present application, since the image displayed on the display interface is real-time, after adjusting the current exposure parameter to the target exposure parameter, a fourth image is acquired based on the target exposure parameter. The first image is replaced with the fourth image. The mask area of ​​the fourth image is acquired, and then the fourth image is processed by adjusting the contrast, hue, saturation, etc., so that the processed fourth image is displayed on the display interface.

[0066] Figure 4 is a flowchart of adjusting the current exposure parameters to the target exposure parameters provided by an embodiment of the present application. Figure 2 The relationship between the grayscale value and the exposure parameter shown in FIG. 1 determines the linear interval and the nonlinear interval, such as Figure 5 Based on the linear interval and the nonlinear interval, a specific method of adjusting the current exposure parameter to the target exposure parameter can be determined, including the following steps.

[0067] Step S401, determining a linear interval and a nonlinear interval based on the association relationship.

[0068] In some embodiments of the present application, the correlation between the grayscale value and the exposure parameter can be preset. The correlation between the grayscale value and the exposure parameter can also be established by collecting an image of a preset time length in the current scanning scene, thereby constructing a relationship curve by analyzing the grayscale value of the image and the exposure parameter for collecting the image. Based on the relationship curve, a linear interval and a nonlinear interval can be divided. Figure 5 As shown, based on the relationship curve determined based on the correlation between the gray value and the exposure parameter, the linear interval and the nonlinear interval can be determined.

[0069] Step S402, determining whether the first gray value is within a linear interval.

[0070] In some embodiments of the present application, if the first grayscale value is within the linear interval, step S403 is performed. If the first grayscale value is not within the linear interval, it means that the first grayscale value is within the nonlinear interval, and step S405 is performed.

[0071] Step S403, calculating a first adjustment ratio according to the first gray value and the second gray value.

[0072] In some embodiments of the present application, if the first grayscale value is within the linear interval, the first adjustment ratio can be calculated according to a linear rule. Figure 5 As shown, point A2 is located in the linear interval, and the first adjustment ratio P1=G / B2 can be calculated according to the first gray value B2 and the second gray value G.

[0073] Step S404: determining a target exposure parameter according to the first adjustment ratio and the current exposure parameter.

[0074] In some embodiments of the present application, the target exposure parameter is calculated according to the first adjustment ratio and the current exposure parameter. Figure 5 As shown, the first adjustment ratio P1=G / B2, the current exposure parameter is C2, and the target exposure parameter C=(G / B2)×C2. The current parameter C2 is adjusted to the target exposure parameter C, so that the gray value of the image collected under the target exposure parameter C is G.

[0075] After the target exposure parameters are determined, the process may jump to step S408 .

[0076] Step S405 , obtaining an intermediate gray value in a linear interval based on a preset interval adjustment ratio and the first gray value.

[0077] In some embodiments of the present application, if the first gray value is within the nonlinear interval, the intermediate gray value in the linear interval can be calculated according to the nonlinear rule. The preset interval adjustment ratio can be the ratio of converting from the nonlinear interval to the linear interval, which can be set according to the actual scene. According to the interval adjustment ratio and the first gray value, the intermediate gray value in the linear interval can be obtained. Figure 5 As shown, assuming that the interval adjustment ratio is K, the first gray value B1 of point A1 is transformed to the middle gray value B2 of the linear interval, which is expressed by the formula B2=B1×K.

[0078] Step S406, calculating a second adjustment ratio according to the middle gray value and the second gray value.

[0079] In some embodiments of the present application, since the intermediate gray value is within the linear interval, the second adjustment ratio can be calculated according to a linear rule. Figure 5 As shown, point A2 is located in the linear interval, and the second adjustment ratio P2=G / B2 can be calculated according to the first gray value B2 and the second gray value G.

[0080] Step S407: determining a target exposure parameter according to the second adjustment ratio and the current exposure parameter.

[0081] In some embodiments of the present application, the target exposure parameter is calculated according to the second adjustment ratio and the current exposure parameter. Figure 5 As shown, the second adjustment ratio P2=G / B2, the current exposure parameter is C1, and the target exposure parameter C=(G / B2)×C1. Then the current parameter C1 is adjusted to the target exposure parameter C, so that the gray value of the image collected under the target exposure parameter C is G.

[0082] Step S408: Update the current exposure parameters using the target exposure parameters.

[0083] In some embodiments of the present application, after the target exposure parameter is determined, only one step is needed to adjust from the current exposure parameter to the target exposure parameter, so that the current grayscale value reaches the target grayscale value (i.e., the second grayscale value). Compared with the related art that adjusts slowly based on a preset fixed step size, the solution described in the embodiments of the present application has higher efficiency.

[0084] Based on the above embodiments, when the first grayscale value is not within the preset grayscale range, the current exposure parameter can be quickly adjusted to the target exposure parameter through the rule of the linear interval or the rule of the nonlinear region, avoiding slow adjustment based on a fixed step size.

[0085] In one example, the second grayscale value is 150, the first grayscale value is 50, and the related technology is used to adjust with a fixed step size of 50, and it is necessary to adjust from 50-100-150. However, the adjustment method described in the present application can be directly adjusted from 50 to 150.

[0086] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.

[0087] The computer-readable storage medium may be an internal memory of the scanning device of the above-mentioned embodiment, such as a hard disk or memory of the scanning device. The computer-readable storage medium may also be an external storage device of the scanning device, such as a plug-in hard disk equipped on the scanning device, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc.

[0088] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the scanning device, etc.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0091] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0093] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A brightness adjustment method, characterized in that: The method comprises: Acquire a first image according to current exposure parameters of the scanning device; Based on a preset region of interest, determining a light metering area on the first image; Performing object segmentation on the photometric area to generate an object mask; If the first grayscale value of the object mask is not within the preset grayscale range, based on the association between the grayscale value and the exposure parameter, the current exposure parameter is adjusted to a target exposure parameter corresponding to a second grayscale value, and the second grayscale value is within the preset grayscale range.

2. The brightness adjustment method according to claim 1, characterized in that: The adjusting the current exposure parameter to a target exposure parameter corresponding to the second gray value based on the association relationship between the gray value and the exposure parameter includes: Determine a linear interval based on the association relationship; If the first gray value is within the linear interval, calculating a first adjustment ratio according to the first gray value and the second gray value; determining the target exposure parameter according to the first adjustment ratio and the current exposure parameter; The current exposure parameter is updated using the target exposure parameter.

3. The brightness adjustment method according to claim 1, characterized in that: The adjusting the current exposure parameter to a target exposure parameter corresponding to the second gray value based on the association relationship between the gray value and the exposure parameter includes: Based on the association relationship, a linear interval and a nonlinear interval are determined; If the first gray value is within the nonlinear interval, an intermediate gray value within the linear interval is obtained based on a preset interval adjustment ratio and the first gray value; Calculating a second adjustment ratio according to the intermediate gray value and a second gray value, wherein the second gray value is within a preset gray range; determining the target exposure parameter according to the second adjustment ratio and the current exposure parameter; The current exposure parameter is updated using the target exposure parameter.

4. The brightness adjustment method according to claim 1, characterized in that: The step of determining the light measurement area on the first image based on the preset region of interest includes: In response to an instruction for setting the region of interest, determining coordinates of the region of interest in an image coordinate system; The light metering area is determined based on the coordinates.

5. The brightness adjustment method according to claim 1, characterized in that: The step of performing object segmentation on the light metering area to generate an object mask comprises: Determining a grayscale histogram according to the pixel values ​​of the light metering area; Determining a subject portion within the photometric area based on the grayscale histogram; The object mask is obtained based on the pixel positions of the pixel points corresponding to the main part.

6. The brightness adjustment method according to claim 5, characterized in that: The determining the main part within the light metering area based on the grayscale histogram comprises: Based on the grayscale histogram, determining discrete data of the pixel grayscale values ​​corresponding to the light metering area, the discrete data including the distribution of the pixel grayscale values ​​in the light metering area; Determine subject distribution information of the photometric area according to the discrete data; If the subject distribution information indicates that the photometric area includes a single subject, the single subject is used as the subject part; If the subject distribution information represents that the light metering area includes a plurality of subjects, the subject portion is determined from the plurality of subjects based on a preset grayscale threshold.

7. The brightness adjustment method according to claim 6, characterized in that: The determining the subject part from the plurality of subjects based on a preset grayscale threshold comprises: Based on the grayscale threshold and the grayscale histogram, the light metering area is divided into a first sub-area greater than the grayscale threshold and a second sub-area less than or equal to the grayscale threshold; Based on the first sub-area and the light measurement area, a first proportion is obtained; Based on the second sub-area and the light measuring area, a second proportion is obtained; If the first proportion is greater than the second proportion, the first sub-area is used as the main body; If the second proportion is greater than the first proportion, the second sub-area is used as the main body.

8. The brightness adjustment method according to claim 1, characterized in that: The method further comprises: Acquire a mask area corresponding to pixels in the first image that are within the grayscale range; Performing histogram equalization on the mask area to obtain a second image; Assigning color to the second image using a preset color spectrum to obtain a third image, wherein the color spectrum is determined according to the conversion of the original color of the display interface into the color space; The third image is displayed through the display interface.

9. The brightness adjustment method according to claim 8, characterized in that: The method further comprises: Based on the target exposure parameter, acquiring a fourth image; updating the first image using the fourth image; A mask area corresponding to the fourth image is obtained, and the step of performing histogram equalization on the mask area is continued.

10. A scanning device, characterized in that: The scanning device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the brightness adjustment method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Image Capturing Apparatus And Control Method Thereof

    CN103888644A

  • Photometry method and device

    CN104219518A

  • Determination method and determination device for exposure time of image acquisition equipment and processor

    CN111432134A

  • Video image exposure adjusting method

    CN113923376A

  • Automatic exposure method for improving mobile scanning effect of scanning head

    CN114302066A

Cited By

  • Brightness adjustment method, and scanning device

    WO2026184514A1