WO2025247111A1 - Method and device for measuring spatial distribution of ambient luminance - Google Patents
Method and device for measuring spatial distribution of ambient luminanceInfo
- Publication number
- WO2025247111A1 WO2025247111A1 PCT/CN2025/096910 CN2025096910W WO2025247111A1 WO 2025247111 A1 WO2025247111 A1 WO 2025247111A1 CN 2025096910 W CN2025096910 W CN 2025096910W WO 2025247111 A1 WO2025247111 A1 WO 2025247111A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- brightness
- luminance
- pixel
- image file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J1/00—Photometry, e.g. photographic exposure meter
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J1/00—Photometry, e.g. photographic exposure meter
- G01J1/42—Photometry, e.g. photographic exposure meter using electric radiation detectors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
Definitions
- This application relates to the field of brightness measurement technology, and in particular to a method and apparatus for measuring the spatial distribution of ambient brightness.
- Photometric stereochemistry in computational photography is one of the few similar studies.
- illumination is uniform and directional, and the direction of illumination is known.
- the pixel value in each image is affected by the object's surface normal and the direction of illumination.
- the object-side brightness value of a pixel (the actual brightness value of each pixel in the photograph under the shooting environment, in candela per square meter) can be expressed as a function of the illumination direction and the surface normal.
- the above method can only estimate the object-side brightness value of pixels, and cannot obtain a visual display of the spatial distribution of ambient brightness, thus failing to provide intuitive design references for lighting designers.
- This application provides a method and apparatus for measuring the spatial distribution of ambient brightness, which solves the problem that traditional ambient brightness measurement methods cannot obtain a visual display of the spatial distribution of ambient brightness, and cannot intuitively provide design references for lighting designers.
- This application provides a method for measuring the spatial distribution of ambient brightness, including the following steps:
- the camera's image sensor Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
- Receive the shooting instruction trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment;
- a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
- the method further includes:
- a luminance distribution file is generated, which is configured to store the object luminance values of each pixel in the target image file in tabular form.
- the row and column positions of the object-side brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file.
- the method further includes:
- the method further includes:
- the method further includes:
- the method further includes:
- a recommended statistical value for the brightness corresponding to the environment to be measured is determined.
- a target image file captured under the environment to be measured is obtained, including:
- the raw format file is converted to an RGB three-channel format file according to a preset conversion method, and the RGB three-channel format file is determined to be the target image file.
- a pseudo-color map of the spatial distribution of luminance in the environment to be measured is generated and displayed, including:
- the object-side brightness value of each pixel is normalized from 0 to 2n -1 to generate an n-bit grayscale image representing the brightness distribution, where n is a multiple of 8.
- the grayscale image is converted into a brightness distribution pseudo-color image.
- the object-space brightness value of each pixel in the target image file is calculated, including:
- the pixel value and the target exposure parameter are input into the object-space luminance regression model to obtain the object-space luminance value of each pixel output by the object-space luminance regression model.
- the object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
- An ambient brightness spatial distribution measurement device is applied to a terminal, and the device includes the following modules:
- the measurement command receiving module is configured to receive ambient brightness measurement commands and trigger the camera's image sensor to acquire an initial image of the environment to be measured.
- An exposure parameter determination module is configured to determine target exposure parameters based on the initial image
- the target image file acquisition module is configured to receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment.
- the brightness value calculation module is configured to calculate the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters;
- the pseudo-color map generation module is configured to generate and display a pseudo-color map of the luminance spatial distribution under the measured environment based on the object luminance value.
- This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ambient brightness spatial distribution measurement method as described above.
- This application also provides a computer program product, including a computer program that, when executed by a processor, implements the ambient brightness spatial distribution measurement method as described above.
- the method and apparatus for measuring the spatial distribution of ambient brightness involve receiving an ambient brightness measurement command, triggering the camera's image sensor to acquire an initial image of the environment to be measured; determining target exposure parameters based on the initial image; receiving a shooting command, triggering the camera to take a picture according to the target exposure parameters, and acquiring a target image file of the environment to be measured; calculating the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters; and generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object-side brightness values.
- This application achieves a visual display of ambient brightness by capturing a target image file of the current environment to be measured in real time, calculating the object-side brightness value of each pixel in the target image file based on the exposure parameters at the time of shooting, and generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object-side brightness value of each pixel.
- This provides an intuitive design reference for lighting designers.
- Figure 1 is one of the flowcharts of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
- Figure 2 is an interface display diagram of the photograph of the environment to be measured taken by the terminal in the method for measuring the spatial distribution of ambient brightness provided in the embodiment of this application.
- Figure 3 is a schematic diagram of the display interface of the pseudo-color map of the spatial distribution of brightness in the ambient brightness measurement method provided in the embodiment of this application.
- Figure 4 is a second schematic flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
- Figure 5 is a schematic diagram showing the object-side brightness value of a pixel at a user-specified point in the ambient brightness spatial distribution measurement method provided in this application embodiment.
- Figure 6 is a flowchart of the third embodiment of the method for measuring the spatial distribution of ambient brightness provided in this application.
- Figure 7 is a schematic diagram showing the object-space brightness value of a target pixel in a user-specified area in the ambient brightness spatial distribution measurement method provided in the embodiments of this application.
- Figure 8 is a flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
- Figure 9 is a flowchart of the fifth embodiment of the method for measuring the spatial distribution of ambient brightness provided in this application.
- Figure 10 is a schematic flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
- Figure 11 is the seventh flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
- Figure 12 is a schematic diagram of the structure of the ambient light spatial distribution measurement device provided in the embodiment of this application.
- Figure 13 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.
- the method for measuring the spatial distribution of ambient brightness according to this application is applied to a terminal, which may be a device such as a smartphone or tablet computer.
- the method includes the following steps S110 to S140.
- Step S110 Receive an ambient brightness measurement command and trigger the camera's image sensor to acquire an initial image of the environment to be measured.
- the terminal receives an ambient brightness measurement command triggered by the user, triggering the image sensor of the camera in the terminal to acquire an initial image of the environment to be measured. That is, upon receiving the ambient brightness measurement command, the camera module is activated, and the image sensor displays the acquired initial image on the terminal's display screen. The user can observe the initial image and adjust the shooting angle.
- Step S120 Based on the initial image, determine the target exposure parameters.
- the camera's default exposure parameters (the camera automatically generates a set of default exposure parameters for different scenes) can be determined as the target exposure parameters.
- the user's adjustment of the default exposure parameters is received, the adjusted exposure parameters are determined as the target exposure parameters, and the target image file is obtained by exposing according to the adjusted exposure parameters.
- the overall brightness of the image will be close to the actual scene in the user's perception, making the subsequently calculated object-side brightness values of pixels more accurate.
- Step S130 Receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file of the environment to be measured.
- the terminal receives the shooting command, and triggers the camera to take a picture according to the target exposure parameters, thereby acquiring the target image file of the environment to be measured.
- this is a schematic diagram of a target image file taken by a smartphone in a bedroom environment. The area below the image can display the corresponding exposure parameters.
- Step S140 Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file.
- Step S150 Based on the object luminance value, generate and display a pseudo-color map of the luminance spatial distribution in the environment to be measured. As shown in Figure 3, this is the pseudo-color map of the luminance spatial distribution of the target image file corresponding to Figure 2.
- the pseudo-color map of the luminance spatial distribution can more intuitively show the distribution of light and dark in the entire environment to be measured. Users can understand the luminance spatial distribution of the entire environment to be measured by observing this pseudo-color map, providing a more intuitive reference for lighting design in this environment.
- the ambient brightness spatial distribution measurement method of this embodiment acquires target image files by real-time shooting of the current environment to be measured, calculates the object-side brightness value of each pixel in the target image file by combining the exposure parameters at the time of shooting, and generates and displays a pseudo-color map of the brightness spatial distribution in the environment to be measured based on the object-side brightness value of each pixel, thereby realizing the visualization of ambient brightness and providing intuitive design reference for lighting designers.
- the method further includes: calculating and displaying statistical values of the object-side luminance values of all pixels in the target image file, wherein the statistical values include: average object-side luminance value, maximum object-side luminance value, and minimum object-side luminance value.
- the terminal interface displays not only a pseudo-color map of luminance spatial distribution, but also the average object-side luminance value, maximum object-side luminance value, and minimum object-side luminance value on one side of the pseudo-color map.
- the pseudo-color map of luminance spatial distribution also displays markers for the maximum and minimum object-side luminance values to mark the locations of the brightest and darkest areas in the environment to be measured.
- a marker for the maximum object-side luminance value is marked at each lamp, meaning there can be multiple markers for the maximum object-side luminance value. Similarly, there can also be multiple markers for the minimum object-side luminance value.
- the method further includes: generating a brightness distribution file based on the object-side brightness values.
- the brightness distribution file is configured to store the object-side brightness values of each pixel in the target image file in tabular form, wherein the row and column positions of the table containing the object-side brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file.
- the brightness distribution file is a CSV file.
- a CSV file is a file that stores tabular data in plain text format. It can be understood that the total number of rows and columns in the table in the CSV file is the same as the total number of rows and columns of pixels in the target image file.
- the object-side brightness values of each pixel in the target image file can be stored in the CSV file for subsequent querying of the object-side brightness value of any pixel.
- steps S410 to S430 are further included after step S150.
- Step S410 Obtain the row and column coordinates of the target pixel point specified by the user on the luminance spatial distribution pseudo-color map.
- the target pixel point specified by the user is the touch point clicked by the user on the luminance spatial distribution pseudo-color map.
- the row and column coordinates of the target pixel point can be determined by sensing the user's touch point position through the terminal screen.
- Step S420 Based on the row and column coordinates of the target pixel, query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file. That is, according to the one-to-one correspondence between the row and column position of the table in the brightness distribution file where the object brightness value of each pixel is located and the row and column coordinates of the corresponding pixel in the target image file, query the target object brightness value corresponding to the target pixel in the brightness distribution file.
- Step S430 Display the target object brightness value. As shown in Figure 5, the target object brightness value of two specified target pixels on the brightness spatial distribution pseudo-color map is displayed.
- This embodiment enables real-time display of the target object brightness value of a user-specified target pixel.
- it can display the target object brightness values corresponding to multiple target pixels in a user-specified spatial area, allowing the user to view the differences between the brightness values of multiple target objects. Large differences indicate uneven brightness distribution in that spatial area.
- multiple target pixels in the space where the bed is located are specified, thus displaying the real-time brightness values of multiple target objects in that space.
- the differences between the brightness values of multiple target objects in the space where the bed is located are large (e.g., the difference between the brightness values of one or two points and other points is too large), it indicates uneven brightness distribution in the space where the bed is located, which will affect sleep and necessitates a proper lighting arrangement around the bed.
- the method further includes: calculating the target average value of the brightness values of multiple target objects in real time, comparing any target object brightness value with the target average value, and if the difference between any target object brightness value and the target average value is greater than a preset threshold (the preset threshold can be set according to actual conditions, for example, 20% of the target average value), displaying a message on the terminal's display interface indicating uneven brightness distribution. Specifically, for each target pixel specified by the user, an average value is calculated and compared, providing a real-time message indicating whether the brightness distribution is uniform.
- a preset threshold can be set according to actual conditions, for example, 20% of the target average value
- steps S610 to S640 are further included after step S150.
- Step S610 Obtain the target area specified by the user on the luminance spatial distribution pseudo-color map. Specifically, the target area is obtained by sensing the closed area circled by the user on the terminal interface, as shown in Figure 7, where the user has drawn the area of the space where the bed is located.
- Step S620 Using all pixels in the target region as target pixels, obtain the row and column coordinates of the target pixels. Specifically, by determining all target pixels within the target region, the row and column coordinates of the target pixels can be obtained.
- Step S630 Based on the row and column coordinates of the target pixel, query the target object-side brightness value recorded at the corresponding row and column position in the brightness distribution file. Specifically, for each target pixel, according to the one-to-one correspondence between the row and column position of the table in the brightness distribution file where the object-side brightness value of each pixel is located and the row and column coordinates of the corresponding pixel in the target image file, query the brightness distribution file to obtain the target object-side brightness value corresponding to that target pixel.
- Step S640 Display the statistical value of the target object brightness value.
- the statistical value of the target area brightness in the target area on the brightness spatial distribution pseudo-color map is displayed, that is, the statistical value of the target object brightness value in the area.
- the average value of the target object brightness value of all target pixels in the target area is displayed, and the average value is used to represent the overall brightness of the target area.
- a regional brightness reference is provided to the user.
- steps S610 to S640 based on the execution of steps S610 to S640, combined with the execution of the above steps S410 to S430, that is, further specifying target pixels in the target area, so as to obtain the overall brightness of the target area and determine whether the brightness distribution uniformity of the target area meets the requirements.
- steps S810 and S820 are further included after step S150.
- Step S810 Receive the scene category of the environment to be measured, input by the user.
- Scene categories include, for example, bedroom, living room, study, tea room, KTV room, and gymnasium. Specifically, as shown in Figures 3, 5, and 7, the scene category is entered in the edit box on one side of the pseudo-color map of the brightness spatial distribution on the terminal interface.
- Step S820 Based on the scene category, determine the recommended statistical value of the brightness corresponding to the environment to be measured. Specifically, a mapping table of scene categories and their corresponding recommended statistical values of brightness can be preset. After receiving the scene category input by the user, the corresponding recommended statistical value is found according to the mapping table, and the recommended statistical value is displayed in the area for displaying recommended statistical values.
- the recommended statistical value corresponding to the scene category can be the average brightness, reflecting the average brightness of different scenes. In this embodiment, outputting the recommended statistical value of brightness through scene category can quickly provide users with a reference for brightness distribution design.
- step S130 specifically includes steps S910 and S920.
- Step S910 Obtain the raw format file captured by the camera.
- the raw format file is unprocessed and uncompressed image encoding data, which records the original information of the camera sensor.
- Step S920 Convert the raw format file to an RGB three-channel format file using a preset conversion method, and determine that the RGB three-channel format file is the target image file. For example, convert the raw format file to a JPG or PNG format file.
- the preset conversion method is a unified ISP (Image Signal Processor) processing flow to obtain the RGB three-channel format file.
- the unified ISP flow can be implemented using the libraw C++ library or the postprocess function in the Python-encapsulated rawpy library.
- the raw format file is input as a parameter to the postprocess function, which uses the unified ISP flow to convert the raw format file to an RGB three-channel format file and outputs it.
- the raw format file of the shooting device is converted into an RGB three-channel format file according to a unified ISP process. This shields the adverse effects of different target image files obtained by different mobile phone or camera manufacturers using different ISP processes on brightness calculation, making the final measured object-side pixel value more accurate and stable.
- step S150 specifically includes steps S1010 and S1020.
- Step S1010 Normalize the object-side luminance value of each pixel from 0 to 2n -1 to generate an n-bit grayscale image representing the luminance distribution, where n is a multiple of 8. For example, if n is 16, normalize the object-side luminance value of each pixel to the range of 0-65535 (2 ⁇ 16 - 1) to generate a 16-bit PNG format grayscale image representing the luminance distribution.
- Step S1020 Convert the grayscale image into a brightness distribution pseudo-color map.
- the grayscale image can be converted into a brightness distribution pseudo-color map using the opencv:cv2.applyColorMap function.
- step S140 specifically includes step S1110 and step S1120.
- Step S1110 Extract the pixel values of each pixel in the target image file in the r, g, and b channels.
- Each pixel in the target image file corresponds to three channels: r, g, and b, and each channel has a pixel value in the range of 0 to 255.
- the pixel values of each pixel in the r, g, and b channels are obtained: IR value, IG value, and IB value, and the IR value, IG value, and IB value are all integers between 0 and 255.
- Step S1120 Input the pixel value and the target exposure parameters into the object-space brightness regression model to obtain the object-space brightness value of each pixel output by the object-space brightness regression model.
- the object-space brightness value of each pixel is the ambient brightness value of the corresponding point in the shooting environment, thus realizing the measurement of ambient brightness through the captured image file.
- the object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
- the exposure parameters of the sample target image file and the pixel values of the pixels in the sample target image file are known quantities.
- the standard object-side brightness value corresponding to the pixel in the sample target image file it can be measured by devices such as an imaging luminance meter under the same environment as the shooting environment. Since the imaging luminance meter can measure the brightness of objects in the shooting environment, it can obtain an accurate object-side brightness value (i.e., the standard object-side brightness value).
- the fitting coefficient of the object-side brightness regression model that is adapted to the standard object-side brightness value is obtained.
- the object-side brightness regression model can be used to accurately regress the object-side brightness value of each pixel in the real-time captured target image file, i.e., the ambient brightness value, without the need for other brightness measurement devices, eliminating the interference of device factors, and the output object-side brightness value has high stability.
- the sample image files are also converted from raw format files to RGB three-channel format files using a unified ISP process, which makes the object-side brightness value of each pixel output by the final object-side brightness regression model more accurate.
- the object-side brightness regression model includes: a first sub-model and a second sub-model, wherein the first sub-model is configured to determine the tristimulus value corresponding to the pixel value based on the pixel value, and to determine the floating-point grayscale value of each pixel based on the tristimulus value of each pixel.
- the second sub-model is configured to determine the object-side brightness value of each pixel based on the floating-point grayscale value of each pixel and the exposure parameters.
- GF is the floating-point gray value of the pixel
- IR, IG and IB are the pixel values of the three channels respectively
- R, G and B are the tristimulus values of IR, IG and IB respectively
- A1 , A2 , A3 , B1 , B2 and B3 are fitting coefficients
- A′1 , A′2 and A′3 are intermediate variables
- ⁇ , ⁇ and ⁇ are constants.
- the relationship between pixel values and corresponding tristimulus values can be represented by a power function with the pixel values IR, IG, and IB as bases.
- the accurate tristimulus values of pixels in the sample target image file are obtained through camera optical characteristic calibration experiments.
- the second sub-model can be obtained by regression fitting using the following formula.
- A4 and B4 are fitting coefficients
- L is the object-side brightness value of the pixel, which can be measured by a luminance meter during the fitting process
- F, T, and ISO are exposure parameters, representing aperture, exposure time, and ISO, respectively.
- log can be a logarithmic function with any base, such as ln (based on the natural constant e) or lg (based on 10). Different bases of the logarithmic functions will result in different A4 and B4 values.
- the first sub-model obtains the GF of the pixels in the sample target image files.
- the fitting coefficients A4 and B4 are then obtained by fitting the exposure parameters corresponding to multiple ( at least two) sample target image files and the standard object-side brightness values corresponding to the pixels in multiple sets of sample target image files, thus completing the fitting regression of the second sub - model.
- the object-side brightness regression model is obtained by regression fitting using the following formula.
- IR, IG, and IB are the pixel values of the three channels
- A1 , A2 , A3 , A4 , B1, B2 , B3 , and B4 are fitting coefficients
- L is the object-side brightness value of the pixel
- F, T, and ISO are exposure parameters, representing the aperture coefficient, exposure time, and ISO sensitivity, respectively.
- the three-channel pixel values of pixels in at least eight different sample target image files and the corresponding different exposure parameters can be substituted into formula (7) to obtain A1 , A2 , A3 , A4 , B1 , B2 , B3 and B4 in one regression.
- it is not necessary to conduct multi-step experiments and it is not necessary to first conduct camera optical characteristic calibration experiments to find the relationship between tristimulus values and image RGB values. That is, it is not necessary to fit the intermediate variables A′1 , A′2 and A′3 in the above formulas (2), (3) and ( 4 ), and then fit the relationship between the floating-point gray value calculated by the tristimulus values and the object brightness value.
- the method before step S120, further includes vignetting correction on the target image file. Specifically, this is achieved by using a ⁇ resize ⁇ function (e.g., the ⁇ resize ⁇ function in Python or C++) to reduce the vignetting effect. Reducing the vignetting effect results in more accurate object-side brightness values.
- the simplest way to correct vignetting is to reduce the size of the target image file using the ⁇ resize ⁇ function, thereby minimizing the impact of darkened edge pixels on the overall brightness distribution of the measured environment.
- Vignetting can also be corrected by adjusting the vignetting coefficient of the camera device, thus reducing the darkening of edge pixels in the target image file.
- the vignetting effect can also be corrected for the sample image files, so that the object-side brightness value of each pixel output by the final object-side brightness regression model is more accurate.
- the ambient light spatial distribution measurement device provided in this application is described below.
- the ambient light spatial distribution measurement device described below can be referred to in correspondence with the ambient light spatial distribution measurement method described above.
- the ambient brightness spatial distribution measurement device of this application embodiment is applied to a terminal, as shown in FIG12.
- the device includes: a measurement command receiving module 1210, an exposure parameter determining module 1220, a target image file acquisition module 1230, a brightness value calculation module 1240, and a pseudo color map generation module 1250.
- the measurement command receiving module 1210 is configured to receive an ambient brightness measurement command and trigger the camera's image sensor to acquire an initial image of the environment to be measured.
- the exposure parameter determination module 1220 is configured to determine the target exposure parameters based on the initial image.
- the target image file acquisition module 1230 is configured to receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment.
- the brightness value calculation module 1240 is configured to calculate the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters.
- the pseudo-color map generation module 1250 is configured to generate and display a pseudo-color map of the luminance spatial distribution under the measured environment based on the object luminance value.
- the ambient brightness spatial distribution measurement device of this application acquires target image files by capturing the current environment to be measured in real time, calculates the object-side brightness value of each pixel in the target image file by combining the exposure parameters at the time of shooting, and generates and displays a pseudo-color map of the brightness spatial distribution under the environment to be measured based on the object-side brightness value of each pixel, thereby realizing the visualization of ambient brightness and providing intuitive design reference for lighting designers.
- the ambient brightness spatial distribution measurement device further includes: a brightness distribution file generation module, configured to, after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters, generate a brightness distribution file based on the object-space brightness value, wherein the brightness distribution file is configured to store the object-space brightness value of each pixel in the target image file in the form of a table; wherein the row and column positions of the table containing the object-space brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file.
- a brightness distribution file generation module configured to, after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters, generate a brightness distribution file based on the object-space brightness value, wherein the brightness distribution file is configured to store the object-space brightness value of each pixel in the target image file in the form of a table; wherein the row and column positions of the table containing the object
- the ambient brightness spatial distribution measurement device further includes: a first row and column coordinate acquisition module, configured to acquire the row and column coordinates of a target pixel point specified by the user on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
- a first row and column coordinate acquisition module configured to acquire the row and column coordinates of a target pixel point specified by the user on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
- the first brightness value query module is configured to query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file based on the row and column coordinates of the target pixel.
- the pixel brightness value display module is configured to display the brightness value of the target object.
- the ambient brightness spatial distribution measurement device further includes a target area acquisition module, configured to acquire a user-specified target area on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
- a target area acquisition module configured to acquire a user-specified target area on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
- the second row and column coordinate acquisition module is configured to acquire the row and column coordinates of the target pixels, taking all pixels in the target region as target pixels.
- the second brightness value query module is configured to query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file based on the row and column coordinates of the target pixel.
- the area brightness value display module is configured to display statistical values of the brightness value of the target object.
- the ambient brightness spatial distribution measurement device further includes: a brightness statistics display module, configured to calculate and display statistical values of the object-space brightness values of all pixels in the target image file after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters.
- a brightness statistics display module configured to calculate and display statistical values of the object-space brightness values of all pixels in the target image file after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters.
- the ambient brightness spatial distribution measurement device further includes: a scene category receiving module, configured to receive the scene category of the environment to be measured, input by the user, after generating and displaying a pseudo-color map of the brightness spatial distribution of the environment to be measured based on the object brightness value.
- a scene category receiving module configured to receive the scene category of the environment to be measured, input by the user, after generating and displaying a pseudo-color map of the brightness spatial distribution of the environment to be measured based on the object brightness value.
- the recommended statistical value determination module is configured to determine the recommended statistical value of the brightness corresponding to the environment to be measured based on the scene category.
- the target image file acquisition module 1230 specifically includes a raw format file acquisition module, configured to acquire raw format files captured by the camera.
- the file format conversion module is configured to convert the raw format file into an RGB three-channel format file according to a preset conversion method, and determine the RGB three-channel format file as the target image file.
- the pseudo-color image generation module 1250 specifically includes: a grayscale image generation module, configured to normalize the object-side brightness value of each pixel from 0 to 2n -1 to generate an n-bit storage grayscale image representing the brightness distribution, where n is a multiple of 8.
- the pseudo-color map conversion module is configured to convert the grayscale image into a brightness distribution pseudo-color map.
- the brightness value calculation module 1240 specifically includes a pixel value extraction module, configured to extract the pixel values of each pixel in the target image file in the r, g and b channels respectively.
- the regression model execution module is configured to input the pixel value and the target exposure parameter into the object-space luminance regression model to obtain the object-space luminance value of each pixel output by the object-space luminance regression model.
- the object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
- Figure 13 illustrates a schematic diagram of the physical structure of an electronic device.
- the electronic device may include: a processor 1310, a communication interface 1320, a memory 1330, and a communication bus 1340.
- the processor 1310, communication interface 1320, and memory 1330 communicate with each other via the communication bus 1340.
- the processor 1310 can call logical instructions in the memory 1330 to execute an ambient brightness spatial distribution measurement method, which includes the following steps.
- the camera's image sensor Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
- the target exposure parameters are determined.
- the camera Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
- a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
- the logical instructions in the aforementioned memory 1330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
- This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
- the aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
- this application also provides a computer program product, which may be on a non-transitory computer-readable medium or a downloaded app, etc.
- the computer program product includes a computer program, which can be stored on a non-transitory computer-readable storage medium.
- the computer program When the computer program is executed by a processor, the computer can perform the ambient brightness spatial distribution measurement method provided by the above methods, which includes the following steps.
- the camera's image sensor Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
- the target exposure parameters are determined.
- the camera Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
- a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
- this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the ambient brightness spatial distribution measurement method provided by the above methods, the method comprising the following steps.
- the camera's image sensor Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
- the target exposure parameters are determined.
- the camera Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
- a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
- the device embodiments described above are merely illustrative.
- the units described as separate components may or may not be physically separate.
- the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
- each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware.
- This technical solutions in essence or the part that contributes to conventional technology, can be embodied in the form of a software product.
- This computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Analysis (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Computational Mathematics (AREA)
- Mathematical Optimization (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Databases & Information Systems (AREA)
- Operations Research (AREA)
- Probability & Statistics with Applications (AREA)
- Bioinformatics & Computational Biology (AREA)
- Algebra (AREA)
- Photometry And Measurement Of Optical Pulse Characteristics (AREA)
- Evolutionary Biology (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Spectrometry And Color Measurement (AREA)
Abstract
Description
相关申请的交叉引用Cross-references to related applications
本申请要求于2024年05月28日提交的申请号为2024106784177,名称为“环境亮度空间分布测量方法及装置”的中国专利申请的优先权,其通过引用方式全部并入本文。This application claims priority to Chinese Patent Application No. 2024106784177, filed on May 28, 2024, entitled “Method and Apparatus for Measuring Spatial Distribution of Ambient Brightness”, which is incorporated herein by reference in its entirety.
本申请涉及亮度测量技术领域,尤其涉及一种环境亮度空间分布测量方法及装置。This application relates to the field of brightness measurement technology, and in particular to a method and apparatus for measuring the spatial distribution of ambient brightness.
传统相关技术中,通过照片识别环境亮度的研究很少,计算摄影学中的光度立体法是为数不多的相似研究。在光度立体法中,假设光照是均匀的、定向的,并且光照方向已知,通过在不同的光照条件下拍摄物体的图像,可以得到一系列图像,每个图像中的像素值受到物体表面法线和光照方向的影响。根据光度方程,可以将像素的物方亮度值(照片中每个像素在拍摄环境下的实际亮度值,单位为:坎德拉/平方米)表示为光照方向和表面法线的函数,通过对这些图像进行分析,可以通过解方程组的方式来估计像素的法线信息,即能够得到像素的物方亮度值。In traditional related technologies, research on identifying ambient brightness through photographs is scarce. Photometric stereochemistry in computational photography is one of the few similar studies. In photometric stereochemistry, it is assumed that illumination is uniform and directional, and the direction of illumination is known. By taking images of an object under different lighting conditions, a series of images can be obtained. The pixel value in each image is affected by the object's surface normal and the direction of illumination. According to the photometric equation, the object-side brightness value of a pixel (the actual brightness value of each pixel in the photograph under the shooting environment, in candela per square meter) can be expressed as a function of the illumination direction and the surface normal. By analyzing these images, the normal information of the pixels can be estimated by solving a system of equations, thus obtaining the object-side brightness value of the pixels.
上述方法仅能估计像素的物方亮度值,无法获得环境亮度空间分布的可视化显示,无法直观地为灯光设计师提供设计参考。The above method can only estimate the object-side brightness value of pixels, and cannot obtain a visual display of the spatial distribution of ambient brightness, thus failing to provide intuitive design references for lighting designers.
本申请提供一种环境亮度空间分布测量方法及装置,用以解决传统技术的环境亮度测量方法无法获得环境亮度空间分布的可视化显示,无法直观地为灯光设计师提供设计参考的问题。This application provides a method and apparatus for measuring the spatial distribution of ambient brightness, which solves the problem that traditional ambient brightness measurement methods cannot obtain a visual display of the spatial distribution of ambient brightness, and cannot intuitively provide design references for lighting designers.
本申请提供一种环境亮度空间分布测量方法,包括如下步骤:This application provides a method for measuring the spatial distribution of ambient brightness, including the following steps:
接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像;Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
基于所述初始图像,确定目标曝光参数;Based on the initial image, determine the target exposure parameters;
接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件;Receive the shooting instruction, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment;
基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值;Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file;
基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。Based on the object luminance value, a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
根据本申请提供的一种环境亮度空间分布测量方法,在基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值之后,还包括:According to the ambient brightness spatial distribution measurement method provided in this application, after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters, the method further includes:
基于所述物方亮度值,生成亮度分布文件,所述亮度分布文件被配置为以表格的形式存储所述目标图像文件中每个像素的物方亮度值;Based on the object luminance values, a luminance distribution file is generated, which is configured to store the object luminance values of each pixel in the target image file in tabular form.
其中,每个像素的物方亮度值所在表格的行列位置与对应像素在目标图像文件中的行列坐标一一对应。In this table, the row and column positions of the object-side brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file.
根据本申请提供的一种环境亮度空间分布测量方法,在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,还包括:According to the method for measuring the spatial distribution of ambient brightness provided in this application, after generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object brightness value, the method further includes:
获取亮度空间分布伪色图上用户指定的目标像素点的行列坐标;Obtain the row and column coordinates of the user-specified target pixel on the luminance spatial distribution pseudo-color map;
基于所述目标像素点的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值;Based on the row and column coordinates of the target pixel, query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file;
显示所述目标物方亮度值。Display the brightness value of the target object.
根据本申请提供的一种环境亮度空间分布测量方法,在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,还包括:According to the method for measuring the spatial distribution of ambient brightness provided in this application, after generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object brightness value, the method further includes:
获取亮度空间分布伪色图上用户指定的目标区域;Obtain the user-specified target region on the luminance spatial distribution pseudocolor map;
以所述目标区域中所有像素为目标像素点,获取所述目标像素点的行列坐标;Using all pixels in the target region as target pixels, obtain the row and column coordinates of the target pixels;
基于所述目标像素的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值;Based on the row and column coordinates of the target pixel, query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file;
显示所述目标物方亮度值的统计值。This displays the statistical values of the brightness of the target object.
根据本申请提供的一种环境亮度空间分布测量方法,在基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值之后,还包括:According to the ambient brightness spatial distribution measurement method provided in this application, after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters, the method further includes:
计算所述目标图像文件中所有像素的物方亮度值的统计值并显示。Calculate and display the statistical values of the object-side brightness of all pixels in the target image file.
根据本申请提供的一种环境亮度空间分布测量方法,在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,还包括:According to the method for measuring the spatial distribution of ambient brightness provided in this application, after generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object brightness value, the method further includes:
接收用户输入的待测量环境所属的场景类别;Receive the scene category of the environment to be measured, as input by the user;
基于所述场景类别,确定所述待测量环境对应的亮度的推荐统计值。Based on the scene category, a recommended statistical value for the brightness corresponding to the environment to be measured is determined.
根据本申请提供的一种环境亮度空间分布测量方法,获取拍摄的待测量环境下的目标图像文件,包括:According to the method for measuring the spatial distribution of ambient brightness provided in this application, a target image file captured under the environment to be measured is obtained, including:
获取相机拍摄的raw格式文件;Obtain RAW format files captured by the camera;
将所述raw格式文件按预设转换方式转换为rgb三通道格式文件,确定所述rgb三通道格式文件为所述目标图像文件。The raw format file is converted to an RGB three-channel format file according to a preset conversion method, and the RGB three-channel format file is determined to be the target image file.
根据本申请提供的一种环境亮度空间分布测量方法,基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示,包括:According to the method for measuring the spatial distribution of ambient luminance provided in this application, based on the object luminance value, a pseudo-color map of the spatial distribution of luminance in the environment to be measured is generated and displayed, including:
将每个像素的物方亮度值进行0~2n-1的归一化处理,以生成n位存储位的表示亮度分布灰度图,n为8的倍数;The object-side brightness value of each pixel is normalized from 0 to 2n -1 to generate an n-bit grayscale image representing the brightness distribution, where n is a multiple of 8.
将所述灰度图转换成亮度分布伪色图。The grayscale image is converted into a brightness distribution pseudo-color image.
根据本申请提供的一种环境亮度空间分布测量方法,基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值,包括:According to the ambient brightness spatial distribution measurement method provided in this application, based on the target image file and the target exposure parameters, the object-space brightness value of each pixel in the target image file is calculated, including:
提取所述目标图像文件中每个像素分别在r、g和b三通道的像素值;Extract the pixel values of each pixel in the target image file in the r, g, and b channels respectively;
将所述像素值和所述目标曝光参数输入物方亮度回归模型,得到所述物方亮度回归模型输出的每个像素的物方亮度值;The pixel value and the target exposure parameter are input into the object-space luminance regression model to obtain the object-space luminance value of each pixel output by the object-space luminance regression model.
其中,所述物方亮度回归模型是基于样本目标图像文件的曝光参数、所述样本目标图像文件中像素的像素值以及所述样本目标图像文件中像素对应的物方亮度标准值拟合回归得到的。The object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
根据本申请提供的一种环境亮度空间分布测量装置,应用于终端,所述装置包括如下模块:An ambient brightness spatial distribution measurement device according to this application is applied to a terminal, and the device includes the following modules:
测量指令接收模块,被配置为接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像;The measurement command receiving module is configured to receive ambient brightness measurement commands and trigger the camera's image sensor to acquire an initial image of the environment to be measured.
曝光参数确定模块,被配置为基于所述初始图像,确定目标曝光参数;An exposure parameter determination module is configured to determine target exposure parameters based on the initial image;
目标图像文件获取模块,被配置为接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件;The target image file acquisition module is configured to receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment.
亮度值计算模块,被配置为基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值;The brightness value calculation module is configured to calculate the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters;
伪色图生成模块,被配置为基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。The pseudo-color map generation module is configured to generate and display a pseudo-color map of the luminance spatial distribution under the measured environment based on the object luminance value.
本申请还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述的环境亮度空间分布测量方法。This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ambient brightness spatial distribution measurement method as described above.
本申请还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述的环境亮度空间分布测量方法。This application also provides a computer program product, including a computer program that, when executed by a processor, implements the ambient brightness spatial distribution measurement method as described above.
本申请提供的环境亮度空间分布测量方法及装置,通过接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像;基于所述初始图像,确定目标曝光参数;接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件;基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值;基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。本申请通过对当前的待测量环境实时拍摄获取目标图像文件,结合拍摄时的曝光参数计算目标图像文件中每个像素的物方亮度值,并根据每个像素的物方亮度值生成所述待测量环境下的亮度空间分布伪色图并显示,从而实现了环境亮度的可视化显示,能够直观地为灯光设计师提供设计参考。The method and apparatus for measuring the spatial distribution of ambient brightness provided in this application involve receiving an ambient brightness measurement command, triggering the camera's image sensor to acquire an initial image of the environment to be measured; determining target exposure parameters based on the initial image; receiving a shooting command, triggering the camera to take a picture according to the target exposure parameters, and acquiring a target image file of the environment to be measured; calculating the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters; and generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object-side brightness values. This application achieves a visual display of ambient brightness by capturing a target image file of the current environment to be measured in real time, calculating the object-side brightness value of each pixel in the target image file based on the exposure parameters at the time of shooting, and generating and displaying a pseudo-color map of the spatial distribution of brightness in the environment to be measured based on the object-side brightness value of each pixel. This provides an intuitive design reference for lighting designers.
为了更清楚地说明本申请或传统技术中的技术方案,下面将对实施例或传统技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。To more clearly illustrate the technical solutions in this application or conventional technology, the drawings used in the description of the embodiments or conventional technology will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
图1是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之一。Figure 1 is one of the flowcharts of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
图2是本申请实施例提供的环境亮度空间分布测量方法中通过终端拍摄的待测量环境照片的界面显示图。Figure 2 is an interface display diagram of the photograph of the environment to be measured taken by the terminal in the method for measuring the spatial distribution of ambient brightness provided in the embodiment of this application.
图3是本申请实施例提供的环境亮度空间分布测量方法中亮度空间分布伪色图的显示界面示意图。Figure 3 is a schematic diagram of the display interface of the pseudo-color map of the spatial distribution of brightness in the ambient brightness measurement method provided in the embodiment of this application.
图4是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之二。Figure 4 is a second schematic flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
图5是本申请实施例提供的环境亮度空间分布测量方法中显示用户指定点像素物方亮度值的示意图。Figure 5 is a schematic diagram showing the object-side brightness value of a pixel at a user-specified point in the ambient brightness spatial distribution measurement method provided in this application embodiment.
图6是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之三。Figure 6 is a flowchart of the third embodiment of the method for measuring the spatial distribution of ambient brightness provided in this application.
图7是本申请实施例提供的环境亮度空间分布测量方法中显示用户指定区域的目标像素物方亮度值的示意图。Figure 7 is a schematic diagram showing the object-space brightness value of a target pixel in a user-specified area in the ambient brightness spatial distribution measurement method provided in the embodiments of this application.
图8是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之四。Figure 8 is a flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
图9是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之五。Figure 9 is a flowchart of the fifth embodiment of the method for measuring the spatial distribution of ambient brightness provided in this application.
图10是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之六。Figure 10 is a schematic flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
图11是本申请实施例提供的环境亮度空间分布测量方法的流程示意图之七。Figure 11 is the seventh flowchart of the method for measuring the spatial distribution of ambient brightness provided in the embodiments of this application.
图12是本申请实施例提供的环境亮度空间分布测量装置的结构示意图。Figure 12 is a schematic diagram of the structure of the ambient light spatial distribution measurement device provided in the embodiment of this application.
图13是本申请实施例提供的电子设备的结构示意图。Figure 13 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
本申请实施例的环境亮度空间分布测量方法,应用于终端,所述终端可以是智能手机或平板电脑等设备,所述方法包括以下步骤S110至步骤S140。The method for measuring the spatial distribution of ambient brightness according to this application is applied to a terminal, which may be a device such as a smartphone or tablet computer. The method includes the following steps S110 to S140.
步骤S110:接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像。具体地,终端接收用户触发的环境亮度测量指令,触发终端中相机的图像传感器采集待测量环境的初始图像,即在接收环境亮度测量指令,启动相机模组,图像传感器将采集到的所述初始图像在终端显示屏中显示,用户可观察初始图像,调整拍摄视角。Step S110: Receive an ambient brightness measurement command and trigger the camera's image sensor to acquire an initial image of the environment to be measured. Specifically, the terminal receives an ambient brightness measurement command triggered by the user, triggering the image sensor of the camera in the terminal to acquire an initial image of the environment to be measured. That is, upon receiving the ambient brightness measurement command, the camera module is activated, and the image sensor displays the acquired initial image on the terminal's display screen. The user can observe the initial image and adjust the shooting angle.
步骤S120:基于所述初始图像,确定目标曝光参数,具体地,可以将相机的默认曝光参数(对于不同的场景,相机都会自动生成一组默认曝光参数)确定为目标曝光参数。优选地,接收用户对默认曝光参数的调整,将调整后的曝光参数确定为目标曝光参数,按调整后曝光参数曝光得到目标图像文件,其画面的整体亮度在用户感官上会接近于实际场景,使得后续计算得到像素的物方亮度值更准确。Step S120: Based on the initial image, determine the target exposure parameters. Specifically, the camera's default exposure parameters (the camera automatically generates a set of default exposure parameters for different scenes) can be determined as the target exposure parameters. Preferably, the user's adjustment of the default exposure parameters is received, the adjusted exposure parameters are determined as the target exposure parameters, and the target image file is obtained by exposing according to the adjusted exposure parameters. The overall brightness of the image will be close to the actual scene in the user's perception, making the subsequently calculated object-side brightness values of pixels more accurate.
步骤S130:接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件。在确定好目标曝光参数后,用户发出拍摄指令,终端接收拍摄指令,并按所述目标曝光参数触发相机拍照,从而获取拍摄的待测量环境下的目标图像文件。如图2所示,为智能手机拍摄的卧室环境下的目标图像文件展示示意图,图像下方区域可以展示该图像对应的曝光参数。Step S130: Receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file of the environment to be measured. After determining the target exposure parameters, the user issues a shooting command, the terminal receives the shooting command, and triggers the camera to take a picture according to the target exposure parameters, thereby acquiring the target image file of the environment to be measured. As shown in Figure 2, this is a schematic diagram of a target image file taken by a smartphone in a bedroom environment. The area below the image can display the corresponding exposure parameters.
步骤S140:基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值。Step S140: Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file.
步骤S150:基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。如图3所示,为图2对应的目标图像文件的亮度空间分布伪色图,亮度空间分布伪色图可以更直观地展示整个待测量环境下的明暗分布,用户可以通过观察该伪色图了解整个待测量环境的亮度空间分布情况,为该环境中灯光设计提供更直观地参考。Step S150: Based on the object luminance value, generate and display a pseudo-color map of the luminance spatial distribution in the environment to be measured. As shown in Figure 3, this is the pseudo-color map of the luminance spatial distribution of the target image file corresponding to Figure 2. The pseudo-color map of the luminance spatial distribution can more intuitively show the distribution of light and dark in the entire environment to be measured. Users can understand the luminance spatial distribution of the entire environment to be measured by observing this pseudo-color map, providing a more intuitive reference for lighting design in this environment.
本实施例的环境亮度空间分布测量方法,通过对当前的待测量环境实时拍摄获取目标图像文件,结合拍摄时的曝光参数计算目标图像文件中每个像素的物方亮度值,并根据每个像素的物方亮度值生成所述待测量环境下的亮度空间分布伪色图并显示,从而实现了环境亮度的可视化显示,能够直观地为灯光设计师提供设计参考。The ambient brightness spatial distribution measurement method of this embodiment acquires target image files by real-time shooting of the current environment to be measured, calculates the object-side brightness value of each pixel in the target image file by combining the exposure parameters at the time of shooting, and generates and displays a pseudo-color map of the brightness spatial distribution in the environment to be measured based on the object-side brightness value of each pixel, thereby realizing the visualization of ambient brightness and providing intuitive design reference for lighting designers.
在一些实施例中,在步骤S140之后,还包括:计算所述目标图像文件中所有像素的物方亮度值的统计值并显示,其中,统计值包括:平均物方亮度值、最大物方亮度值和最小物方亮度值。如图3所示,终端界面中不只显示亮度空间分布伪色图,该伪色图一侧还显示平均物方亮度值、最大物方亮度值和最小物方亮度值。优选地,在亮度空间分布伪色图中还显示最大物方亮度值的标记点和最小物方亮度值的标记点,以标记出待测量环境中最亮和最暗各自所在位置。实际应用中,待测量环境中可能会布设多盏相同功率的灯具,因此,每盏灯处都标记最大物方亮度值的标记点,即最大物方亮度值的标记点可以有多个,同理,最小物方亮度值的标记点也可以有多个。In some embodiments, after step S140, the method further includes: calculating and displaying statistical values of the object-side luminance values of all pixels in the target image file, wherein the statistical values include: average object-side luminance value, maximum object-side luminance value, and minimum object-side luminance value. As shown in Figure 3, the terminal interface displays not only a pseudo-color map of luminance spatial distribution, but also the average object-side luminance value, maximum object-side luminance value, and minimum object-side luminance value on one side of the pseudo-color map. Preferably, the pseudo-color map of luminance spatial distribution also displays markers for the maximum and minimum object-side luminance values to mark the locations of the brightest and darkest areas in the environment to be measured. In practical applications, multiple lamps of the same power may be installed in the environment to be measured. Therefore, a marker for the maximum object-side luminance value is marked at each lamp, meaning there can be multiple markers for the maximum object-side luminance value. Similarly, there can also be multiple markers for the minimum object-side luminance value.
在一些实施例中,在步骤S140之后,还包括:基于所述物方亮度值,生成亮度分布文件,所述亮度分布文件被配置为以表格的形式存储所述目标图像文件中每个像素的物方亮度值,其中,每个像素的物方亮度值所在表格的行列位置与对应像素在目标图像文件中的行列坐标一一对应。具体地,亮度分布文件为csv格式文件,csv格式文件是以纯文本形式存储表格数据的文件,可以理解的是,csv格式文件中的表格的行列总数与目标图像文件中像素的行列总数相同。通过csv格式文件可存储目标图像文件中每个像素的物方亮度值,以便后续查询任一像素的物方亮度值。In some embodiments, after step S140, the method further includes: generating a brightness distribution file based on the object-side brightness values. The brightness distribution file is configured to store the object-side brightness values of each pixel in the target image file in tabular form, wherein the row and column positions of the table containing the object-side brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file. Specifically, the brightness distribution file is a CSV file. A CSV file is a file that stores tabular data in plain text format. It can be understood that the total number of rows and columns in the table in the CSV file is the same as the total number of rows and columns of pixels in the target image file. The object-side brightness values of each pixel in the target image file can be stored in the CSV file for subsequent querying of the object-side brightness value of any pixel.
在一些实施例中,如图4所示,在步骤S150之后,还包括步骤S410至S430。In some embodiments, as shown in FIG4, steps S410 to S430 are further included after step S150.
步骤S410:获取亮度空间分布伪色图上用户指定的目标像素点的行列坐标,具体地,用户指定的目标像素点即为用户在亮度空间分布伪色图上点击的触控点,可通过终端屏幕感应用户触点位置,从而确定所述目标像素点的行列坐标。Step S410: Obtain the row and column coordinates of the target pixel point specified by the user on the luminance spatial distribution pseudo-color map. Specifically, the target pixel point specified by the user is the touch point clicked by the user on the luminance spatial distribution pseudo-color map. The row and column coordinates of the target pixel point can be determined by sensing the user's touch point position through the terminal screen.
步骤S420:基于所述目标像素点的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值,即根据每个像素的物方亮度值所在亮度分布文件中表格的行列位置与对应像素在目标图像文件中的行列坐标的一一对应关系,在亮度分布文件中查询得到该目标像素点对应的目标物方亮度值。Step S420: Based on the row and column coordinates of the target pixel, query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file. That is, according to the one-to-one correspondence between the row and column position of the table in the brightness distribution file where the object brightness value of each pixel is located and the row and column coordinates of the corresponding pixel in the target image file, query the target object brightness value corresponding to the target pixel in the brightness distribution file.
步骤S430:显示所述目标物方亮度值,如图5所示,显示了亮度空间分布伪色图上两个指定目标像素点的目标物方亮度值。Step S430: Display the target object brightness value. As shown in Figure 5, the target object brightness value of two specified target pixels on the brightness spatial distribution pseudo-color map is displayed.
本实施例实现了对用户指定的目标像素点的目标物方亮度值的实时显示,实际应用中,可以显示用户指定的某一空间区域的多个目标像素点对应的目标物方亮度值,以便用户查看多个目标物方亮度值的差异,差异太大,说明该空间区域的亮度分布不均匀。例如:图5中,指定床所在空间区域的多个目标像素点,从而实时显示床所在空间区域的多个目标物方亮度值,如果床所在空间区域的多个目标物方亮度值差异较大(如:某一点或两点均和其它点物方亮度值的差值太大),说明床所在空间区域的亮度分布不均匀,会影响睡眠,需要床周围的灯具布局。This embodiment enables real-time display of the target object brightness value of a user-specified target pixel. In practical applications, it can display the target object brightness values corresponding to multiple target pixels in a user-specified spatial area, allowing the user to view the differences between the brightness values of multiple target objects. Large differences indicate uneven brightness distribution in that spatial area. For example, in Figure 5, multiple target pixels in the space where the bed is located are specified, thus displaying the real-time brightness values of multiple target objects in that space. If the differences between the brightness values of multiple target objects in the space where the bed is located are large (e.g., the difference between the brightness values of one or two points and other points is too large), it indicates uneven brightness distribution in the space where the bed is located, which will affect sleep and necessitates a proper lighting arrangement around the bed.
优选地,步骤S430之后还包括:实时计算多个目标物方亮度值的目标平均值,并将任一目标物方亮度值与目标平均值比较,若任一目标物方亮度值与目标平均值的差值大于预设阈值(预设阈值可根据实际情况设定,例如:目标平均值的20%)的情况下,在终端的显示界面提示亮度分布不均匀。具体地,用户每指定一个目标像素点,都会计算一次平均值,并进行一次比较,实时地提示亮度分布是否均匀。Preferably, after step S430, the method further includes: calculating the target average value of the brightness values of multiple target objects in real time, comparing any target object brightness value with the target average value, and if the difference between any target object brightness value and the target average value is greater than a preset threshold (the preset threshold can be set according to actual conditions, for example, 20% of the target average value), displaying a message on the terminal's display interface indicating uneven brightness distribution. Specifically, for each target pixel specified by the user, an average value is calculated and compared, providing a real-time message indicating whether the brightness distribution is uniform.
在一些实施例中,如图6所示,在步骤S150之后,还包括步骤S610至S640。In some embodiments, as shown in FIG6, steps S610 to S640 are further included after step S150.
步骤S610:获取亮度空间分布伪色图上用户指定的目标区域。具体地,通过感应用户在终端界面上圈出的封闭区域得到所述目标区域,如图7所示,用户划出了床所在空间的区域。Step S610: Obtain the target area specified by the user on the luminance spatial distribution pseudo-color map. Specifically, the target area is obtained by sensing the closed area circled by the user on the terminal interface, as shown in Figure 7, where the user has drawn the area of the space where the bed is located.
步骤S620:以所述目标区域中所有像素为目标像素点,获取所述目标像素点的行列坐标。具体地,通过目标区域确定其中的所有目标像素点,确定了目标像素点,即能够获取目标像素点的行列坐标。Step S620: Using all pixels in the target region as target pixels, obtain the row and column coordinates of the target pixels. Specifically, by determining all target pixels within the target region, the row and column coordinates of the target pixels can be obtained.
步骤S630:基于所述目标像素的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值。具体地,对于每一个目标像素点,根据每个像素的物方亮度值所在亮度分布文件中表格的行列位置与对应像素在目标图像文件中的行列坐标的一一对应关系,在亮度分布文件中查询得到该目标像素点对应的目标物方亮度值。Step S630: Based on the row and column coordinates of the target pixel, query the target object-side brightness value recorded at the corresponding row and column position in the brightness distribution file. Specifically, for each target pixel, according to the one-to-one correspondence between the row and column position of the table in the brightness distribution file where the object-side brightness value of each pixel is located and the row and column coordinates of the corresponding pixel in the target image file, query the brightness distribution file to obtain the target object-side brightness value corresponding to that target pixel.
步骤S640:显示所述目标物方亮度值的统计值。如图7所示,显示了亮度空间分布伪色图上目标区域的区域物方亮度统计值,即该区域目标物方亮度值的统计值,例如:显示该目标区域中所有目标像素点的目标物方亮度值的平均值,通过平均值来表示该目标区域的整体亮度情况。Step S640: Display the statistical value of the target object brightness value. As shown in Figure 7, the statistical value of the target area brightness in the target area on the brightness spatial distribution pseudo-color map is displayed, that is, the statistical value of the target object brightness value in the area. For example, the average value of the target object brightness value of all target pixels in the target area is displayed, and the average value is used to represent the overall brightness of the target area.
本实施例中,通过显示用户划定的目标区域的区域物方亮度统计值,为用户提供了区域亮度参考。In this embodiment, by displaying the regional object brightness statistics of the target area defined by the user, a regional brightness reference is provided to the user.
需要说明的是:在执行步骤S610至步骤S640的基础上,结合执行上述步骤S410至S430,即在目标区域内进一步指定目标像素点,从而既能够获取该目标区域的整体亮度情况,又能够判断该目标区域的亮度分布均匀性是否达到要求。It should be noted that: based on the execution of steps S610 to S640, combined with the execution of the above steps S410 to S430, that is, further specifying target pixels in the target area, so as to obtain the overall brightness of the target area and determine whether the brightness distribution uniformity of the target area meets the requirements.
在一些实施例中,如图8所示,在步骤S150之后,还包括步骤S810和S820。In some embodiments, as shown in FIG8, steps S810 and S820 are further included after step S150.
步骤S810:接收用户输入的待测量环境所属的场景类别,场景类别例如:卧室、客厅、书房、茶室、KTV包房和体育馆等类别。具体地,如图3、5和7所示,在终端界面亮度空间分布伪色图的一侧的编辑框中输入场景类别。Step S810: Receive the scene category of the environment to be measured, input by the user. Scene categories include, for example, bedroom, living room, study, tea room, KTV room, and gymnasium. Specifically, as shown in Figures 3, 5, and 7, the scene category is entered in the edit box on one side of the pseudo-color map of the brightness spatial distribution on the terminal interface.
步骤S820:基于所述场景类别,确定所述待测量环境对应的亮度的推荐统计值。具体地,可以预设场景类别及与其对应的亮度的推荐统计值的映射表,在接收到用户输入的场景类别后,根据映射表查找到对应的推荐统计值,并在显示推荐统计值的区域显示该推荐统计值。场景类别对应推荐统计值可以为亮度平均值,反映不同场景的亮度平均亮度。本实施例中,通过场景类别输出亮度的推荐统计值,可以快捷地为用户提供亮度分布设计参考。Step S820: Based on the scene category, determine the recommended statistical value of the brightness corresponding to the environment to be measured. Specifically, a mapping table of scene categories and their corresponding recommended statistical values of brightness can be preset. After receiving the scene category input by the user, the corresponding recommended statistical value is found according to the mapping table, and the recommended statistical value is displayed in the area for displaying recommended statistical values. The recommended statistical value corresponding to the scene category can be the average brightness, reflecting the average brightness of different scenes. In this embodiment, outputting the recommended statistical value of brightness through scene category can quickly provide users with a reference for brightness distribution design.
在一些实施例中,如图9所示,步骤S130具体包括步骤S910和S920。In some embodiments, as shown in FIG9, step S130 specifically includes steps S910 and S920.
步骤S910:获取相机拍摄的raw格式文件,raw格式文件是未经处理,也未经压缩的图像编码数据,记录了相机传感器的原始信息。Step S910: Obtain the raw format file captured by the camera. The raw format file is unprocessed and uncompressed image encoding data, which records the original information of the camera sensor.
步骤S920:将所述raw格式文件按预设转换方式转换为rgb三通道格式文件,确定所述rgb三通道格式文件为所述目标图像文件,例如:将raw格式文件转换成jpg或png格式文件。其中,预设转换方式为统一的ISP(Image Signal Processor,图像信号处理器)处理流程,得到rgb三通道格式文件,统一的ISP流程可以通过ISP算法流程库libraw C++库或python封装的rawpy库中的postprocess函数转换实现。具体地,将raw格式文件作为参数输入postprocess函数采用统一的ISP流程将raw格式文件转换成rgb三通道格式文件并输出。Step S920: Convert the raw format file to an RGB three-channel format file using a preset conversion method, and determine that the RGB three-channel format file is the target image file. For example, convert the raw format file to a JPG or PNG format file. The preset conversion method is a unified ISP (Image Signal Processor) processing flow to obtain the RGB three-channel format file. The unified ISP flow can be implemented using the libraw C++ library or the postprocess function in the Python-encapsulated rawpy library. Specifically, the raw format file is input as a parameter to the postprocess function, which uses the unified ISP flow to convert the raw format file to an RGB three-channel format file and outputs it.
本实施例中,无论采用什么拍摄设备,通过该拍摄设备的raw格式文件,将raw格式文件按统一的ISP流程转换为rgb三通道格式文件,屏蔽了不同手机或相机厂商采用不同ISP流程得到不同目标图像文件中像素值对亮度计算的不利影响,使得最终测量的像素的物方像素值更准确且更稳定。In this embodiment, regardless of the shooting device used, the raw format file of the shooting device is converted into an RGB three-channel format file according to a unified ISP process. This shields the adverse effects of different target image files obtained by different mobile phone or camera manufacturers using different ISP processes on brightness calculation, making the final measured object-side pixel value more accurate and stable.
在一些实施例中,如图10所示,步骤S150具体包括步骤S1010和步骤S1020。In some embodiments, as shown in FIG10, step S150 specifically includes steps S1010 and S1020.
步骤S1010:将每个像素的物方亮度值进行0~2n-1的归一化处理,以生成n位存储位的表示亮度分布灰度图,n为8的倍数。例如:n为16,将每个像素的物方亮度值归一化到0-65535(216-1)之间,生成16位png格式存储的亮度分布灰度图。Step S1010: Normalize the object-side luminance value of each pixel from 0 to 2n -1 to generate an n-bit grayscale image representing the luminance distribution, where n is a multiple of 8. For example, if n is 16, normalize the object-side luminance value of each pixel to the range of 0-65535 (2 ^16 - 1) to generate a 16-bit PNG format grayscale image representing the luminance distribution.
步骤S1020:将所述灰度图转换成亮度分布伪色图,本实施例中,可通过opencv:cv2.applyColorMap函数将灰度图转换成亮度分布伪色图。Step S1020: Convert the grayscale image into a brightness distribution pseudo-color map. In this embodiment, the grayscale image can be converted into a brightness distribution pseudo-color map using the opencv:cv2.applyColorMap function.
在一些实施例中,如图11所示,步骤S140具体包括步骤S1110和步骤S1120。In some embodiments, as shown in FIG11, step S140 specifically includes step S1110 and step S1120.
步骤S1110:提取所述目标图像文件中每个像素分别在r、g和b三通道的像素值。目标图像文件中每个像素都对应有r、g和b三个通道,每个通道都具在有0~255范围的像素值。本步骤中,通过提取目标图像文件中每个像素的r、g和b三通道的像素值,从而得到每个像素分别在r、g和b三个通道的像素值:IR值、IG值和IB值,且IR值、IG值和IB值均为0~255之间的整数。Step S1110: Extract the pixel values of each pixel in the target image file in the r, g, and b channels. Each pixel in the target image file corresponds to three channels: r, g, and b, and each channel has a pixel value in the range of 0 to 255. In this step, by extracting the pixel values of each pixel in the r, g, and b channels of the target image file, the pixel values of each pixel in the r, g, and b channels are obtained: IR value, IG value, and IB value, and the IR value, IG value, and IB value are all integers between 0 and 255.
步骤S1120:将所述像素值和所述目标曝光参数输入物方亮度回归模型,得到所述物方亮度回归模型输出的每个像素的物方亮度值。每个像素的物方亮度值即是拍摄环境中与每个像素对应点的环境亮度值,即实现了通过拍摄图像文件对环境亮度的测量。Step S1120: Input the pixel value and the target exposure parameters into the object-space brightness regression model to obtain the object-space brightness value of each pixel output by the object-space brightness regression model. The object-space brightness value of each pixel is the ambient brightness value of the corresponding point in the shooting environment, thus realizing the measurement of ambient brightness through the captured image file.
其中,所述物方亮度回归模型是基于样本目标图像文件的曝光参数、所述样本目标图像文件中像素的像素值以及所述样本目标图像文件中像素对应的物方亮度标准值拟合回归得到的。The object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
具体地,在拟合回归该物方亮度回归模型时,样本目标图像文件的曝光参数和样本目标图像文件中像素的像素值均是已知量,对于样本目标图像文件中像素对应的物方亮度标准值,在与拍摄环境相同的环境下,可以用成像亮度计等设备测量得到,由于成像亮度计能够测量拍摄环境中物体的亮度,得到准确的物方亮度值(即物方亮度标准值),基于物方亮度标准值进行拟合得到与物方亮度标准值相适应的物方亮度回归模型的拟合系数,从而利用该物方亮度回归模型可以准确地回归得到实时拍摄的目标图像文件中每个像素的物方亮度值,即环境亮度值,而且不再需要借助其它亮度测量设备,排除了设备因素的干扰,输出的物方亮度值具有较高的稳定性。Specifically, when fitting the object-side brightness regression model, the exposure parameters of the sample target image file and the pixel values of the pixels in the sample target image file are known quantities. For the standard object-side brightness value corresponding to the pixel in the sample target image file, it can be measured by devices such as an imaging luminance meter under the same environment as the shooting environment. Since the imaging luminance meter can measure the brightness of objects in the shooting environment, it can obtain an accurate object-side brightness value (i.e., the standard object-side brightness value). Based on the standard object-side brightness value, the fitting coefficient of the object-side brightness regression model that is adapted to the standard object-side brightness value is obtained. Thus, the object-side brightness regression model can be used to accurately regress the object-side brightness value of each pixel in the real-time captured target image file, i.e., the ambient brightness value, without the need for other brightness measurement devices, eliminating the interference of device factors, and the output object-side brightness value has high stability.
需要说明的是:在回归拟合物方亮度回归模型时,样本拍摄图像文件也是将raw格式文件按统一的ISP流程转换得到的rgb三通道格式文件,使得最终得到的物方亮度回归模型输出的每个像素的物方亮度值更准确。It should be noted that when fitting the object-side brightness regression model, the sample image files are also converted from raw format files to RGB three-channel format files using a unified ISP process, which makes the object-side brightness value of each pixel output by the final object-side brightness regression model more accurate.
在一些实施例中,所述物方亮度回归模型包括:第一子模型和第二子模型,所述第一子模型被配置为根据所述像素值确定所述像素值对应的三刺激值,并根据每个像素的三刺激值确定每个像素的浮点灰度值。In some embodiments, the object-side brightness regression model includes: a first sub-model and a second sub-model, wherein the first sub-model is configured to determine the tristimulus value corresponding to the pixel value based on the pixel value, and to determine the floating-point grayscale value of each pixel based on the tristimulus value of each pixel.
所述第二子模型被配置为根据每个像素的浮点灰度值和所述曝光参数确定每个像素的物方亮度值。The second sub-model is configured to determine the object-side brightness value of each pixel based on the floating-point grayscale value of each pixel and the exposure parameters.
在一些实施例中,第一子模型可通过如下公式回归拟合得到。
GF=α×R+β×G+γ×B (1)
In some embodiments, the first sub-model can be obtained by regression fitting using the following formula.
GF=α×R+β×G+γ×B (1)
其中,GF为像素的浮点灰度值,IR、IG和IB分别为所述三通道的像素值,R、G和B分别为IR、IG和IB的三刺激值,A1、A2、A3、B1、B2和B3为拟合系数,A′1、A′2和A′3为中间变量,α、β和γ分别为常数。根据浮点灰度值与三刺激值的关系,公式(1)中α=0.299,β=0.587,γ=0.114。将上述公式(2)、(3)和(4)代入公式(1)得到公式(5),其中,A1=α×A′1,A2=β×A′2,A3=γ×A′3。Wherein, GF is the floating-point gray value of the pixel, IR, IG and IB are the pixel values of the three channels respectively, R, G and B are the tristimulus values of IR, IG and IB respectively, A1 , A2 , A3 , B1 , B2 and B3 are fitting coefficients, A′1 , A′2 and A′3 are intermediate variables, and α, β and γ are constants. According to the relationship between the floating-point gray value and the tristimulus value, in formula (1), α = 0.299, β = 0.587, and γ = 0.114. Substituting the above formulas (2), (3) and (4) into formula (1) yields formula (5), where A1 = α × A′1 , A2 = β × A′2 , and A3 = γ × A′3 .
第一子模型中,像素值与对应的三刺激值的关系可采用以像素值IR值、IG值和IB值为底数的幂函数关系表示,在第一子模型拟合回归的过程中,并通过相机光学特性化标定实验得到样本目标图像文件中像素准确的三刺激值,将多个(至少6个)准确的三刺激值和样本目标图像文件中对应像素的像素值代入公式(2)、(3)和(4),得到拟合系数A′1、A′2、A′3、B1、B2和B3,即得到A1、A2、A3、B1、B2和B3,从而完成第一子模型的拟合回归过程。In the first sub-model, the relationship between pixel values and corresponding tristimulus values can be represented by a power function with the pixel values IR, IG, and IB as bases. During the fitting regression of the first sub-model, the accurate tristimulus values of pixels in the sample target image file are obtained through camera optical characteristic calibration experiments. Multiple (at least 6) accurate tristimulus values and the corresponding pixel values in the sample target image file are substituted into formulas (2), (3), and (4) to obtain fitting coefficients A′1 , A′2 , A′3 , B1 , B2 , and B3 , that is , A1 , A2 , A3 , B1 , B2 , and B3 are obtained, thus completing the fitting regression process of the first sub-model.
在一些实施例中,所述第二子模型可通过如下公式回归拟合得到。
In some embodiments, the second sub-model can be obtained by regression fitting using the following formula.
其中,A4和B4为拟合系数,L为像素的物方亮度值,拟合过程中L可通过亮度计测量得到,F、T和ISO均为曝光参数,分别表示光圈系数、曝光时间和感光度。log可以是以任何数为底的对数函数,例如:以自然常数e为底的对数函数ln,或以10为底的对数函数lg,不同底的对数函数最终拟合出来的A4和B4不同。通过第一子模型得到样本目标图像文件中像素的GF,将多个(至少两个)样本目标图像文件对应的曝光参数及多组样本目标图像文件中像素对应的物方亮度标准值,拟合得到拟合系数A4和B4,从而完成第二子模型的拟合回归。Where A4 and B4 are fitting coefficients, L is the object-side brightness value of the pixel, which can be measured by a luminance meter during the fitting process, and F, T, and ISO are exposure parameters, representing aperture, exposure time, and ISO, respectively. log can be a logarithmic function with any base, such as ln (based on the natural constant e) or lg (based on 10). Different bases of the logarithmic functions will result in different A4 and B4 values. The first sub-model obtains the GF of the pixels in the sample target image files. The fitting coefficients A4 and B4 are then obtained by fitting the exposure parameters corresponding to multiple ( at least two) sample target image files and the standard object-side brightness values corresponding to the pixels in multiple sets of sample target image files, thus completing the fitting regression of the second sub - model.
在一些实施例中,物方亮度回归模型通过如下公式回归拟合得到。
In some embodiments, the object-side brightness regression model is obtained by regression fitting using the following formula.
其中,IR、IG和IB分别为所述三通道的像素值,A1、A2、A3、A4、B1、B2、B3和B4为拟合系数,L为像素的物方亮度值,F、T和ISO均为曝光参数,分别表示光圈系数、曝光时间和感光度。Wherein, IR, IG, and IB are the pixel values of the three channels, A1 , A2 , A3 , A4 , B1, B2 , B3 , and B4 are fitting coefficients, L is the object-side brightness value of the pixel, and F, T, and ISO are exposure parameters, representing the aperture coefficient, exposure time, and ISO sensitivity, respectively.
本实施例中,一共八个拟合系数,至少八个不同的样本目标图像文件中像素的三通道像素值和对应的不同的曝光参数代入公式(7)即可一次性回归得到A1、A2、A3、A4、B1、B2、B3和B4。本实施例中,不需要分多步实验,不需要先做相机光学特性化标定实验,求出三刺激值和图像RGB值的关系,即不用拟合上述公式(2)、(3)和(4)中的中间变量A′1、A′2和A′3,再拟合用三刺激值计算出的浮点灰度值和物方亮度值的关系。而是直接利用多组曝光参数下的样本目标图像文件,一步回归得到A1、A2、A3、A4、B1、B2、B3和B4,回归拟合效率更高,而且不需要多次拟合,降低了拟合出现的误差,提高了最终计算得到的像素的物方亮度值的准确性和稳定性。In this embodiment, there are a total of eight fitting coefficients. The three-channel pixel values of pixels in at least eight different sample target image files and the corresponding different exposure parameters can be substituted into formula (7) to obtain A1 , A2 , A3 , A4 , B1 , B2 , B3 and B4 in one regression. In this embodiment, it is not necessary to conduct multi-step experiments, and it is not necessary to first conduct camera optical characteristic calibration experiments to find the relationship between tristimulus values and image RGB values. That is, it is not necessary to fit the intermediate variables A′1 , A′2 and A′3 in the above formulas (2), (3) and ( 4 ), and then fit the relationship between the floating-point gray value calculated by the tristimulus values and the object brightness value. Instead, it directly uses sample target image files under multiple exposure parameters to obtain A1 , A2 , A3 , A4 , B1 , B2 , B3 and B4 in one step through regression. This results in higher regression fitting efficiency, eliminates the need for multiple fittings, reduces fitting errors, and improves the accuracy and stability of the final calculated object-side brightness values of the pixels.
通常拍摄的图像都会出现渐晕效应,即图像边缘的像素变暗,这些边缘像素的rgb像素值也不准确,从而会影响像素的物方亮度值的测量。因此,在一些实施例中,在步骤S120之前,还包括:对所述目标图像文件进行渐晕效应修正,具体地,通过resize函数(例如:Python或C++的resize函数)降低目标图像文件的渐晕效应,降低目标图像文件的渐晕效应后得到的像素的物方亮度值更准确性。渐晕效应修正的最简单的方式是通过resize函数缩小目标图像文件的尺寸,降低边缘像素变暗对整个待测量环境的亮度分布图的影响。Images often exhibit vignetting, where pixels at the image edges become darker, and the RGB values of these edge pixels are inaccurate, affecting the measurement of object-side brightness. Therefore, in some embodiments, before step S120, the method further includes vignetting correction on the target image file. Specifically, this is achieved by using a `resize` function (e.g., the `resize` function in Python or C++) to reduce the vignetting effect. Reducing the vignetting effect results in more accurate object-side brightness values. The simplest way to correct vignetting is to reduce the size of the target image file using the `resize` function, thereby minimizing the impact of darkened edge pixels on the overall brightness distribution of the measured environment.
还可以通过修正拍照设备的渐晕效应系数来修正渐晕效应,减轻目标图像文件边缘像素的变暗的情况。Vignetting can also be corrected by adjusting the vignetting coefficient of the camera device, thus reducing the darkening of edge pixels in the target image file.
需要说明的是:在回归拟合物方亮度回归模型时,对样本拍摄图像文件也可以进行渐晕效应修正,使得最终得到的物方亮度回归模型输出的每个像素的物方亮度值更准确。It should be noted that when fitting the object-side brightness regression model, the vignetting effect can also be corrected for the sample image files, so that the object-side brightness value of each pixel output by the final object-side brightness regression model is more accurate.
下面对本申请提供的环境亮度空间分布测量装置进行描述,下文描述的环境亮度空间分布测量装置与上文描述的环境亮度空间分布测量方法可相互对应参照。The ambient light spatial distribution measurement device provided in this application is described below. The ambient light spatial distribution measurement device described below can be referred to in correspondence with the ambient light spatial distribution measurement method described above.
本申请实施例的环境亮度空间分布测量装置,应用于终端,如图12所示,该装置包括:测量指令接收模块1210、曝光参数确定模块1220、目标图像文件获取模块1230、亮度值计算模块1240和伪色图生成模块1250。The ambient brightness spatial distribution measurement device of this application embodiment is applied to a terminal, as shown in FIG12. The device includes: a measurement command receiving module 1210, an exposure parameter determining module 1220, a target image file acquisition module 1230, a brightness value calculation module 1240, and a pseudo color map generation module 1250.
测量指令接收模块1210被配置为接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像。The measurement command receiving module 1210 is configured to receive an ambient brightness measurement command and trigger the camera's image sensor to acquire an initial image of the environment to be measured.
曝光参数确定模块1220被配置为基于所述初始图像,确定目标曝光参数。The exposure parameter determination module 1220 is configured to determine the target exposure parameters based on the initial image.
目标图像文件获取模块1230被配置为接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件。The target image file acquisition module 1230 is configured to receive a shooting command, trigger the camera to take a picture according to the target exposure parameters, and acquire the target image file under the measured environment.
亮度值计算模块1240被配置为基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值。The brightness value calculation module 1240 is configured to calculate the object-side brightness value of each pixel in the target image file based on the target image file and the target exposure parameters.
伪色图生成模块1250被配置为基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。The pseudo-color map generation module 1250 is configured to generate and display a pseudo-color map of the luminance spatial distribution under the measured environment based on the object luminance value.
本申请实施例的环境亮度空间分布测量装置,通过对当前的待测量环境实时拍摄获取目标图像文件,结合拍摄时的曝光参数计算目标图像文件中每个像素的物方亮度值,并根据每个像素的物方亮度值生成所述待测量环境下的亮度空间分布伪色图并显示,从而实现了环境亮度的可视化显示,能够直观地为灯光设计师提供设计参考。The ambient brightness spatial distribution measurement device of this application acquires target image files by capturing the current environment to be measured in real time, calculates the object-side brightness value of each pixel in the target image file by combining the exposure parameters at the time of shooting, and generates and displays a pseudo-color map of the brightness spatial distribution under the environment to be measured based on the object-side brightness value of each pixel, thereby realizing the visualization of ambient brightness and providing intuitive design reference for lighting designers.
可选地,环境亮度空间分布测量装置还包括:亮度分布文件生成模块,被配置为在基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值之后,基于所述物方亮度值,生成亮度分布文件,所述亮度分布文件被配置为以表格的形式存储所述目标图像文件中每个像素的物方亮度值;其中,每个像素的物方亮度值所在表格的行列位置与对应像素在目标图像文件中的行列坐标一一对应。Optionally, the ambient brightness spatial distribution measurement device further includes: a brightness distribution file generation module, configured to, after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters, generate a brightness distribution file based on the object-space brightness value, wherein the brightness distribution file is configured to store the object-space brightness value of each pixel in the target image file in the form of a table; wherein the row and column positions of the table containing the object-space brightness value of each pixel correspond one-to-one with the row and column coordinates of the corresponding pixel in the target image file.
可选地,环境亮度空间分布测量装置还包括:第一行列坐标获取模块,被配置为在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,获取亮度空间分布伪色图上用户指定的目标像素点的行列坐标。Optionally, the ambient brightness spatial distribution measurement device further includes: a first row and column coordinate acquisition module, configured to acquire the row and column coordinates of a target pixel point specified by the user on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
第一亮度值查询模块,被配置为基于所述目标像素点的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值。The first brightness value query module is configured to query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file based on the row and column coordinates of the target pixel.
像素亮度值显示模块,被配置为显示所述目标物方亮度值。The pixel brightness value display module is configured to display the brightness value of the target object.
可选地,环境亮度空间分布测量装置还包括:目标区域获取模块,被配置为在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,获取亮度空间分布伪色图上用户指定的目标区域。Optionally, the ambient brightness spatial distribution measurement device further includes a target area acquisition module, configured to acquire a user-specified target area on the brightness spatial distribution pseudo-color map after generating and displaying the brightness spatial distribution pseudo-color map of the environment to be measured based on the object brightness value.
第二行列坐标获取模块,被配置为以所述目标区域中所有像素为目标像素点,获取所述目标像素点的行列坐标。The second row and column coordinate acquisition module is configured to acquire the row and column coordinates of the target pixels, taking all pixels in the target region as target pixels.
第二亮度值查询模块,被配置为基于所述目标像素的行列坐标,查询所述亮度分布文件中相应行列位置记录的目标物方亮度值。The second brightness value query module is configured to query the target object brightness value recorded at the corresponding row and column position in the brightness distribution file based on the row and column coordinates of the target pixel.
区域亮度值显示模块,被配置为显示所述目标物方亮度值的统计值。The area brightness value display module is configured to display statistical values of the brightness value of the target object.
可选地,环境亮度空间分布测量装置还包括:亮度统计值显示模块,被配置为在基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值之后,计算所述目标图像文件中所有像素的物方亮度值的统计值并显示。Optionally, the ambient brightness spatial distribution measurement device further includes: a brightness statistics display module, configured to calculate and display statistical values of the object-space brightness values of all pixels in the target image file after calculating the object-space brightness value of each pixel in the target image file based on the target image file and the target exposure parameters.
可选地,环境亮度空间分布测量装置还包括:场景类别接收模块,被配置为在基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示之后,接收用户输入的待测量环境所属的场景类别。Optionally, the ambient brightness spatial distribution measurement device further includes: a scene category receiving module, configured to receive the scene category of the environment to be measured, input by the user, after generating and displaying a pseudo-color map of the brightness spatial distribution of the environment to be measured based on the object brightness value.
推荐统计值确定模块,被配置为基于所述场景类别,确定所述待测量环境对应的亮度的推荐统计值。The recommended statistical value determination module is configured to determine the recommended statistical value of the brightness corresponding to the environment to be measured based on the scene category.
可选地,目标图像文件获取模块1230具体包括:raw格式文件获取模块,被配置为获取相机拍摄的raw格式文件。Optionally, the target image file acquisition module 1230 specifically includes a raw format file acquisition module, configured to acquire raw format files captured by the camera.
文件格式转换模块,被配置为将所述raw格式文件按预设转换方式转换为rgb三通道格式文件,确定所述rgb三通道格式文件为所述目标图像文件。The file format conversion module is configured to convert the raw format file into an RGB three-channel format file according to a preset conversion method, and determine the RGB three-channel format file as the target image file.
可选地,伪色图生成模块1250具体包括:灰度图生成模块,被配置为将每个像素的物方亮度值进行0~2n-1的归一化处理,以生成n位存储位的表示亮度分布灰度图,n为8的倍数。Optionally, the pseudo-color image generation module 1250 specifically includes: a grayscale image generation module, configured to normalize the object-side brightness value of each pixel from 0 to 2n -1 to generate an n-bit storage grayscale image representing the brightness distribution, where n is a multiple of 8.
伪色图转换模块,被配置为将所述灰度图转换成亮度分布伪色图。The pseudo-color map conversion module is configured to convert the grayscale image into a brightness distribution pseudo-color map.
可选地,亮度值计算模块1240具体包括:像素值提取模块,被配置为提取所述目标图像文件中每个像素分别在r、g和b三通道的像素值。Optionally, the brightness value calculation module 1240 specifically includes a pixel value extraction module, configured to extract the pixel values of each pixel in the target image file in the r, g and b channels respectively.
回归模型执行模块,被配置为将所述像素值和所述目标曝光参数输入物方亮度回归模型,得到所述物方亮度回归模型输出的每个像素的物方亮度值。The regression model execution module is configured to input the pixel value and the target exposure parameter into the object-space luminance regression model to obtain the object-space luminance value of each pixel output by the object-space luminance regression model.
其中,所述物方亮度回归模型是基于样本目标图像文件的曝光参数、所述样本目标图像文件中像素的像素值以及所述样本目标图像文件中像素对应的物方亮度标准值拟合回归得到的。The object-side brightness regression model is obtained by fitting and regressing the exposure parameters of the sample target image file, the pixel values of the pixels in the sample target image file, and the standard object-side brightness values corresponding to the pixels in the sample target image file.
图13示例了一种电子设备的实体结构示意图,如图13所示,该电子设备可以包括:处理器(processor)1310、通信接口(Communications Interface)1320、存储器(memory)1330和通信总线1340,其中,处理器1310,通信接口1320,存储器1330通过通信总线1340完成相互间的通信。处理器1310可以调用存储器1330中的逻辑指令,以执行环境亮度空间分布测量方法,该方法包括以下步骤。Figure 13 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 13, the electronic device may include: a processor 1310, a communication interface 1320, a memory 1330, and a communication bus 1340. The processor 1310, communication interface 1320, and memory 1330 communicate with each other via the communication bus 1340. The processor 1310 can call logical instructions in the memory 1330 to execute an ambient brightness spatial distribution measurement method, which includes the following steps.
接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像。Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
基于所述初始图像,确定目标曝光参数。Based on the initial image, the target exposure parameters are determined.
接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件。Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值。Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file.
基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。Based on the object luminance value, a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
此外,上述的存储器1330中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对传统技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Furthermore, the logical instructions in the aforementioned memory 1330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to conventional technology, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
另一方面,本申请还提供一种计算机程序产品,该计算机程序产品可以是在非暂态计算机可读介质上的,也可以是网上下载的app等。所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的环境亮度空间分布测量方法,该方法包括以下步骤。On the other hand, this application also provides a computer program product, which may be on a non-transitory computer-readable medium or a downloaded app, etc. The computer program product includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the ambient brightness spatial distribution measurement method provided by the above methods, which includes the following steps.
接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像。Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
基于所述初始图像,确定目标曝光参数。Based on the initial image, the target exposure parameters are determined.
接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件。Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值。Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file.
基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。Based on the object luminance value, a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
又一方面,本申请还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的环境亮度空间分布测量方法,该方法包括以下步骤。In another aspect, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the ambient brightness spatial distribution measurement method provided by the above methods, the method comprising the following steps.
接收环境亮度测量指令,触发相机的图像传感器采集待测量环境的初始图像。Upon receiving an ambient brightness measurement command, the camera's image sensor is triggered to acquire an initial image of the environment to be measured.
基于所述初始图像,确定目标曝光参数。Based on the initial image, the target exposure parameters are determined.
接收拍摄指令,按所述目标曝光参数触发相机拍照,获取拍摄的待测量环境下的目标图像文件。Upon receiving the shooting instruction, the camera is triggered to take a picture according to the target exposure parameters, and the captured target image file under the measured environment is obtained.
基于所述目标图像文件和所述目标曝光参数,计算所述目标图像文件中每个像素的物方亮度值。Based on the target image file and the target exposure parameters, calculate the object-side brightness value of each pixel in the target image file.
基于所述物方亮度值,生成所述待测量环境下的亮度空间分布伪色图并显示。Based on the object luminance value, a pseudo-color map of the luminance spatial distribution under the measured environment is generated and displayed.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对传统技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to conventional technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims (12)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410678417.7 | 2024-05-28 | ||
| CN202410678417.7A CN121048742A (en) | 2024-05-28 | 2024-05-28 | Method and device for measuring spatial distribution of ambient brightness |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025247111A1 true WO2025247111A1 (en) | 2025-12-04 |
Family
ID=97815292
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/096910 Pending WO2025247111A1 (en) | 2024-05-28 | 2025-05-23 | Method and device for measuring spatial distribution of ambient luminance |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN121048742A (en) |
| WO (1) | WO2025247111A1 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103017897A (en) * | 2012-08-20 | 2013-04-03 | 中航华东光电有限公司 | Luminosity information measurement device and method |
| KR20150002990A (en) * | 2013-06-28 | 2015-01-08 | 한경대학교 산학협력단 | Portable luminance meter |
| CN109660781A (en) * | 2018-12-12 | 2019-04-19 | 北京时代奥视科技有限公司 | Visual aids exposure processing method, device and electronic equipment |
| CN113556477A (en) * | 2021-09-23 | 2021-10-26 | 南昌龙旗信息技术有限公司 | Environment brightness determination method, device, medium, product and camera |
-
2024
- 2024-05-28 CN CN202410678417.7A patent/CN121048742A/en active Pending
-
2025
- 2025-05-23 WO PCT/CN2025/096910 patent/WO2025247111A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103017897A (en) * | 2012-08-20 | 2013-04-03 | 中航华东光电有限公司 | Luminosity information measurement device and method |
| KR20150002990A (en) * | 2013-06-28 | 2015-01-08 | 한경대학교 산학협력단 | Portable luminance meter |
| CN109660781A (en) * | 2018-12-12 | 2019-04-19 | 北京时代奥视科技有限公司 | Visual aids exposure processing method, device and electronic equipment |
| CN113556477A (en) * | 2021-09-23 | 2021-10-26 | 南昌龙旗信息技术有限公司 | Environment brightness determination method, device, medium, product and camera |
Also Published As
| Publication number | Publication date |
|---|---|
| CN121048742A (en) | 2025-12-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108668093B (en) | HDR image generation method and device | |
| CN108419028B (en) | Image processing method, image processing device, computer-readable storage medium and electronic equipment | |
| CN110033418B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
| KR102369148B1 (en) | Image capture method and system | |
| CN111182217B (en) | Image white balance processing method and device | |
| JP5457652B2 (en) | Image processing apparatus and method | |
| WO2019105305A1 (en) | Image brightness processing method, computer readable storage medium and electronic device | |
| JP2016528772A (en) | Image processing method, image processing apparatus, and terminal | |
| CN105635593A (en) | Multiple exposure imaging system and white balance method thereof | |
| WO2020093653A1 (en) | Color adjustment method, color adjustment device, electronic device and computer-readable storage medium | |
| CN107465903A (en) | Image white balance method, device and computer-readable storage medium | |
| CN110808002A (en) | Screen display compensation method and device and electronic equipment | |
| US10269113B2 (en) | Method of analyzing facial images for detecting a flush effect | |
| CN110677557B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
| US8164650B2 (en) | Image processing apparatus and method thereof | |
| CN114125302A (en) | Image adjusting method and device | |
| CN118280238B (en) | A method, device and storage medium for gamma detection in display screen Demura process | |
| WO2025247111A1 (en) | Method and device for measuring spatial distribution of ambient luminance | |
| JP6210772B2 (en) | Information processing apparatus, imaging apparatus, control method, and program | |
| CN114894304B (en) | Ambient illumination measurement method, device, electronic device and readable storage medium | |
| CN114071099B (en) | Smear measurement method and device, electronic equipment and readable storage medium | |
| CN114339028A (en) | Photographing method, electronic device and computer-readable storage medium | |
| CN114697483A (en) | Device and method for shooting under screen based on compressed sensing white balance algorithm | |
| CN114697629B (en) | White balance processing method and device, storage medium and terminal equipment | |
| CN121026320A (en) | Ambient brightness measurement method and device |