Image processing method, chip, terminal and computer readable storage medium

In the image processing method, the local pixel grid is used to perform local statistics on the target object according to the proportion of the identification area, and the global grid is used to perform global statistics on areas other than the identification area, which solves the problem of interest area statistics in the existing technology. It solves the problem of low accuracy and achieves high-precision statistics on small face scenes.

CN118537415APending Publication Date: 2024-08-23伟光有限公司(CN)
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310146723.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When the existing technology extracts statistical local areas from the global image, the statistical accuracy of the area of ​​interest is low, especially the statistical accuracy of areas of different sizes is different, which cannot meet the high demand of small face scenes.

Method used

In the image processing method, when the proportion of the recognition area in the preview image is less than or equal to the threshold, the local pixel grid is used to perform local statistics of the target object to improve the statistical accuracy, and the global grid is combined with the area other than the recognition area. Perform global statistics and adjust pixel density to reduce statistical errors.

Benefits of technology

It improves the statistical accuracy of the target object in the area of ​​interest, ensures the accuracy and consistency of the statistical results no matter how the ROI size changes, and improves the effect of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537415A
    Figure CN118537415A
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, a chip, a terminal and a computer readable storage medium, and the method comprises the steps: collecting a preview image, and determining a recognition region of a target object in the preview image; if the ratio of the recognition area to the area where the preview image is located is smaller than or equal to a ratio threshold value, performing local statistics on the target object based on the first grid and the recognition area, and determining a first statistical result of the target object; the first grid is a pixel grid used for carrying out local statistics on an identification area where the target object is located; and determining image parameters of the target object based on the first statistical result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision, and in particular to an image processing method, chip, terminal and computer-readable storage medium. Background Art

[0002] Currently, the statistical local area is extracted from the global image mainly by statistically processing the local image in the global image with different grid sizes. However, an image has only one grid window, and the region of interest (ROI) can only be cut out from the global grid, resulting in low statistical accuracy. Summary of the invention

[0003] The embodiments of the present application are intended to provide an image processing method, a chip, a terminal, and a computer-readable storage medium, which can improve statistical accuracy by measuring images of a region of interest.

[0004] The technical solution of the present invention is achieved in this way:

[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising: acquiring a preview image, and determining a recognition area of ​​a target object in the preview image; if a proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold, then based on a first grid and the recognition area, performing local statistics on the target object to determine a first statistical result of the target object; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; based on the first statistical result, determining the image parameters of the target object.

[0006] In a second aspect, an embodiment of the present application provides an image processing chip, the image processing chip comprising: the acquisition unit, used to capture a preview image, and determine an identification area of ​​a target object in the preview image;

[0007] The determination unit is used to perform local statistics on the target object based on the first grid and the recognition area to determine a first statistical result of the target object if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; and determine the image parameters of the target object based on the first statistical result.

[0008] In a third aspect, an embodiment of the present application provides an image processing chip, including: a processor and a memory, wherein:

[0009] The memory is used to store computer programs;

[0010] The processor is used to call and run the computer program from the memory to implement the above-mentioned image processing method.

[0011] In a fourth aspect, an embodiment of the present application provides a terminal, comprising a housing and an image processing chip disposed inside the housing; wherein the image processing chip is such as the image processing chip of the third aspect.

[0012] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for implementing the above-mentioned image processing method when executed by a processor.

[0013] The embodiment of the present application provides an image processing method, chip, terminal and computer-readable storage medium, the method comprising: collecting a preview image, and determining a recognition area of ​​a target object in the preview image; if the proportion of the recognition area in the area where the preview image is located is less than or equal to a proportion threshold, then based on a first grid and the recognition area, local statistics are performed on the target object to determine a first statistical result of the target object; the first grid is a pixel grid used for local statistics of the recognition area where the target object is located; based on the first statistical result, the image parameters of the target object are determined. Using the above scheme, when the proportion of the recognition area in the area where the preview image is located is less than or equal to the proportion threshold, the first grid can be used to perform local statistics on the target object in the preview image. The current solution uses a global grid (i.e., the second grid) to perform local statistics on the target object, and uses the global grid to perform global statistics on the area of ​​the preview image other than the recognition area. The pixel density is the number of pixels owned or contained in a unit area. When the sizes of the first grid and the global grid are similar, since the recognition area of ​​the first grid is the local area of ​​the preview image, and the recognition area of ​​the global grid is the global area of ​​the preview image, the pixel density of the global grid is greater than the pixel density of the first grid. When the first grid is used to perform statistics on the local area, the number of pixels contained in the grid blocks in the first grid is less than the number of pixels contained in the grid blocks in the global grid. Since the more pixels contained in the grid blocks, the less clear the boundaries of the pixels, when counting the number of grids where the pixels are located, it is easy to have more blank areas in the grids where the pixels are located, resulting in larger errors in the statistical results. The number of pixel points in the grid block in the first grid is smaller than the number of pixel points included in the grid block in the global grid. Since the number of pixel points included in the grid block is smaller and the boundaries of the pixel points are clear, when counting the number of grids where the pixel points are located, the blank areas of the grids where the pixel points are located are smaller, and the statistical results are more accurate, which can improve the statistical accuracy of the first statistical results. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1An optional grid diagram of an image processing method provided in an embodiment of the present application Figure 1 ;

[0015] Figure 2 An optional process diagram of an image processing method is provided for an embodiment of the present application Figure 1 ;

[0016] Figure 3 An optional process diagram of an image processing method is provided for an embodiment of the present application Figure 2 ;

[0017] Figure 4 An optional grid diagram of an image processing method provided in an embodiment of the present application Figure 2 ;

[0018] Figure 5 An optional process diagram of an image processing method is provided for an embodiment of the present application Figure 3 ;

[0019] Figure 6 An optional target recognition area of ​​an image processing method is provided for an embodiment of the present application Figure 1 ;

[0020] Figure 7 An optional target recognition area of ​​an image processing method is provided for an embodiment of the present application Figure 2 ;

[0021] Figure 8a An optional statistical effect of an image processing method is provided for the embodiment of the present application Figure 1 ;

[0022] Figure 8b An optional statistical effect of an image processing method is provided for the embodiment of the present application Figure 2 ;

[0023] Fig. 9 An optional preview image schematic diagram of an image processing method is provided for an embodiment of the present application;

[0024] Fig.10a An optional statistical effect of an image processing method is provided for the embodiment of the present application Figure 3 ;

[0025] Fig.10b An optional statistical effect of an image processing method is provided for the embodiment of the present application Figure 4 ;

[0026] Fig.10c An optional statistical effect of an image processing method is provided for the embodiment of the present application Figure 5 ;

[0027] Fig.11 The present application embodiment provides an optional process diagram of an image processing method. Figure 4 ;

[0028] Fig.12 The present application embodiment provides an optional process diagram of an image processing method. Figure 5 ;

[0029] Fig.13 The present application embodiment provides an optional process diagram of an image processing method. Figure 6 ;

[0030] Fig.14 The present application embodiment provides a structural schematic diagram of an image processing chip;

[0031] Fig.15 The present application embodiment provides a structural schematic diagram of another image processing chip;

[0032] Fig.16 An embodiment of the present application provides a schematic diagram of the structure of a terminal. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0035] During the preview process, image signal processing (ISP) is performed. The main purpose is to provide an m*n grid window with a statistical algorithm to perform global statistics on the preview image (i.e., Raw image), and then count the pixels falling in each grid block and output the corresponding results. According to the two-dimensional spatial relationship between the region of interest (ROI) of the face and the global grid, the grid block where the face is located is found, and the statistical results reflected by these grid blocks are used to enable the automatic exposure (AE) and automatic white balance (AWB) to complete the brightness and color measurement of the face area.

[0036] For example, Figure 1As shown, the preview image (ie, the Raw image) is globally counted using an m*n grid window, and the pixels falling in each grid block are counted and the corresponding results are output. Figure 1 The horizontal direction represents the width of the preview image (i.e., image_width), and the vertical direction represents the height of the preview image (i.e., image_width); the number of horizontal grids is m (i.e., hor_block_count: m), and the number of vertical grids is n (i.e., ver_block_count: n). Each grid contains a number of pixels (i.e., Each block has: r_sum, gr_sum, gb_sum, b_sum, r_cnt, gr_cnt, gb_cnt, b_cnt).

[0037] In addition, there is only one grid window for an image, and the ROI can only be cut out from the global grid, which has the following two shortcomings in statistical accuracy. The statistical accuracy of ROIs of different sizes is different and it cannot meet the high requirements of ROI statistical accuracy in small face scenes. The statistical accuracy can be expressed by the inverse of the grid size. Taking the global 64x48 statistical grid as an example, the corresponding horizontal and vertical statistical accuracy are 1 / 64 and 1 / 48 respectively.

[0038] The present application provides an image processing method. Figure 2 This is an optional flow diagram of an image processing method provided in an embodiment of the present application. Figure 1 , will combine Figure 2 The steps shown are explained.

[0039] S101: Capture a preview image, and determine a recognition area of ​​a target object in the preview image.

[0040] In the embodiment of the present application, the preview image can be collected by a device with a camera function, such as a camera of a mobile phone, a still camera, etc., and the embodiment of the present application does not limit this. During the collection process of the preview image, more than 30 frames can be collected in one minute, and any frame is a preview image.

[0041] In some embodiments of the present application, the target object in the preview image is a customized object of interest, which may be a person, an animal, or a plant, and the embodiments of the present application are not limited to this.

[0042] In some embodiments of the present application, the terminal can capture a preview image by zooming, automatically focus the preview image, and determine the identification area of ​​the target object in the preview image. Specifically, the terminal can zoom the acquisition device, select a focal length with suitable clarity and image acquisition range to shoot, capture the preview image, and automatically focus on the target object in the preview image to obtain the identification area of ​​the target object in the preview image.

[0043] For example, in the embodiment of the present application, a mobile phone is used as an example of a device with a camera function, and the object of interest is customized in advance as a face; specifically, the object of interest is set as a face in the camera unit of the mobile phone. During the shooting process of the mobile phone, the zoom is continuously performed until the selected focal length can capture the preset image range, and the image meets the preset clarity. After the focal length is determined, the face in the preview image is automatically focused and captured, and the recognition frame of the face in the preview image is obtained. The area where the recognition frame of the face is located is the recognition area.

[0044] S102. If the proportion of the recognition area to the area where the preview image is located is less than or equal to the proportion threshold, local statistics are performed on the target object based on the first grid and the recognition area to determine a first statistical result of the target object; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located.

[0045] In the embodiment of the present application, the percentage threshold is set empirically based on the area ratio of the recognition area to the preview image in multiple historical preview images.

[0046] In some embodiments of the present application, the first grid is mainly a grid of the identification area where the target object is located, and the size of the first grid is related to the size of the area where the target object is located. The larger the size of the area where the target object is located, the larger the size of the first grid is.

[0047] In some embodiments of the present application, the ratio of the recognition area to the area where the preview image is located refers to the ratio of the area of ​​the recognition area to the area of ​​the preview image. The terminal can calculate the area of ​​the recognition area and the area of ​​the preview image respectively, and then perform a quotient operation to obtain the ratio of the recognition area to the area where the preview image is located.

[0048] In some embodiments of the present application, the terminal can determine a target recognition area containing the target object based on the recognition area, and the target recognition area is larger than the recognition area. In the target recognition area, the terminal can use the first grid to perform local statistics on the target object and determine a first statistical result of the grid blocks occupied by the target object in the first grid.

[0049] In some embodiments of the present application, the terminal may expand the boundary of the recognition area until all information of the target object is included to obtain the target recognition area. In the target recognition area, the target recognition area is divided by the first grid to obtain a plurality of grid blocks; the location of the target object is obtained by identifying the target recognition area, the grid blocks occupied by the target object are determined, and the grid blocks occupied by the target object are counted to determine the first statistical result of the grid blocks occupied by the target object in the first grid.

[0050] S103: Determine image parameters of the target object based on the first statistical result.

[0051] In the embodiment of the present application, the image parameters include image brightness parameters and image chromaticity parameters.

[0052] In some embodiments of the present application, the terminal may adjust the brightness and chromaticity of the target object according to the first statistical result, based on the image brightness parameter of the target object and the image chromaticity parameter of the target object.

[0053] In some embodiments of the present application, automatic exposure (AE) is mainly used to adjust the brightness of the target object and the area in the preview image except the identification area; automatic white balance (AWB) is mainly used to adjust the chromaticity of the target object and the area in the preview image except the identification area.

[0054] It is understandable that the terminal can use the first grid to perform local statistics on the target object in the preview image when the proportion of the recognition area to the area where the preview image is located is less than or equal to the proportion threshold. The current solution is to use the global grid to perform local statistics on the target object, and at the same time use the global grid to perform global statistics on the area of ​​the preview image other than the recognition area. The pixel density is the number of pixels owned or contained in a unit area. When the size of the first grid and the global grid are similar, since the recognized area of ​​the first grid is the local area of ​​the preview image, and the recognized area of ​​the global grid is the global area of ​​the preview image, the pixel density of the global grid is greater than the pixel density of the first grid. When the first grid is used to perform statistics on the local area, the number of pixels contained in the grid block in the first grid is compared with the number of pixels contained in the grid block in the global grid. The number of pixels contained in the grid block in the first grid is less than the number of pixels contained in the grid block in the global grid. Since the more pixels contained in the grid block, the less clear the boundary of the pixel point, when the number of grid points where the pixel points are located is counted, it is easy to have more blank areas in the grid where the pixel points are located, resulting in a large error in the statistical result. The number of pixel points in the grid block in the first grid is smaller than the number of pixel points included in the grid block in the global grid. Since the number of pixel points included in the grid block is smaller and the boundaries of the pixel points are clear, when counting the number of grids where the pixel points are located, the blank areas of the grids where the pixel points are located are smaller, and the statistical results are more accurate, which can improve the statistical accuracy of the first statistical results.

[0055] In the embodiments of the present application, Figure 3 This is an optional flow diagram of an image processing method provided in an embodiment of the present application. Figure 2 , after S102, S104 and S105 are also executed as follows:

[0056] S104, using the second grid to perform global statistics on the preview image and determine a second statistical result; the second grid is used as a grid for previewing the image; the second grid is used as a grid for previewing the image; the pixel density of the second grid is greater than the pixel density of the first grid; the pixel density represents the number of pixels contained in a unit area.

[0057] In an embodiment of the present application, pixel density represents the number of pixels contained or possessed within a unit area, that is, the pixel density can be obtained by dividing the total number of pixels by the total area. Exemplarily, the unit area can be any one of the grids in the first grid, or any one of the grids in the second grid. The size of the grids in the first grid is the same, and the size of the grids in the second grid is also the same. The pixel density of the first grid can be obtained by dividing the number of all pixels in the first grid identification area by the number of grids in the first grid, that is, the pixel density of the first grid is the number of pixels contained in the grid.

[0058] In an embodiment of the present application, the second grid is a pixel grid for global statistics of the preview image except the recognition area where the target object is located. The second grid exists in the preset grid library, and the pixel density of the second grid is greater than the pixel density of the first grid. The sizes of the second grid and the first grid are both 64x48 global grids, 144*108 global grids, 96*72 global grids, and 32*24 global grids. The sizes of the second grid and the first grid may be the same or different. The first grid is for the target recognition area containing the target object, and the second grid is for the entire area of ​​the preview image. Since the entire area of ​​the preview image is much larger than the target recognition area, the first grid and the second grid use the same size grid to divide the preview image and the target recognition area. The pixels contained in the grid block of the second grid are greater than the pixels contained in the grid block of the first grid, that is, the pixel density of the second grid is greater than the pixel density of the first grid. If the first grid and the second grid do not use the same size grid, since the target recognition area is small, in order to statistically determine the accuracy of the recognition result, a larger size grid is generally used. The size of the preview image is generally large, and a larger size grid is also used. Although the grid sizes used by the two are different, since the entire area of ​​the preview image is much larger than the target recognition area, the pixel density of the second grid is greater than that of the first grid.

[0059] In some embodiments of the present application, the second statistical result is mainly obtained by performing statistics on the area other than the identification area in the preview image. In this case, the second statistical result is mainly used to determine the image chromaticity parameter and the image brightness parameter. In addition, the second statistical result can also be obtained by performing statistics on the entire area of ​​the preview image. In this case, the second statistical result is mainly used to determine other image-related parameters other than the image chromaticity parameter and the image brightness parameter.

[0060] In some embodiments of the present application, the terminal selects a second grid corresponding to the size of the preview image from a preset grid library according to the size of the preview image and the second preset grid correspondence; performs global statistics on the preview image through the second grid to determine a second statistical result.

[0061] For example, the preset grid library contains grids of multiple sizes, such as Figure 4 As shown, it includes a 64x48 global grid, a 144*108 global grid, a 96*72 global grid, and a 32*24 global grid.

[0062] S105: Determine image parameters of an area other than the recognition area in the preview image based on the second statistical result.

[0063] In the embodiment of the present application, the image parameters include image brightness parameters and image chromaticity parameters.

[0064] In some embodiments of the present application, the terminal may adjust the brightness and chromaticity of the area in the preview image excluding the identification area based on the second statistical result, and determine the image brightness parameters of the area in the preview image excluding the identification area and the image chromaticity parameters of the area in the preview image excluding the identification area.

[0065] In some embodiments of the present application, automatic exposure (AE) is mainly used to adjust the brightness of the target object and the area in the preview image except the identification area; automatic white balance (AWB) is mainly used to adjust the chromaticity of the target object and the area in the preview image except the identification area.

[0066] It is understandable that the terminal can use a second grid to perform global statistics on the preview image, determine a second statistical result, and based on the second statistical result, determine the image parameters of the area in the preview image excluding the identification area, so as to facilitate the subsequent use of the image parameters of the area in the preview image excluding the identification area to adjust the next frame of the preview image.

[0067] In an embodiment of the present application, if the proportion of the recognition area to the area where the preview image is located is less than or equal to the proportion threshold, then based on the first grid and the recognition area, local statistics are performed on the target object to determine the first statistical result of the target object. The terminal can also use the first grid to perform global statistics on the preview image to determine the second statistical result. The image parameters of the target object are determined using the first statistical result; based on the second statistical result, the image parameters of the area in the preview image other than the recognition area are determined. Finally, when capturing the next frame of the preview image, the chromaticity and brightness of the next frame of the preview image are determined based on the image parameters of the target object and the image parameters of the area in the preview image other than the recognition area, and the next frame of the preview image is displayed.

[0068] It can be understood that the terminal uses the first grid to perform local statistics on the target object to determine the first statistical result of the target object, and uses the first grid to perform global statistics on the preview image to determine the second statistical result. The image parameters of the target object are determined using the first statistical result; based on the second statistical result, the image parameters of the area in the preview image other than the identification area are determined. When the next frame of preview image is captured, the chromaticity and brightness of the next frame of preview image are determined based on the image parameters of the target object and the image parameters of the area in the preview image other than the identification area, and the next frame of preview image is displayed, which can improve the image quality of the next frame of preview image.

[0069] In some embodiments of the present application, Figure 5 This is an optional flow diagram of an image processing method provided in an embodiment of the present application. Figure 3 In S102, local statistics are performed on the target object based on the first grid and the identification area to determine the first statistical result of the target object, which can be achieved by S1021 and S1022 as follows:

[0070] S1021. Determine a target recognition area including a target object according to the recognition area.

[0071] In some embodiments of the present application, the target recognition area is larger than the recognition area.

[0072] In some embodiments of the present application, the identification area includes the target object, but only includes partial information of the target object. Therefore, in order to perform better statistics on the target object later, it is necessary to determine an area that includes all the information of the target object, namely, the target identification area.

[0073] In some embodiments of the present application, the terminal expands the boundary area of ​​the recognition area with the center of the recognition area as the origin until all information of the target object is included, thereby determining a target recognition area including the target object.

[0074] For example, Figure 6The recognition area (i.e., Face rectange) shown in FIG. 1 is enlarged by expanding the boundary area of ​​the recognition area until the entire face is included, and the following is obtained: Figure 6 The target identification region (i.e., Re ctangle for gridwindow of particular ROI) is shown.

[0075] S1022: In the target recognition area, using the first grid, perform local statistics on the target object to determine a first statistical result of the grid blocks occupied by the target object in the first grid.

[0076] In some embodiments of the present application, the terminal can select a first grid corresponding to the size of the target recognition area from a preset grid library according to a first preset grid correspondence relationship. Through the first grid, a local statistics of the target object is performed in the target recognition area to determine a first statistical result of the grid block occupied by the target object in the first grid.

[0077] In some embodiments of the present application, the terminal may divide the target identification area into multiple grids through a first grid, obtain the grid where the target object is located by identifying the target identification area, and thereby determine a first statistical result of the target object occupying a grid block in the first grid.

[0078] It is understandable that the terminal determines the target recognition area containing the target object based on the recognition area, so that the target object can be completely located in the target recognition area, so that in the target recognition area, the first grid is used to perform local statistics on the target object to determine the first statistical result of the target object occupying the grid block in the first grid. Performing local statistics on the target object in the target recognition area is compared with performing local statistics on the target object in the recognition area, because the target object is completely located in the target recognition area, the target object is not completely located in the recognition area. Therefore, performing local statistics on the target object in the target recognition area can improve the statistical accuracy.

[0079] In some embodiments of the present application, S1022 may be implemented by S10221 and S10222 as follows:

[0080] S10221. Selecting a first grid corresponding to the size of the target recognition area from a preset grid library according to a first preset grid correspondence relationship.

[0081] In some embodiments of the present application, the first preset grid correspondence relationship represents the correspondence between the size of the target recognition area and the size of the first grid.

[0082] In some embodiments of the present application, the terminal may select a first grid corresponding to the size of the target recognition area from a preset grid library according to the first preset grid correspondence relationship.

[0083] In some embodiments of the present application, the first preset grid correspondence relationship is that the larger the size of the target recognition area, the larger the corresponding optimal grid size.

[0084] S10222. In the target recognition area, local statistics are performed on the target object through the first grid to determine a first statistical result of the grid blocks occupied by the target object in the first grid.

[0085] In some embodiments of the present application, the terminal may divide the target identification area into multiple grids through a first grid, obtain the grid where the target object is located by identifying the target identification area, and thereby determine a first statistical result of the target object occupying a grid block in the first grid.

[0086] For example, Figure 7 As shown in FIG. 1 , the left side shows the effect measured from the second grid (i.e., Grid window 1), and the right side shows the effect measured from the first grid (i.e., the first grid Grid window 2). Figure 8a It can be seen that the equivalent grid of the second grid is 12x16 (i.e., Equivalent Grid: 12×16), and the statistical accuracy of the second grid 64x48 (i.e., Global Grid: 64×48) is 8.33%*6.25% (i.e., Precision: 8.33%×6.25%); Figure 8b It can be seen that the equivalent grid of the first grid is 64x48 (i.e., Equivalent Grid: 64×48), and the statistical accuracy of the first grid 64x48 (i.e., Global Grid: 64×48) is 1.56%x2.08% (i.e., Precision: 1.56%x2.08%), and the statistical accuracy is greatly improved. No matter how the ROI size changes, the same statistical accuracy as the global grid "1.56%x2.08%" is maintained. Therefore, no matter how the size of the face changes, the facial information measured in this way will be equally accurate.

[0087] It can be understood that the terminal selects the first grid corresponding to the size of the target identification area from the preset grid library according to the first preset grid correspondence relationship. A suitable grid can be selected to facilitate subsequent local statistics of the target object in the target identification area through the first grid, determine the first statistical result of the target object occupying the grid block in the first grid, and improve the statistical accuracy.

[0088] In some embodiments of the present application, after S101, S106 is further executed as follows:

[0089] S106. If the proportion of the identified area to the area where the preview image is located is greater than the proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine a first statistical result of the grid blocks occupied by the target object in the second grid and a second statistical result of the preview image.

[0090] In some embodiments of the present application, the terminal may compare the proportion of the identified area in the area where the preview image is located with a proportion threshold. If the proportion of the identified area in the area where the preview image is located is greater than the proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine a first statistical result of the target object occupying a grid block in the second grid and a second statistical result of the preview image.

[0091] In some embodiments of the present application, the terminal may select a second grid corresponding to the size of the preview image from a preset grid library according to the size of the preview image and the second preset grid correspondence; perform global statistics on the preview image through the second target grid to determine a second statistical result.

[0092] For example, Figure 4 As shown in the figure, the size of the preview image is 4096x2304, and the size of the second grid is 64x48. In addition to the 64x48 global grid, the 144x108 global grid, the 96x72 global grid, and the 32x24 global grid can also be used. As the ROI becomes smaller, the equivalent grid size on the global grid also becomes smaller, and the statistical accuracy of the corresponding ROI also becomes worse, as shown in Table 1. As a result, the accuracy of measuring brightness and color is also different.

[0093] Table 1

[0094]

[0095] As shown in Table 1, the global 4096*2304 image is divided into 64*48 grids. From the global 4096*2304 image, the image is cut out through the 1440*1080 size area. The grid divided by the image obtained by 1440*1080 is equivalent to the 64*48 grids of the global 4096*2304 image, which is 22.5*22.5 grids. The accuracy of the global 4096*2304 image is 1.56%*2.08%, and the accuracy of the image obtained by 1440*1080 is 4.44%*4.44%. From the global 4096*2304 image, the image is cut out through the 960*720 size area. The grids of the image obtained by 960*720 are equivalent to the 64*48 grids of the global 4096*2304 image, which is 15*15 grids. The accuracy of the image obtained by 960*720 is 6.67%*6.67%. From the global 4096*2304 image, the image is cut out through the 640*480 size area. The grids of the image obtained by 640*480 are equivalent to the 64*48 grids of the global 4096*2304 image, which is 10*10 grids. The accuracy of the image obtained by 640*480 is 10.00%*10.00%. From the global 4096*2304 image, the image is cut out through the 320*240 size area. The grid of the image obtained by 320*240 is equivalent to the 64*48 grids of the global 4096*2304 image, which is 5*5 grids. The accuracy of the image obtained by 320*240 is 20.00%*20.00%; from the global 4096*2304 image, the image is cut out through the 160*120 size area. The grid of the image obtained by 160*120 is equivalent to the 64*48 grids of the global 4096*2304 image, which is 2.5*2.5 grids. The accuracy of the image obtained by 160*120 is 40.00%*40.00%. Among them, the higher the statistical accuracy, the smaller the corresponding value. The equivalent grid size on the global grid is synchronously reduced, and the statistical accuracy of the corresponding ROI also deteriorates.

[0096] For example, for a global grid without size, the statistical accuracy of the corresponding ROI is also different. For the same preview image, for example, Fig. 9 As shown in the image. Fig.10a As shown, the terminal uses the second grid 32x24 (i.e., Global Grid: 32×24) for statistics, the equivalent grid is 6x8 (i.e., Equivalent Grid: 6×8), and the corresponding statistical accuracy is 16.67%*12.50% (i.e., Precision: 16.67%×12.50%); Fig.10bAs shown, the second grid 64x48 (i.e., Global Grid: 64×48) is used for statistics, and the equivalent grid is 12x16 (i.e., Equivalent Grid: 12×16), and the corresponding statistical accuracy is 8.33%*6.25%; Fig.10c As shown, the second grid 128x96 (i.e., Global Grid: 128×96) is used for statistics, the equivalent grid is 24x32 (i.e., Equivalent Grid: 24×32), and the corresponding statistical accuracy is 4.17%*3.125% (i.e., Precision: 4.17%×3.125%). The lower the accuracy, the better the statistical effect of the local ROI.

[0097] It can be understood that if the proportion of the recognition area of ​​the terminal to the area where the preview image is located is greater than the proportion threshold, the second grid is used to perform global statistics on the target object in the preview image, and the first statistical result of the target object occupying the grid block in the second grid and the second statistical result of the preview image are determined. When the recognition area is relatively large, the amount of calculation can be reduced while ensuring the accuracy of the statistical accuracy.

[0098] In some embodiments of the present application, Fig.11 This is an optional flow diagram of an image processing method provided in an embodiment of the present application. Figure 4 ,like Fig.11 As shown, S104 can be implemented by S1041 and S1042 as follows:

[0099] S1041. According to the size of the preview image and the second preset grid correspondence, select a second grid corresponding to the size of the preview image from a preset grid library.

[0100] In some embodiments of the present application, the second preset grid correspondence relationship represents the correspondence between the size of the preview image and the size of the second grid.

[0101] In some embodiments of the present application, the terminal may select a second grid corresponding to the size of the preview image from the preset grid library according to the size of the preview image and the second preset grid correspondence relationship. The larger the size of the preview image, the larger the grid is selected from the preset grid library as the second grid.

[0102] S1042: Perform global statistics on the preview image through the second grid to determine a second statistical result.

[0103] In some embodiments of the present application, the terminal may perform global statistics on the preview image through the second grid to determine a second statistical result of the preview image.

[0104] It can be understood that the terminal selects a second grid corresponding to the size of the preview image from the preset grid library according to the size of the preview image and the second preset grid correspondence, and performs global statistics on the preview image through the second grid to determine the second statistical result, so as to facilitate the subsequent determination of image parameters.

[0105] In some embodiments of the present application, Fig.12 This is an optional flow diagram of an image processing method provided in an embodiment of the present application. Figure 5 ,like Fig.12 As shown, before S102, S107 and S108 are also executed as follows:

[0106] S107: Determine the area of ​​the preview image and the area of ​​the recognition region.

[0107] In some embodiments of the present application, the terminal may calculate the area of ​​the preview image and the area of ​​the recognition region by calculating the area of ​​the preview image according to the size of the preview image and calculating the area of ​​the recognition region according to the size of the recognition region.

[0108] S108: Compare the area of ​​the recognition region with the area of ​​the preview image to obtain the proportion of the recognition region to the area where the preview image is located.

[0109] In some embodiments of the present application, the terminal may compare the area of ​​the recognition region with the area of ​​the preview image to obtain the proportion of the recognition region to the area where the preview image is located.

[0110] In some embodiments of the present application, the terminal may perform a quotient operation on the area of ​​the recognition region and the area of ​​the preview image to obtain the proportion of the recognition region to the area where the preview image is located.

[0111] It is understandable that the terminal can determine the area of ​​the preview image and the area of ​​the recognition area, compare the area of ​​the recognition area with the area of ​​the preview image, and obtain the proportion of the recognition area to the area where the preview image is located, which facilitates the subsequent selection of grids for measurement and improves statistical accuracy.

[0112] In some embodiments of the present application, after S104, S109, S1010 and S1011 are further executed as follows:

[0113] S109: Based on the first statistical result, adjust the brightness and chromaticity of the target object to determine an image brightness parameter of the target object and an image chromaticity parameter of the target object.

[0114] In some embodiments of the present application, the image brightness parameter is mainly used to adjust the brightness of the image; the image chromaticity parameter is mainly used to adjust the chromaticity of the image.

[0115] In some embodiments of the present application, the terminal may adjust the brightness of the target object according to the first statistical result to obtain the image brightness parameters of the target object; and adjust the chromaticity of the target object to determine the image chromaticity parameters of the target object.

[0116] S1010. Based on the second statistical result, adjust the brightness and chromaticity of the area in the preview image except the identified area, and determine the image brightness parameter of the area in the preview image except the identified area and the image chromaticity parameter of the area in the preview image except the identified area.

[0117] In some embodiments of the present application, the terminal may adjust the brightness of the area in the preview image except the identification area based on the second statistical result, and determine the image brightness parameters of the area in the preview image except the identification area; and adjust the chromaticity of the area in the preview image except the identification area, and determine the image chromaticity parameters of the area in the preview image except the identification area.

[0118] S1011. When capturing the next preview image frame, determine the chromaticity and brightness of the next preview image frame based on the image brightness parameters of the target object, the image chromaticity parameters of the target object, the image brightness parameters of the area excluding the identified area in the preview image, and the image chromaticity parameters of the area excluding the identified area in the preview image, and display the next preview image frame.

[0119] In some embodiments of the present application, when the next frame of preview image is captured, the chromaticity and brightness of the target object in the preview image of the next frame of preview image are determined based on the image brightness parameters of the target object and the image chromaticity parameters of the target object; the chromaticity and brightness of the next frame of preview image are determined based on the image brightness parameters of the area other than the identified area and the image chromaticity parameters of the area other than the identified area in the preview image, and the next frame of preview image is displayed.

[0120] It can be understood that the terminal can adjust the brightness and chromaticity of the target object based on the first statistical result, and determine the image brightness parameters and image chromaticity parameters of the target object; based on the second statistical result, adjust the brightness and chromaticity of the area in the preview image except the recognition area, and determine the image brightness parameters and image chromaticity parameters of the area in the preview image except the recognition area, and then adjust the chromaticity and brightness of the next frame of the preview image, thereby improving the effect of displaying the preview image.

[0121] In some embodiments of the present application, Fig.13 The present application embodiment provides an optional process diagram of an image processing method. Figure 6 ,like Fig.13As shown, first determine whether it is greater than the proportion threshold, which can be determined by the proportion of the ROI area and the global image. If it is a large ROI, use the global grid (i.e., the second grid) to measure; if it is a small ROI, use the dedicated ROI grid (i.e., the first grid) for measurement. The specific implementation of using a dedicated grid for measurement is: Then, before configuring the dedicated ROI grid window, it is necessary to determine the recognition area. After getting the face frame (i.e., the recognition area), it is expanded to a certain extent in a centered form to obtain the target recognition area (i.e., determine the target recognition area based on the recognition area), and complete the statistical measurement of the target object (i.e., obtain the statistical results from the first grid). The purpose of the expansion is mainly to leave enough area around the ROI so that when the face moves quickly, the red face frame can still fall into the green statistical frame. Finally, based on the spatial position relationship, the brightness and color measurement of the ROI area is completed from the dedicated grid statistics. The use of a dedicated grid window to participate in the ROI statistics not only improves the ROI statistical accuracy, but also reduces the accuracy requirements for the global grid window.

[0122] Based on the image processing method of the above embodiment, the embodiment of the present invention further provides an image processing chip, such as Fig.14 As shown, Fig.14 The structure diagram of an image processing chip provided by an embodiment of the present invention is as follows. The image processing chip 11 includes: an acquisition unit 1101 and a determination unit 1102, wherein:

[0123] The acquisition unit 1101 is used to acquire a preview image and determine a recognition area of ​​a target object in the preview image;

[0124] The determination unit 1102 is used to perform local statistics on the target object based on the first grid and the recognition area to determine a first statistical result of the target object if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; and determine the image parameters of the target object based on the first statistical result.

[0125] In some embodiments of the present application, the determination unit 1102 is also used to: if the proportion of the recognition area in the area where the preview image is located is less than or equal to a proportion threshold, then based on the first grid and the recognition area, perform local statistics on the target object, and after determining the first statistical result of the target object, use the second grid to perform global statistics on the preview image to determine the second statistical result; the second grid is used as a grid for the preview image; the pixel density of the second grid is greater than the pixel density of the first grid; the pixel density represents the number of pixels contained in a unit area; based on the second statistical result, determine the image parameters of the area in the preview image other than the recognition area.

[0126] In some embodiments of the present application, the determination unit 1102 is further used to determine a target identification area containing the target object based on the identification area; the target identification area is larger than the identification area; within the target identification area, using the first grid, local statistics are performed on the target object to determine the first statistical result of the grid block occupied by the target object in the first grid.

[0127] In some embodiments of the present application, the determination unit 1102 is further used to expand the boundary area of ​​the recognition area with the center of the recognition area as the origin until all information of the target object is included, thereby determining the target recognition area that includes the target object.

[0128] In some embodiments of the present application, the image processing chip 11 further includes a selection unit 1103;

[0129] The selection unit 1103 is used to select a first grid corresponding to the size of the target recognition area from a preset grid library according to a first preset grid correspondence relationship; the first preset grid correspondence relationship represents a correspondence between the size of the target recognition area and the size of the first grid;

[0130] The determining unit 1102 is further configured to perform local statistics on the target object within the target recognition area through the first grid to determine the first statistical result of the grid blocks occupied by the target object in the first grid.

[0131] In some embodiments of the present application, the determination unit 1102 is also used for capturing the preview image, and after determining the identification area of ​​the target object in the preview image, if the proportion of the identification area in the area where the preview image is located is greater than a proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine the first statistical result of the grid blocks occupied by the target object in the second grid, and the second statistical result of the preview image.

[0132] In some embodiments of the present application, the selection unit 1103 is further configured to select, according to the size of the preview image and in accordance with a second preset grid correspondence, a second grid corresponding to the size of the preview image from a preset grid library; the second preset grid correspondence relationship represents a correspondence between the size of the preview image and the size of the second grid;

[0133] The determining unit 1102 is further configured to perform global statistics on the preview image through the second grid to determine the second statistical result.

[0134] In some embodiments of the present application, the determining unit 1102 is further configured to: if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold, perform local statistics on the target object based on the first grid and the recognition area, and determine the area of ​​the preview image and the area of ​​the recognition area before determining the first statistical result of the target object;

[0135] The acquisition unit is further used to compare the area of ​​the recognition region with the area of ​​the preview image to obtain the proportion of the recognition region to the area where the preview image is located.

[0136] In some embodiments of the present application, the image parameters include image brightness parameters and image chromaticity parameters; the image processing chip 11 further includes an adjustment unit 1104;

[0137] The determining unit 1102 is further configured to, after determining the image parameters of the area in the preview image other than the identified area based on the second statistical result, adjust the brightness and chromaticity of the target object based on the first statistical result to determine the image brightness parameter of the target object and the image chromaticity parameter of the target object; and adjust the brightness and chromaticity of the area in the preview image other than the identified area based on the second statistical result to determine the image brightness parameter of the area in the preview image other than the identified area and the image chromaticity parameter of the area in the preview image other than the identified area;

[0138] The adjustment unit 1104 is used to determine the chromaticity and brightness of the next preview image frame according to the image brightness parameter of the target object, the image chromaticity parameter of the target object, the image brightness parameter of the area excluding the identified area in the preview image, and the image chromaticity parameter of the area excluding the identified area in the preview image when capturing the next preview image frame, and display the next preview image frame.

[0139] In some embodiments of the present application, the acquisition unit 1101 is further configured to acquire the preview image by zooming;

[0140] The determining unit 1102 is further configured to focus the preview image and determine a recognition area of ​​the target object in the preview image.

[0141] Based on the image processing method of the above embodiment, the embodiment of the present invention further provides an image processing chip, such as Fig.15 As shown, Fig.15 This is a schematic diagram of the structure of another image processing chip provided by an embodiment of the present invention. The image processing chip 12 includes: a processor 1201 and a memory 1202 .

[0142] In the embodiment of the present application, the processor 1201 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application does not specifically limit it.

[0143] In some embodiments of the present application, the processor 1201 is used to capture a preview image and determine a recognition area of ​​a target object in the preview image; if the proportion of the recognition area in the area where the preview image is located is less than or equal to a proportion threshold, then based on a first grid and the recognition area, local statistics are performed on the target object to determine a first statistical result of the target object; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; based on the first statistical result, the image parameters of the target object are determined.

[0144] In some embodiments of the present application, the processor 1201 is further used for performing local statistics on the target object based on the first grid and the recognition area to determine the first statistical result of the target object if the proportion of the recognition area in the area where the preview image is located is less than or equal to a proportion threshold, and then using a second grid to perform global statistics on the preview image to determine a second statistical result; the second grid is used as a grid for the preview image; the pixel density of the second grid is greater than the pixel density of the first grid; the pixel density represents the number of pixels contained in a unit area; based on the second statistical result, determining the image parameters of the area in the preview image other than the recognition area.

[0145] In some embodiments of the present application, the above-mentioned processor 1201 is also used to determine a target identification area containing the target object based on the identification area; the target identification area is larger than the identification area; within the target identification area, using the first grid, local statistics of the target object are performed to determine the first statistical result of the grid block occupied by the target object in the first grid.

[0146] In some embodiments of the present application, the processor 1201 is further used to expand the boundary area of ​​the recognition area with the center of the recognition area as the origin until all information of the target object is included, thereby determining the target recognition area including the target object.

[0147] In some embodiments of the present application, the processor 1201 is further used to select a first grid corresponding to the size of the target identification area from a preset grid library according to a first preset grid correspondence relationship; the first preset grid correspondence relationship represents the correspondence between the size of the target identification area and the size of the first grid; within the target identification area, the target object is locally counted through the first grid to determine the first statistical result of the grid block occupied by the target object in the first grid.

[0148] In some embodiments of the present application, the processor 1201 is also used for capturing the preview image and, after determining the identification area of ​​the target object in the preview image, if the proportion of the identification area in the area where the preview image is located is greater than a proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine the first statistical result of the grid block occupied by the target object in the second grid, as well as the second statistical result of the preview image.

[0149] In some embodiments of the present application, the processor 1201 is further used to select, according to the size of the preview image and in accordance with a second preset grid correspondence, a second grid corresponding to the size of the preview image from a preset grid library; the second preset grid correspondence represents a correspondence between the size of the preview image and the size of the second grid; and the preview image is globally counted through the second grid to determine the second statistical result.

[0150] In some embodiments of the present application, the processor 1201 is further used to perform local statistics on the target object based on the first grid and the recognition area if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold, and determine the area of ​​the preview image and the area of ​​the recognition area before determining the first statistical result of the target object; compare the area of ​​the recognition area with the area of ​​the preview image to obtain the proportion of the recognition area to the area where the preview image is located.

[0151] In some embodiments of the present application, the processor 1201 is further configured to, after determining the image parameters of the area in the preview image other than the identification area based on the second statistical result, adjust the brightness and chromaticity of the target object based on the first statistical result to determine the image brightness parameters of the target object and the image chromaticity parameters of the target object; based on the second statistical result, adjust the brightness and chromaticity of the area in the preview image other than the identification area to determine the image brightness parameters of the area in the preview image other than the identification area and the image chromaticity parameters of the area in the preview image other than the identification area; when capturing the next frame of preview image, determine the chromaticity and brightness of the next frame of preview image based on the image brightness parameters of the target object, the image chromaticity parameters of the target object, the image brightness parameters of the area in the preview image other than the identification area, and the image chromaticity parameters of the area in the preview image other than the identification area, and display the next frame of preview image.

[0152] In some embodiments of the present application, the processor 1201 is further configured to capture the preview image by zooming; focus the preview image, and determine an identification area of ​​the target object in the preview image.

[0153] Based on the image processing method of the above embodiment, the embodiment of the present invention further provides a terminal, such as Fig.16 As shown, Fig.16 This is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. The terminal 13 includes: an image processing chip 1301 and a housing 1302 .

[0154] In an embodiment of the present application, the image processing chip 1301 is used to capture a preview image and determine a recognition area of ​​a target object in the preview image; if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold, then based on a first grid and the recognition area, local statistics are performed on the target object to determine a first statistical result of the target object; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; based on the first statistical result, the image parameters of the target object are determined.

[0155] In some embodiments of the present application, the image processing chip 1301 is also used for: if the proportion of the recognition area in the area where the preview image is located is less than or equal to a proportion threshold, then based on the first grid and the recognition area, local statistics are performed on the target object to determine the first statistical result of the target object, and then a second grid is used to perform global statistics on the preview image to determine a second statistical result; the second grid is used as a grid for the preview image; the pixel density of the second grid is greater than the pixel density of the first grid; the pixel density represents the number of pixels contained in a unit area; based on the second statistical result, the image parameters of the area in the preview image other than the recognition area are determined.

[0156] In some embodiments of the present application, the image processing chip 1301 is further used to determine a target recognition area containing the target object based on the recognition area; the target recognition area is larger than the recognition area; within the target recognition area, using the first grid, local statistics are performed on the target object to determine the first statistical result of the grid block occupied by the target object in the first grid.

[0157] In some embodiments of the present application, the image processing chip 1301 is further used to expand the boundary area of ​​the recognition area with the center of the recognition area as the origin until all information of the target object is included, thereby determining the target recognition area that includes the target object.

[0158] In some embodiments of the present application, the image processing chip 1301 is also used to select a first grid corresponding to the size of the target recognition area from a preset grid library according to a first preset grid correspondence relationship; the first preset grid correspondence relationship represents the correspondence between the size of the target recognition area and the size of the first grid; within the target recognition area, the target object is locally counted through the first grid to determine the first statistical result of the target object occupying a grid block in the first grid.

[0159] In some embodiments of the present application, the image processing chip 1301 is also used for capturing the preview image, and after determining the identification area of ​​the target object in the preview image, if the proportion of the identification area in the area where the preview image is located is greater than a proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine the first statistical result of the grid block occupied by the target object in the second grid, as well as the second statistical result of the preview image.

[0160] In some embodiments of the present application, the image processing chip 1301 is further used to select, according to the size of the preview image and in accordance with a second preset grid correspondence, a second grid corresponding to the size of the preview image from a preset grid library; the second preset grid correspondence represents the correspondence between the size of the preview image and the size of the second grid; and the preview image is globally counted through the second grid to determine the second statistical result.

[0161] In some embodiments of the present application, the image processing chip 1301 is also used to perform local statistics on the target object based on the first grid and the recognition area if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold, and determine the area of ​​the preview image and the area of ​​the recognition area before determining the first statistical result of the target object; compare the area of ​​the recognition area with the area of ​​the preview image to obtain the proportion of the recognition area to the area where the preview image is located.

[0162] In some embodiments of the present application, the image processing chip 1301 is also used for, after determining the image parameters of the area in the preview image excluding the identification area based on the second statistical result, adjusting the brightness and chromaticity of the target object based on the first statistical result to determine the image brightness parameters of the target object and the image chromaticity parameters of the target object; adjusting the brightness and chromaticity of the area in the preview image excluding the identification area based on the second statistical result to determine the image brightness parameters of the area in the preview image excluding the identification area and the image chromaticity parameters of the area in the preview image excluding the identification area; when capturing the next frame of preview image, determining the chromaticity and brightness of the next frame of preview image according to the image brightness parameters of the target object, the image chromaticity parameters of the target object, the image brightness parameters of the area in the preview image excluding the identification area and the image chromaticity parameters of the area in the preview image excluding the identification area, and displaying the next frame of preview image.

[0163] It is understandable that the terminal can use the first grid to perform local statistics on the target object in the preview image, and use the second grid to perform global statistics on the area in the preview image other than the identification area. Since the identification area of ​​the first grid is the local area of ​​the preview image, and the identification area of ​​the second grid is the global area of ​​the preview image, when the first grid is used to perform statistics on the local area, the grid blocks in the first grid contain fewer pixels than the grid blocks in the second grid. When counting the number of grids where the pixels are located, the blank areas of the grids where the pixels are located are less, and the statistical results are more accurate, which can improve the statistical accuracy of the first statistical results and further improve the effect of displaying the preview image.

[0164] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0165] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0166] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0168] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.

Claims

1. An image processing method, characterized in that: include: Acquiring a preview image, and determining an identification area of ​​a target object in the preview image; If the proportion of the identified area to the area where the preview image is located is less than or equal to the proportion threshold, local statistics are performed on the target object based on the first grid and the identified area to determine a first statistical result of the target object; the first grid is a pixel grid used for local statistics of the identified area where the target object is located; Based on the first statistical result, an image parameter of the target object is determined.

2. The method according to claim 1, characterized in that If the proportion of the identified area to the area where the preview image is located is less than or equal to the proportion threshold, then local statistics are performed on the target object based on the first grid and the identified area to determine a first statistical result of the target object, the method further includes: A second grid is used to perform global statistics on the preview image to determine a second statistical result; the second grid is used as a grid for the preview image; the pixel density of the second grid is greater than the pixel density of the first grid; the pixel density represents the number of pixels contained in a unit area; Based on the second statistical result, image parameters of an area in the preview image excluding the identification area are determined.

3. The method according to claim 1 or 2, characterized in that: The performing local statistics on the target object based on the first grid and the identification area to determine a first statistical result of the target object includes: According to the recognition area, determining a target recognition area including the target object; the target recognition area is larger than the recognition area; In the target recognition area, the first grid is used to perform local statistics on the target object to determine the first statistical result of the grid blocks occupied by the target object in the first grid.

4. The method according to claim 3, characterized in that The step of determining a target recognition area including the target object according to the recognition area includes: The recognition area is enlarged with the center of the recognition area as the origin until all the information of the target object is included, thereby determining the target recognition area including the target object.

5. The method according to claim 3, characterized in that: The method of performing local statistics on the target object by using the first grid in the target recognition area to determine the first statistical result of the grid blocks occupied by the target object in the first grid includes: From a preset grid library, according to a first preset grid correspondence relationship, a first grid corresponding to the size of the target recognition area is selected; the first preset grid correspondence relationship represents a correspondence relationship between the size of the target recognition area and the size of the first grid; In the target recognition area, local statistics are performed on the target object through the first grid to determine the first statistical result of the grid blocks occupied by the target object in the first grid.

6. The method according to claim 1 or 2, characterized in that: After acquiring the preview image and determining the identification area of ​​the target object in the preview image, the method further includes: If the proportion of the identified area to the area where the preview image is located is greater than a proportion threshold, a second grid is used to perform global statistics on the target object in the preview image to determine the first statistical result of the grid blocks occupied by the target object in the second grid and the second statistical result of the preview image.

7. The method according to claim 2, characterized in that The adopting the second grid to perform global statistics on the preview image to determine a second statistical result includes: According to the size of the preview image and in accordance with a second preset grid correspondence relationship, selecting a second grid corresponding to the size of the preview image from a preset grid library; the second preset grid correspondence relationship represents a correspondence between the size of the preview image and the size of the second grid; The preview image is globally counted through the second grid to determine the second statistical result.

8. The method according to claim 1 or 2, characterized in that: If the proportion of the identified area to the area where the preview image is located is less than or equal to the proportion threshold, then based on the first grid and the identified area, local statistics are performed on the target object, and before determining the first statistical result of the target object, the method further includes: Determining the area of ​​the preview image and the area of ​​the recognition area; The area of ​​the recognition region is compared with the area of ​​the preview image to obtain the proportion of the recognition region to the area where the preview image is located.

9. The method according to claim 2, characterized in that: The image parameters include image brightness parameters and image chromaticity parameters; After determining the image parameters of the area other than the identified area in the preview image based on the second statistical result, the method further includes: Based on the first statistical result, adjusting the brightness and chromaticity of the target object to determine an image brightness parameter of the target object and an image chromaticity parameter of the target object; Based on the second statistical result, adjusting the brightness and chromaticity of the area in the preview image except the identified area, and determining the image brightness parameter of the area in the preview image except the identified area and the image chromaticity parameter of the area in the preview image except the identified area; When capturing the next preview image frame, the chromaticity and brightness of the next preview image frame are determined based on the image brightness parameters of the target object, the image chromaticity parameters of the target object, the image brightness parameters of the area in the preview image excluding the identification area, and the image chromaticity parameters of the area in the preview image excluding the identification area, and the next preview image frame is displayed.

10. The method according to claim 1 or 2, characterized in that: The collecting of the preview image and determining the identification area of ​​the target object in the preview image include: Acquire the preview image by zooming; The preview image is focused to determine a recognition area of ​​the target object in the preview image.

11. An image processing chip, characterized in that: The image processing chip includes: an acquisition unit, a determination unit and a measurement unit, wherein: The acquisition unit is used to acquire a preview image and determine a recognition area of ​​a target object in the preview image; The determination unit is used to perform local statistics on the target object based on the first grid and the recognition area to determine a first statistical result of the target object if the proportion of the recognition area to the area where the preview image is located is less than or equal to a proportion threshold; the first grid is a pixel grid used to perform local statistics on the recognition area where the target object is located; and determine the image parameters of the target object based on the first statistical result.

12. An image processing chip, characterized in that: include: processor and memory, wherein The memory is used to store computer programs; The processor is configured to call and run the computer program from the memory to execute the method according to any one of claims 1 to 10.

13. A terminal, characterized in that: It comprises a shell and an image processing chip arranged inside the shell; wherein the image processing chip is the image processing chip as claimed in claim 12.

14. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute and implement the image processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN111402135A

  • Determining regions of interest for photographic functions

    CN113330447A

  • Image processing device, electronic instrument, and information storage medium

    US20100290673A1

  • Methods and systems for spatially localized image editing

    US20180089799A1

  • Apparatuses, systems, and methods for managing auto-exposure of image frames based on signal region size

    US20220014661A1