Shooting method and device and electronic equipment

By automatically adjusting the exposure time and gain parameters in the image acquisition system, the inefficiency and reliability problems caused by manual adjustment are solved, and high-quality image acquisition and production efficiency are improved.

CN119071640APending Publication Date: 2024-12-03BEIJING LUSTER LIGHTTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411169040.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In industrial production, due to the lack of automatic image brightness adjustment technology, the image acquisition system requires manual adjustment of parameters such as camera exposure time, which reduces operating efficiency and reliability.

Method used

By obtaining the brightness of the current image, adjusting the exposure time and gain parameters of the next image according to the gain parameters and exposure time until the brightness is in the target brightness range, and automatic adjustment is achieved.

Benefits of technology

It improves the performance and reliability of the image acquisition system, reduces manual intervention, reduces system complexity, and improves detection accuracy and production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071640A_ABST
    Figure CN119071640A_ABST
Patent Text Reader

Abstract

The invention discloses a shooting method and device and electronic equipment, and belongs to the technical field of industrial machine vision. The method comprises the following steps: acquiring the brightness of a current image; and determining a gain parameter and exposure time for shooting a next image according to the gain parameter, the exposure time and at least one shooting parameter of the current image under the condition of determining that the brightness of the current image is not in the target brightness interval, and shooting the next image according to the gain parameter and the exposure time of the next image. The brightness of the next image is in the target brightness interval; and outputting the image in the target brightness interval. According to the method and the device, setting of parameters such as exposure time of the camera can be accurately adjusted in real time so as to adapt to various illumination conditions, acquisition of high-quality images is ensured, the production efficiency is improved, manual intervention is reduced, the system complexity is reduced, and the detection accuracy and the system stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of industrial machine vision technology, and in particular, relates to a shooting method, device and electronic equipment. Background Art

[0002] Image acquisition systems play a vital role in industrial production quality control and scientific research. However, without automatic image brightness adjustment technology, camera exposure time and other parameter settings need to be adjusted manually. However, manual adjustment and debugging takes a long time, reducing overall operating efficiency and reliability. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a shooting method, device and electronic device, which can quickly and accurately adjust the exposure time and gain parameters of the camera to quickly adjust the brightness of the image to the target brightness range.

[0004] In a first aspect, the present application provides a shooting method, the method comprising:

[0005] Get the brightness of the current image;

[0006] When it is determined that the brightness of the current image is not within the target brightness range, determine the gain parameter and exposure time for shooting a next image according to the gain parameter, exposure time and at least one shooting parameter of the current image, and shoot the next image according to the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range;

[0007] Output an image that is in the target brightness range.

[0008] According to the shooting method of the present application, when it is determined that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined according to the gain parameter, exposure time and at least one shooting parameter of the current image, and the next image is shot according to the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range, and an image within the target brightness range is output, thereby achieving real-time and accurate adjustment of the exposure time and other parameter settings of the camera to adapt to various lighting conditions, ensuring the acquisition of high-quality images, improving production efficiency, reducing manual intervention, reducing system complexity, and improving detection accuracy and system stability. By applying automatic image brightness adjustment technology, the performance and reliability of industrial image acquisition systems can be significantly improved to meet the needs of modern industrial automation production and scientific research.

[0009] According to one embodiment of the present application, the shooting parameters include a target gain parameter;

[0010] Determining a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time, and at least one shooting parameter of a current image includes:

[0011] When it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, comparing the gain parameter of the current image with the target gain parameter;

[0012] When it is determined that the gain parameter of the current image is greater than the target gain parameter, the target gain parameter is used as the gain parameter of the next image;

[0013] The exposure time of the current image is used as the exposure time of the next image.

[0014] According to an embodiment of the present application, the shooting parameters also include a lower limit of camera exposure time and an upper limit of exposure time adjustment;

[0015] After comparing the gain parameter of the current sheet with the target gain parameter, the method further includes:

[0016] When it is determined that the gain parameter of the current image is not greater than the target gain parameter, comparing the exposure time of the current image with the lower limit of the camera exposure time;

[0017] When it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the average of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is used as the exposure time of the next image;

[0018] The gain parameter of the current image is used as the gain parameter of the next image.

[0019] According to one embodiment of the present application, the shooting parameters also include a camera gain parameter lower limit and a gain parameter adjustment upper limit;

[0020] After comparing the exposure time of the current image with the lower limit of the camera exposure time, the method further includes:

[0021] When it is determined that the exposure time of the current image is not greater than the lower limit of the camera exposure time, the gain parameter of the current image is compared with the lower limit of the camera gain parameter;

[0022] When it is determined that the gain parameter of the current image is greater than the lower limit of the camera gain parameter, the average value between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is used as the gain parameter of the next image;

[0023] The exposure time of the current image is used as the exposure time of the next image.

[0024] According to one embodiment of the present application, after taking the average of the camera exposure time lower limit and the exposure time adjustment upper limit as the exposure time of the next image, the method further includes:

[0025] The exposure time of the next image is used as the new upper limit of exposure time adjustment;

[0026] After taking the average of the camera gain parameter lower limit and the gain parameter adjustment upper limit as the gain parameter of the next image, the method further includes:

[0027] The gain parameter of the next image is used as the upper limit of gain parameter adjustment.

[0028] According to an embodiment of the present application, the shooting parameters also include an upper limit of the camera exposure time;

[0029] Determining a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time, and at least one shooting parameter of a current image includes:

[0030] When it is determined that the brightness of the current image is not greater than the upper limit of the target brightness range, comparing the exposure time of the current image with the upper limit of the camera exposure time;

[0031] When it is determined that the exposure time of the current image is less than the upper limit of the camera exposure time, the median of the target brightness range is determined;

[0032] Obtaining a first exposure amount according to a median value of a target brightness range and an exposure time;

[0033] Obtaining an exposure time for a next image according to the first exposure amount and the brightness of the current image;

[0034] The gain parameter of the current image is used as the gain parameter of the next image.

[0035] According to one embodiment of the present application, the shooting parameters also include an upper limit of a camera gain parameter;

[0036] After comparing the exposure time of the current image with the upper limit of the camera exposure time, the method further includes:

[0037] When it is determined that the exposure time of the current image is not less than the upper limit of the camera exposure time, the gain parameter of the current image is compared with the upper limit of the camera gain parameter;

[0038] When it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, obtaining a first brightness according to the median of the target brightness interval and the gain parameter of the current image;

[0039] A gain parameter of a next image is obtained according to the first brightness and the brightness of the current image.

[0040] According to an embodiment of the present application, obtaining the brightness of the current image includes:

[0041] Generate a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level;

[0042] Search each pixel level in descending order until the target pixel level is found; by the target pixel level, the accumulated number of pixel points of each pixel level that has been searched exceeds the first target number;

[0043] According to the pixel value interval corresponding to the target pixel level, the brightness of the current image is obtained.

[0044] According to an embodiment of the present application, before generating a histogram corresponding to the target area in the current image, the method further includes:

[0045] The first target quantity is determined based on the following method:

[0046] Determine the target area corresponding to the current image;

[0047] Determine the number of pixels in the target area;

[0048] The smaller value of the number of pixels in the target area and the second target number is taken as the third target number.

[0049] The first target quantity is obtained according to the third target quantity and the target value.

[0050] In a second aspect, the present application provides a photographing device, the device comprising: a first processing module, configured to obtain brightness of a current image;

[0051] A second processing module, for determining, when the brightness of the current image is not within the target brightness range, a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time and at least one shooting parameter of the current image, until the brightness of the next image is within the target brightness range;

[0052] The third processing module is used to output an image in a target brightness range.

[0053] According to the shooting device of the present application, when it is determined that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined according to the gain parameter, exposure time and at least one shooting parameter of the current image, and the next image is shot according to the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range, and an image within the target brightness range is output, thereby achieving real-time and accurate adjustment of the exposure time and other parameter settings of the camera to adapt to various lighting conditions, ensuring the acquisition of high-quality images, improving production efficiency, reducing manual intervention, reducing system complexity, and improving detection accuracy and system stability. By applying automatic image brightness adjustment technology, the performance and reliability of industrial image acquisition systems can be significantly improved to meet the needs of modern industrial automation production and scientific research.

[0054] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the shooting method as described in the first aspect above is implemented.

[0055] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the shooting method as described in the first aspect above is implemented.

[0056] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the shooting method as described in the first aspect.

[0057] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the shooting method described in the first aspect above.

[0058] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0059] By determining that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined according to the gain parameter, exposure time and at least one shooting parameter of the current image, and the next image is shot according to the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range, and the image within the target brightness range is output, so that the exposure time and other parameter settings of the camera can be adjusted in real time and accurately to adapt to various lighting conditions, ensure the acquisition of high-quality images, improve production efficiency, reduce manual intervention, reduce system complexity, and improve detection accuracy and system stability. By applying automatic image brightness adjustment technology, the performance and reliability of industrial image acquisition systems can be significantly improved to meet the needs of modern industrial automation production and scientific research.

[0060] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0062] Figure 1 This is one of the flowcharts of the shooting method provided in the embodiment of the present application;

[0063] Figure 2 This is the second flow chart of the shooting method provided in the embodiment of the present application;

[0064] Figure 3 is a schematic diagram of a process for determining the brightness of a current image provided by an embodiment of the present application;

[0065] Figure 4 This is the third flow chart of the shooting method provided in the embodiment of the present application;

[0066] Figure 5 is a schematic diagram of the structure of a photographing device provided in an embodiment of the present application;

[0067] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0069] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0070] The following, in conjunction with the accompanying drawings, describes in detail the shooting method, shooting device, electronic device and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0071] The shooting method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0072] The shooting method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the shooting method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The shooting method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.

[0073] like Figure 1 As shown, the shooting method includes: step 110, step 120 and step 130.

[0074] Step 110: Obtain the brightness of the current image.

[0075] The shooting method provided in the embodiment of the present application can be applied to a shooting device, which can be a camera, a mobile phone, a computer, a wearable device, etc., without limitation.

[0076] Before formal shooting in the embodiment of the present application, the system can be initialized to obtain the configuration parameters of the camera. The configuration parameters of the camera include but are not limited to the camera gain parameter upper limit, the camera gain parameter lower limit, the camera exposure time upper limit and the camera exposure time lower limit.

[0077] In the embodiment of the present application, the brightness of the current image is determined according to the pixel value of each pixel in the current image. The current image can be a grayscale image or a color image, and there is no limitation on this.

[0078] After acquiring the current image, the embodiment of the present application may perform a filtering operation on the acquired current image, and this embodiment adopts mean filtering.

[0079] In the embodiment of the present application, the current image includes a target area, and the target area can be an area of ​​interest selected by the user or an area set by a program, and there is no limitation on this.

[0080] After determining the target area in the current image, the embodiment of the present application needs to determine the number of pixels in the target area and obtain a preset second target number. The second target number is a preset threshold. It is necessary to compare the size relationship between the number of pixels in the target area and the second target number, and take the smaller value of the number of pixels in the target area and the second target number as the third target number.

[0081] The target value can be any number less than the third target number, such as 1 / 2, 1 / 3, or it can be a specific number, such as 2, 3, 10, 20, etc., without limitation.

[0082] After determining the third target quantity, the first target quantity is obtained based on the third target quantity and the target value. Specifically, when the target value is a fraction, the product of the third target quantity and the target value can be used as the first target quantity. When the target value is a smaller integer (for example, less than 5), the ratio of the third target quantity to the target value can be used as the first target quantity. When the target value is a larger integer (for example, 20), the difference between the two can be used as the first target quantity.

[0083] The number of target areas may be one or more, and there is no limitation on this.

[0084] The embodiment of the present application can generate a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level; each pixel level is searched in descending order until the target pixel level is found; as of the target pixel level, the cumulative number of pixels of each pixel level that has been searched exceeds (is not less than) the first target number; the brightness of the current image is obtained according to the pixel value or pixel interval corresponding to the target pixel level. When each pixel level corresponds to a pixel value, the pixel value can represent the brightness corresponding to the pixel level, and when each pixel level corresponds to a pixel value interval, the median of the pixel value interval can be used as the brightness of the pixel level.

[0085] For grayscale images, pixel values ​​are grayscale values, which can be searched from the histogram in descending order of grayscale levels. Each grayscale level corresponds to a grayscale value interval. The number of pixels is continuously accumulated during the search process until the target grayscale level is found. The number of pixels accumulated by the target number exceeds the first target number. At this time, the brightness corresponding to the target grayscale level is the brightness of the current image.

[0086] Step 120, when it is determined that the brightness of the current image is not within the target brightness range, determine the gain parameter and exposure time for shooting the next image based on the gain parameter, exposure time and at least one shooting parameter of the current image, and shoot the next image based on the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range.

[0087] In the embodiment of the present application, the target brightness interval may refer to a preset expected brightness interval. After determining the brightness of the current image, it is necessary to determine whether the brightness of the current image is within the target brightness interval.

[0088] When it is determined that the brightness of the current image is within the target brightness range, it means that the brightness of the current image meets the requirement, and the image within the target brightness range is directly output.

[0089] In the case where it is determined that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined in combination with the gain parameter, exposure time and at least one shooting parameter of the current image, the at least one shooting parameter including but not limited to at least part of the gain parameter adjustment upper limit, the gain parameter adjustment lower limit, the camera gain parameter upper limit, the camera gain parameter lower limit, the target gain parameter, the exposure time adjustment upper limit, the camera exposure time upper limit and the camera exposure time lower limit. After determining the gain parameter and exposure time of the next image, shoot the next image according to the gain parameter and exposure time of the next image, and determine the brightness of the next image until the brightness of the next image is within the target brightness range.

[0090] The lower limit of the camera exposure time in the embodiment of the present application refers to the minimum value of the parameter of the camera system that controls the length of time the camera sensor receives light. The lower limit of the camera exposure time is related to the camera model and is a fixed value.

[0091] The camera exposure time upper limit of the embodiment of the present application refers to the maximum value of the parameter of the camera system that controls the length of time the camera sensor receives light. The camera exposure time upper limit is related to the camera model and is a fixed value.

[0092] The exposure time adjustment upper limit of the embodiment of the present application refers to the maximum value of the parameter set by the camera sensor to control the length of time the camera sensor receives light. The exposure time adjustment upper limit is variable and can be adjusted by the camera sensor. The initial value of the exposure time adjustment upper limit is the camera exposure time upper limit.

[0093] The exposure time adjustment lower limit of the embodiment of the present application refers to the minimum value of the parameter set by the camera sensor to control the length of time the camera sensor receives light. The exposure time adjustment lower limit is variable and can be adjusted by the camera sensor. The initial value of the exposure time adjustment lower limit is the camera exposure time lower limit.

[0094] The camera gain parameter upper limit in the embodiment of the present application refers to the maximum value that can be set when the sensitivity is increased by the camera system. The camera gain parameter upper limit is related to the camera model and is a fixed value.

[0095] The camera gain parameter lower limit in the embodiment of the present application refers to the minimum value that can be set when increasing the sensitivity of the camera system. The camera gain parameter lower limit is related to the camera model and is a fixed value.

[0096] The gain parameter adjustment upper limit of the embodiment of the present application refers to the maximum value that can be set when the sensitivity is increased by self-setting control. The gain parameter adjustment upper limit is variable and can be adjusted by itself. The initial value of the gain parameter adjustment upper limit is the camera gain parameter upper limit.

[0097] The gain parameter adjustment lower limit of the embodiment of the present application refers to the minimum value that can be set when the sensitivity is increased by self-setting control. The gain parameter adjustment lower limit is variable and can be adjusted by itself. The initial value of the gain parameter adjustment lower limit is the camera gain parameter lower limit.

[0098] Step 130: output an image in a target brightness range.

[0099] After obtaining an image in a target brightness range, the embodiment of the present application outputs the image in the target brightness range.

[0100] like Figure 2 The second flowchart of a photographing method provided by an embodiment of the present application is shown, including the following steps 201 to 206:

[0101] Step 201, initializing the shooting device;

[0102] Step 202, capturing the current image;

[0103] Step 203, determining the brightness of the current image;

[0104] Step 204: determine whether the brightness of the current image is within the target brightness range; if not, execute step 205; if yes, execute step 206;

[0105] Step 205, determining the gain parameter and exposure time for shooting the next image according to the gain parameter, exposure time and at least one shooting parameter of the current image; executing step 202;

[0106] Step 206: output an image in the target brightness range.

[0107] In the embodiment of the present application, when it is determined that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined based on the gain parameter, exposure time and at least one shooting parameter of the current image, and the next image is shot based on the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range, and an image within the target brightness range is output, thereby achieving real-time and accurate adjustment of the exposure time and other parameter settings of the camera to adapt to various lighting conditions, ensuring the acquisition of high-quality images, improving production efficiency, reducing manual intervention, reducing system complexity, and improving detection accuracy and system stability. By applying automatic image brightness adjustment technology, the performance and reliability of industrial image acquisition systems can be significantly improved to meet the needs of modern industrial automation production and scientific research.

[0108] In some embodiments, the capture parameters include a target gain parameter;

[0109] Determining a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time, and at least one shooting parameter of a current image includes:

[0110] When it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, comparing the gain parameter of the current image with the target gain parameter;

[0111] When it is determined that the gain parameter of the current image is greater than the target gain parameter, the target gain parameter is used as the gain parameter of the next image;

[0112] The exposure time of the current image is used as the exposure time of the next image.

[0113] The gain parameter in the embodiment of the present application refers to a brightness gain parameter, which is an adjustment factor that changes the overall brightness by multiplying the brightness value of each pixel in an image or video. The target gain parameter refers to a brightness gain parameter of 1.0.

[0114] In the embodiment of the present application, when it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, after comparing the brightness of the current image with the target brightness range, when it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, it means that the brightness of the current image is high, and the gain parameter of the current image can be compared with the target gain parameter 1.0. When it is determined that the gain parameter of the current image is greater than the target gain parameter, the target gain parameter is used as the gain parameter of the next image, thereby reducing the brightness of the next image by reducing the gain parameter of the next image, and using the exposure time of the current image as the exposure time of the next image, thereby acquiring the next image according to the gain parameter and exposure time of the image, and continuing to execute the aforementioned steps 110 to 130.

[0115] In the embodiment of the present application, when the digital gain is 1.0, the exposure time is adjusted first and then the digital gain is adjusted.

[0116] In some embodiments, the shooting parameters also include a lower limit of camera exposure time and an upper limit of exposure time adjustment;

[0117] After comparing the gain parameter of the current sheet with the target gain parameter, the method further includes:

[0118] When it is determined that the gain parameter of the current image is not greater than the target gain parameter, comparing the exposure time of the current image with the lower limit of the camera exposure time;

[0119] When it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the average of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is used as the exposure time of the next image;

[0120] The gain parameter of the current image is used as the gain parameter of the next image.

[0121] In the embodiment of the present application, when it is determined that the gain parameter of the current image is not greater than the target gain parameter, it means that the brightness of the current image exceeds the target brightness range not because the target gain parameter is too high. Therefore, the exposure time of the current image and the lower limit of the camera exposure time can be compared. When it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the mean of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is calculated by the binary estimation method, and the mean of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is used as the exposure time of the next image, thereby adjusting the exposure time of the next image. In addition, the gain parameter of the current image can be used as the gain parameter of the next image, thereby acquiring the next image according to the gain parameter and exposure time of the image, and continuing to execute the aforementioned steps 110 to 130.

[0122] In some embodiments, after taking the average of the camera exposure time lower limit and the exposure time adjustment upper limit as the exposure time of the next image, the method further includes:

[0123] Use the exposure time of the next image as the new upper limit for exposure time adjustment.

[0124] In the embodiment of the present application, when it is determined that the brightness of the current image is greater than the upper limit of the target brightness range and that the gain parameter of the current image is greater than the target gain parameter, the exposure time of the current image is compared with the lower limit of the camera exposure time; when it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the average of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is used as the exposure time of the next image, and the exposure time of the next image is used as the new upper limit of the exposure time adjustment, thereby reducing the upper limit of the exposure time adjustment, which is beneficial to reducing the subsequent adjustment time.

[0125] In some embodiments, the shooting parameters also include a camera gain parameter lower limit and a gain parameter adjustment upper limit;

[0126] After comparing the exposure time of the current image with the lower limit of the camera exposure time, the method further includes:

[0127] When it is determined that the exposure time of the current image is not greater than the lower limit of the camera exposure time, the gain parameter of the current image is compared with the lower limit of the camera gain parameter;

[0128] When it is determined that the gain parameter of the current image is greater than the lower limit of the camera gain parameter, the average value between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is used as the gain parameter of the next image;

[0129] The exposure time of the current image is used as the exposure time of the next image.

[0130] The embodiment of the present application determines that when it is determined that the brightness of the current image is greater than the upper limit of the target brightness range and when it is determined that the gain parameter of the current image is not greater than the target gain parameter, the exposure time of the current image is compared with the lower limit of the camera exposure time. When it is determined that the exposure time of the current image is not greater than the lower limit of the camera exposure time, it means that the gain parameter of the current image has a greater impact on the brightness of the current image. Therefore, the gain parameter of the current image and the lower limit of the camera gain parameter can be compared. When it is determined that the gain parameter of the current image is greater than the lower limit of the camera gain parameter, the mean between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is determined by a binary estimation algorithm, and the mean between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is used as the gain parameter of the next image; the exposure time of the current image is used as the exposure time of the next image, and thus, the next image is acquired according to the gain parameter and exposure time of the image, and the aforementioned steps 110 to 130 are continued to be executed.

[0131] In addition, when it is determined that the gain parameter of the current image is not greater than the lower limit of the camera gain parameter, the brightness adjustment of the surface image fails.

[0132] After taking the average of the camera gain parameter lower limit and the gain parameter adjustment upper limit as the gain parameter of the next image, the method further includes:

[0133] The gain parameter of the next image is used as the upper limit of gain parameter adjustment.

[0134] In the embodiment of the present application, when it is determined that the brightness of the current image is greater than the upper limit of the target brightness range and the gain parameter of the current image is greater than the target gain parameter, the exposure time of the current image is compared with the lower limit of the camera exposure time; when it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the gain parameter of the current image is compared with the lower limit of the camera gain parameter; when it is determined that the gain parameter of the current image is greater than the lower limit of the camera gain parameter, the mean between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is used as the gain parameter of the next image, and the gain parameter of the next image is used as the upper limit of the gain parameter adjustment, so as to reduce the upper limit of the gain parameter adjustment, which is beneficial to reducing the subsequent adjustment time.

[0135] In some embodiments, the shooting parameters also include an upper limit of the camera exposure time;

[0136] Determining a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time, and at least one shooting parameter of a current image includes:

[0137] When it is determined that the brightness of the current image is not greater than the upper limit of the target brightness range, comparing the exposure time of the current image with the upper limit of the camera exposure time;

[0138] When it is determined that the exposure time of the current image is less than the upper limit of the camera exposure time, the median of the target brightness range is determined;

[0139] Obtaining a first exposure amount according to a median value of a target brightness range and an exposure time;

[0140] Obtaining an exposure time for a next image according to the first exposure amount and the brightness of the current image;

[0141] The gain parameter of the current image is used as the gain parameter of the next image.

[0142] In the embodiment of the present application, when it is determined that the brightness of the current image is not greater than the upper limit of the target brightness range, the exposure time of the current image is compared with the upper limit of the camera exposure time; when it is determined that the exposure time of the current image is less than the upper limit of the camera exposure time, the median of the target brightness range is determined; the median of the target brightness range is the average of the maximum and minimum values ​​of the target brightness range.

[0143] The first exposure can be obtained based on the median of the target brightness interval and the exposure time based on the linear estimation algorithm, that is, the first exposure is equal to the median of the target brightness interval multiplied by the exposure time. Then, the brightness ratio of the first exposure and the current image is used as the exposure time of the next image; and the gain parameter of the current image is used as the gain parameter of the next image, that is, the exposure time of the next image is equal to the exposure time of the current image multiplied by the median of the brightness statistical expected interval and then divided by the brightness statistical value of the current frame using the linear estimation method, and the gain parameter is not adjusted. Thus, the next image is acquired according to the gain parameter and exposure time of the image, and the aforementioned steps 110 to 130 are continued.

[0144] In some embodiments, the shooting parameters also include an upper limit of a camera gain parameter;

[0145] After comparing the exposure time of the current image with the upper limit of the camera exposure time, the method further includes:

[0146] When it is determined that the exposure time of the current image is not less than the upper limit of the camera exposure time, the gain parameter of the current image is compared with the upper limit of the camera gain parameter;

[0147] When it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, obtaining a first brightness according to the median of the target brightness interval and the gain parameter of the current image;

[0148] A gain parameter of a next image is obtained according to the first brightness and the brightness of the current image.

[0149] In the embodiment of the present application, when it is determined that the brightness of the current image is not greater than the upper limit of the target brightness interval, the exposure time of the current image is compared with the upper limit of the camera exposure time. When it is determined that the exposure time of the current image is not less than the upper limit of the camera exposure time, the gain parameter of the current image is compared with the upper limit of the camera gain parameter. When it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, the first brightness is obtained based on the median of the target brightness interval and the gain parameter of the current image based on the linear estimation algorithm. The gain parameter of the next image is obtained based on the first brightness and the brightness of the current image, that is, the gain parameter of the next image is calculated using the linear estimation method to be equal to the gain parameter of the current image multiplied by the median of the brightness statistical expected interval and then divided by the brightness statistical value of the current image. Thus, the next image is acquired according to the gain parameter and exposure time of the image, and the aforementioned steps 110 to 130 are continued.

[0150] In addition, when it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, it is determined that the brightness adjustment fails.

[0151] In some embodiments, obtaining the brightness of the current image includes:

[0152] Generate a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level;

[0153] Search each pixel level in descending order until the target pixel level is found; by the target pixel level, the accumulated number of pixel points of each pixel level that has been searched exceeds the first target number;

[0154] According to the pixel value corresponding to the target pixel level, the brightness of the current image is obtained.

[0155] Specifically, assuming that the pixel levels from high to low are the first pixel level, the second pixel level, and the third pixel level, each pixel level has a corresponding pixel interval, and the pixel intervals are continuous and have no overlap. Assuming that the number of pixels of the first pixel level, the second pixel level, and the third pixel level are 2, 5, and 9 respectively, and the first target number is 6, then by searching each pixel level in order from high to low, it can be determined that the cumulative number of pixels in the first pixel level is 2, which is less than the first target number; the cumulative number of pixels of the first pixel level and the second pixel level is 7, which is greater than the first target number. Therefore, the target pixel level is found to be the second pixel level.

[0156] The brightness of the current image can be obtained according to the pixel value corresponding to the target pixel level. Specifically, when each pixel level corresponds to a pixel value, the pixel value can represent the brightness corresponding to the pixel level, and when each pixel level corresponds to a pixel value interval, the median of the pixel value interval can be used as the brightness of the pixel level.

[0157] In some embodiments, before generating a histogram corresponding to the target area in the current image, the method further includes:

[0158] The first target quantity is determined based on the following method:

[0159] Determine the target area corresponding to the current image;

[0160] Determine the number of pixels in the target area;

[0161] The smaller value of the number of pixels in the target area and the second target number is taken as the third target number.

[0162] The first target quantity is obtained according to the third target quantity and the target value.

[0163] Specifically, assuming that the number of pixels in the target area is 9 and the second target number is 5, the smaller value 5 between 9 and 5 can be used as the second target number. assuming that the number of pixels in the target area is 10 and the second target number is 15, the smaller value 10 between 10 and 15 can be used as the second target number.

[0164] The target value can be any number less than the third target number, such as 1 / 2, 1 / 3, or it can be a specific number, such as 2, 3, 10, 20, etc., without limitation.

[0165] After determining the third target quantity, the first target quantity is obtained based on the third target quantity and the target value. Specifically, when the target value is a fraction, the product of the third target quantity and the target value can be used as the first target quantity. When the target value is a smaller integer (for example, less than 5), the ratio of the third target quantity to the target value can be used as the first target quantity. When the target value is a larger integer (for example, 20), the difference between the two can be used as the first target quantity.

[0166] This has been explained in the above-mentioned embodiment and will not be described again here.

[0167] like Figure 3 The figure is a schematic diagram of a process for determining the brightness of a current image provided by an embodiment of the present application, including steps 301 to 310:

[0168] Step 301, performing image filtering processing on the current image, which may be based on a Gaussian filtering algorithm, a mean filtering algorithm, etc.; executing step 302;

[0169] Step 302, determine the target area corresponding to the current image; execute step 303;

[0170] Step 303, determine the number of pixels in the target area; execute step 304;

[0171] Step 304, determining whether the number of pixels in the target area is less than the second target number; if so, executing step 305; if not, executing step 306;

[0172] Step 305, taking the number of pixels in the target area as the third target number; executing step 307;

[0173] Step 306, taking the second target quantity as the third target quantity; executing step 307;

[0174] Step 307, obtaining the first target quantity according to the third target quantity and the target value; executing step 308

[0175] Step 308, generating a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level; executing step 309;

[0176] Step 309, searching each pixel level in descending order until the target pixel level is found; by the target pixel level, the accumulated number of pixel points of each pixel level that has been searched exceeds the first target number; and executing step 310;

[0177] Step 310, obtaining the brightness of the current image according to the pixel value corresponding to the target pixel level.

[0178] The detailed implementation process of step 301 to step 310 is shown in the above embodiment and will not be described again here.

[0179] Figure 4 A third flow chart of a photographing method provided in an embodiment of the present application includes the following steps:

[0180] Step 401, capture the current image; execute step 402;

[0181] Step 402, determine the brightness of the current image; execute step 403;

[0182] Step 403, determining whether the brightness of the current image is within the target brightness range, if not, executing step 404, if yes, executing step 417;

[0183] Step 404, determining whether the brightness of the current image is greater than the upper limit of the target brightness range; if so, executing step 405; if not, executing step 411;

[0184] Step 405, determining whether the current gain parameter is greater than the target gain parameter; if so, executing step 406; if not, executing step 407;

[0185] Step 406, using the target gain parameter as the gain parameter of the next image, and using the exposure time of the current image as the exposure time of the next image; executing step 401;

[0186] Step 407, determining whether the exposure time of the current image is greater than the lower limit of the camera exposure time; if so, executing step 408; if not, executing step 409;

[0187] Step 408, taking the average of the camera exposure time lower limit and the exposure time adjustment upper limit as the exposure time of the next image; taking the gain parameter of the current image as the gain parameter of the next image; and executing step 415;

[0188] Step 409, determining whether the gain parameter of the current image is greater than the lower limit of the camera gain parameter; if so, then end; if not, proceed to step 410;

[0189] Step 410, taking the average value between the camera gain parameter lower limit and the gain parameter adjustment upper limit as the gain parameter of the next image; taking the exposure time of the current image as the exposure time of the next image; and executing step 416;

[0190] Step 411, determine whether the exposure time of the current image is less than the upper limit of the camera exposure time; if so, execute step 412; if not, execute step 413;

[0191] Step 412, determine the median of the target brightness interval; obtain a first exposure value according to the median of the target brightness interval and the exposure time; obtain the exposure time of the next image according to the first exposure value and the brightness of the current image; use the gain parameter of the current image as the gain parameter of the next image; execute step 401;

[0192] Step 413, determine whether the gain parameter of the current image is less than the upper limit of the camera gain parameter; if so, execute step 414; if not, end;

[0193] Step 414, obtaining a first brightness according to the median of the target brightness interval and the gain parameter of the current image; obtaining a gain parameter of the next image according to the first brightness and the brightness of the current image; executing step 401;

[0194] Step 415, taking the exposure time of the next image as the new upper limit of exposure time adjustment; executing step 401;

[0195] Step 416, taking the gain parameter of the next image as the upper limit of gain parameter adjustment; executing step 401;

[0196] Step 417: output an image in the target brightness range.

[0197] The detailed implementation process of step 401 to step 417 is shown in the above embodiment and will not be described again here.

[0198] In the brightness statistical evaluation part of the image, the embodiment of the present application greatly avoids the interference of isolated noise points, bad points and bad clusters on the brightness statistical value by fusing image filtering and brightness statistical quantity thresholds; the speed of obtaining brightness statistical values ​​is accelerated by histogram statistics. In the shooting parameter optimization and adjustment part, the image brightness is adjusted without introducing noise as much as possible by adjusting the exposure time and gain adjustment order in different situations; the automatic adjustment of the image brightness value with the least adjustment steps is achieved through the parameter update strategy combining the binary estimation and linear estimation methods. By using this automatic image brightness adjustment method, it can be ensured that clear and properly exposed images can be obtained in various lighting environments, and it has strong robustness. And while ensuring image quality, it can reduce the installation and debugging time of the imaging system, reduce the complexity of operation and labor costs. Under the same conditions, the automatic adjustment of image brightness can be achieved with fewer adjustment steps, thereby improving production and scientific research efficiency.

[0199] The shooting method provided in the embodiment of the present application can be executed by a shooting device. In the embodiment of the present application, the shooting method is executed by a shooting device as an example to illustrate the shooting device provided in the embodiment of the present application.

[0200] The embodiment of the present application also provides a photographing device.

[0201] like Figure 5 As shown, the photographing device includes: a first processing module 510 , a second processing module 520 and a third processing module 530 .

[0202] A first processing module 510 is used to obtain the brightness of the current image;

[0203] The second processing module 520 is used to determine the gain parameter and exposure time for shooting the next image according to the gain parameter, exposure time and at least one shooting parameter of the current image when the brightness of the current image is not within the target brightness range, until the brightness of the next image is within the target brightness range;

[0204] The third processing module 530 is used to output an image in a target brightness range.

[0205] According to the shooting device provided in the embodiment of the present application, when it is determined that the brightness of the current image is not within the target brightness range, the gain parameter and exposure time for shooting the next image are determined according to the gain parameter, exposure time and at least one shooting parameter of the current image, and the next image is shot according to the gain parameter and exposure time of the next image until the brightness of the next image is within the target brightness range, and an image within the target brightness range is output, thereby achieving real-time and accurate adjustment of the exposure time and other parameter settings of the camera to adapt to various lighting conditions, ensure the acquisition of high-quality images, improve production efficiency, reduce manual intervention, reduce system complexity, and improve detection accuracy and system stability. By applying automatic image brightness adjustment technology, the performance and reliability of industrial image acquisition systems can be significantly improved to meet the needs of modern industrial automation production and scientific research.

[0206] In some embodiments, the shooting parameter includes a target gain parameter; and the second processing module includes:

[0207] The first processing submodule is used for:

[0208] When it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, comparing the gain parameter of the current image with the target gain parameter;

[0209] When it is determined that the gain parameter of the current image is greater than the target gain parameter, the target gain parameter is used as the gain parameter of the next image;

[0210] The exposure time of the current image is used as the exposure time of the next image.

[0211] In some embodiments, the shooting parameters further include a lower limit of the camera exposure time and an upper limit of the exposure time adjustment; the second processing module includes:

[0212] The second processing submodule is used for:

[0213] After comparing the gain parameter of the current image with the target gain parameter, if it is determined that the gain parameter of the current image is not greater than the target gain parameter, comparing the exposure time of the current image with the lower limit of the camera exposure time;

[0214] When it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, the average of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment is used as the exposure time of the next image;

[0215] The gain parameter of the current image is used as the gain parameter of the next image.

[0216] In some embodiments, the shooting parameters further include a camera gain parameter lower limit and a gain parameter adjustment upper limit; the second processing module includes:

[0217] The third processing submodule is used for:

[0218] After comparing the exposure time of the current image with the lower limit of the camera exposure time, if it is determined that the exposure time of the current image is not greater than the lower limit of the camera exposure time, comparing the gain parameter of the current image with the lower limit of the camera gain parameter;

[0219] When it is determined that the gain parameter of the current image is greater than the lower limit of the camera gain parameter, the average value between the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment is used as the gain parameter of the next image;

[0220] The exposure time of the current image is used as the exposure time of the next image.

[0221] In some embodiments, the second processing module further includes:

[0222] a fourth processing submodule, configured to use the exposure time of the next image as a new upper limit of exposure time adjustment after using the average of the lower limit of camera exposure time and the upper limit of exposure time adjustment as the exposure time of the next image;

[0223] The fifth processing submodule is used to use the gain parameter of the next image as the upper limit of the gain parameter adjustment after using the average of the lower limit of the camera gain parameter and the upper limit of the gain parameter adjustment as the gain parameter of the next image.

[0224] In some embodiments, the shooting parameters also include an upper limit of the camera exposure time; the second processing module also includes:

[0225] The sixth processing submodule is used for:

[0226] When it is determined that the brightness of the current image is not greater than the upper limit of the target brightness range, comparing the exposure time of the current image with the upper limit of the camera exposure time;

[0227] When it is determined that the exposure time of the current image is less than the upper limit of the camera exposure time, the median of the target brightness range is determined;

[0228] Obtaining a first exposure amount according to a median value of a target brightness range and an exposure time;

[0229] Obtaining an exposure time for a next image according to the first exposure amount and the brightness of the current image;

[0230] The gain parameter of the current image is used as the gain parameter of the next image.

[0231] In some embodiments, the shooting parameters further include an upper limit of a camera gain parameter; and the second processing module further includes:

[0232] The seventh processing submodule is used for:

[0233] After comparing the exposure time of the current image with the upper limit of the camera exposure time, if it is determined that the exposure time of the current image is not less than the upper limit of the camera exposure time, comparing the gain parameter of the current image with the upper limit of the camera gain parameter;

[0234] When it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, obtaining a first brightness according to the median of the target brightness interval and the gain parameter of the current image;

[0235] A gain parameter of a next image is obtained according to the first brightness and the brightness of the current image.

[0236] In some embodiments, the first processing submodule is specifically used for:

[0237] Generate a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level;

[0238] Search each pixel level in descending order until the target pixel level is found; by the target pixel level, the accumulated number of pixel points of each pixel level that has been searched exceeds the first target number;

[0239] According to the pixel value corresponding to the target pixel level, the brightness of the current image is obtained.

[0240] In some embodiments, the photographing device further includes:

[0241] The fourth processing module is used for:

[0242] The first target quantity is determined based on the following method:

[0243] Determine the target area corresponding to the current image;

[0244] Determine the number of pixels in the target area;

[0245] The smaller value of the number of pixels in the target area and the second target number is taken as the third target number.

[0246] The first target quantity is obtained according to the third target quantity and the target value.

[0247] The shooting device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.

[0248] The shooting device in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0249] The shooting device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0250] In some embodiments, Figure 6 As shown, an embodiment of the present application also provides an electronic device 60, including a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the program is executed by the processor 601, each process of the above-mentioned shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0251] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0252] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned shooting method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0253] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0254] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned shooting method when executed by a processor.

[0255] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0256] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned shooting method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0257] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0258] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0259] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0260] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0261] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0262] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A shooting method, characterized in that: include: Get the brightness of the current image; In a case where it is determined that the brightness of the current image is not within the target brightness range, determining a gain parameter and an exposure time for shooting a next image according to a gain parameter, an exposure time, and at least one shooting parameter of the current image, and shooting the next image according to the gain parameter and the exposure time of the next image until the brightness of the next image is within the target brightness range; Output an image within the target brightness range.

2. The shooting method according to claim 1, characterized in that: The shooting parameters include target gain parameters; The step of determining the gain parameter and exposure time for shooting the next image according to the gain parameter, exposure time and at least one shooting parameter of the current image comprises: When it is determined that the brightness of the current image is greater than the upper limit of the target brightness range, comparing the gain parameter of the current image with the target gain parameter; When it is determined that the gain parameter of the current image is greater than the target gain parameter, using the target gain parameter as the gain parameter of the next image; The exposure time of the current image is used as the exposure time of the next image.

3. The shooting method according to claim 2, characterized in that: The shooting parameters also include a lower limit of camera exposure time and an upper limit of exposure time adjustment; After comparing the gain parameter of the current frame with the target gain parameter, the method further includes: When it is determined that the gain parameter of the current image is not greater than the target gain parameter, comparing the exposure time of the current image with the lower limit of the camera exposure time; When it is determined that the exposure time of the current image is greater than the lower limit of the camera exposure time, taking the average of the lower limit of the camera exposure time and the upper limit of the exposure time adjustment as the exposure time of the next image; The gain parameter of the current image is used as the gain parameter of the next image.

4. The shooting method according to claim 3, characterized in that: The shooting parameters also include a camera gain parameter lower limit and a gain parameter adjustment upper limit; After comparing the exposure time of the current image with the lower limit of the camera exposure time, the method further includes: When it is determined that the exposure time of the current image is not greater than the lower limit of the camera exposure time, comparing the gain parameter of the current image with the lower limit of the camera gain parameter; When it is determined that the gain parameter of the current image is greater than the camera gain parameter lower limit, taking the average value between the camera gain parameter lower limit and the gain parameter adjustment upper limit as the gain parameter of the next image; The exposure time of the current image is used as the exposure time of the next image.

5. The shooting method according to claim 4, characterized in that: After taking the average of the camera exposure time lower limit and the exposure time adjustment upper limit as the exposure time of the next image, the method further includes: Using the exposure time of the next image as the new upper limit of the exposure time adjustment; After taking the average of the camera gain parameter lower limit and the gain parameter adjustment upper limit as the gain parameter of the next image, the method further includes: The gain parameter of the next image is used as the upper limit of the gain parameter adjustment.

6. The shooting method according to claim 1, characterized in that: The shooting parameters also include an upper limit of the camera exposure time; The step of determining the gain parameter and exposure time for shooting the next image according to the gain parameter, exposure time and at least one shooting parameter of the current image comprises: When it is determined that the brightness of the current image is not greater than the upper limit of the target brightness range, comparing the exposure time of the current image with the upper limit of the camera exposure time; When it is determined that the exposure time of the current image is less than the upper limit of the camera exposure time, determining the median value of the target brightness range; Obtaining a first exposure amount according to a median value of the target brightness interval and the exposure time; Obtaining an exposure time of the next image according to the first exposure amount and the brightness of the current image; The gain parameter of the current image is used as the gain parameter of the next image.

7. The shooting method according to claim 6, characterized in that: The shooting parameters also include an upper limit of camera gain parameters; After comparing the exposure time of the current image with the upper limit of the camera exposure time, the method further includes: When it is determined that the exposure time of the current image is not less than the upper limit of the camera exposure time, comparing the gain parameter of the current image with the upper limit of the camera gain parameter; When it is determined that the gain parameter of the current image is less than the upper limit of the camera gain parameter, obtaining a first brightness according to the median of the target brightness interval and the gain parameter of the current image; A gain parameter of the next image is obtained according to the first brightness and the brightness of the current image.

8. The shooting method according to any one of claims 1 to 7, characterized in that: The obtaining the brightness of the current image includes: Generate a histogram corresponding to the target area in the current image; the histogram includes the number of pixels corresponding to each pixel level; Searching each pixel level in descending order until a target pixel level is found; by the target pixel level, the accumulated number of pixel points of each pixel level that has been searched exceeds a first target number; The brightness of the current image is obtained according to the pixel value corresponding to the target pixel level.

9. The shooting method according to any one of claim 8, characterized in that: Before generating a histogram corresponding to the target area in the current image, the method further includes: The first target quantity is determined based on the following method: Determine a target area corresponding to the current image; Determine the number of pixels in the target area; The smaller value between the number of pixels in the target area and the second target number is taken as the third target number to obtain the first target number according to the third target number and the target value.

10. A photographing device, characterized in that: include: The first processing module is used to obtain the brightness of the current image; A second processing module, configured to determine, when the brightness of the current image is not within the target brightness range, a gain parameter and an exposure time for shooting a next image according to the gain parameter, the exposure time and at least one shooting parameter of the current image, until the brightness of the next image is within the target brightness range; The third processing module is used to output an image in the target brightness range.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the shooting method according to any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the shooting method according to any one of claims 1 to 9 is implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the shooting method according to any one of claims 1 to 9 is implemented.