Histogram statistics data access method and device, electronic equipment and computer readable medium

By dividing the image into multiple blocks and storing them in different storage areas, the problems of large storage space requirements and data redundancy in existing technologies are solved, achieving smaller storage space and higher data reading efficiency.

CN116433463BActive Publication Date: 2026-08-04伟光有限公司(CN)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
伟光有限公司(CN)
Filing Date
2023-03-09
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In the prior art, when using static random access memory to store image histogram statistics, as the image memory increases, the storage space requirement increases, the access power consumption becomes higher, and the data redundancy is serious, resulting in excessive chip area and low efficiency.

Method used

The image is divided into multiple blocks, each corresponding to a different storage area. By determining the storage area of ​​the target image block, histogram statistics are written into the corresponding area, and data from adjacent areas are read in parallel, reducing storage space requirements and improving data reading efficiency.

Benefits of technology

The chip size was reduced, the storage space requirement was lowered, and the data reading efficiency was improved through parallel operation, avoiding data redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116433463B_ABST
    Figure CN116433463B_ABST
Patent Text Reader

Abstract

The application discloses a histogram statistical data access method and device, electronic equipment and a computer readable medium, which are applied to electronic equipment, the electronic equipment comprises a static random access memory, the static random access memory has a plurality of storage areas, the method comprises the following steps: dividing a to-be-processed image into a plurality of image blocks, each image block corresponds to a storage area, and the image blocks corresponding to the storage areas are different; determining a target image block corresponding to a target storage area; acquiring histogram statistical data of the target image block, and writing the histogram statistical data into the target storage area. Therefore, when storing image histogram data of the same size, the method needs smaller storage space, reduces the chip volume, can read the histogram data statistical results of four image blocks from four storage areas at a time, and ensures the data reading efficiency under the condition of avoiding data redundancy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital image processing technology, and more specifically, to a method, apparatus, electronic device, and computer-readable medium for storing and retrieving histogram statistical data. Background Technology

[0002] Currently, when performing feature processing on digital images, the histogram statistics for each frame are first stored in Static Random-Access Memory (SEAM) or a register buffer (Reg_buf), and then the histogram statistics are read out according to the algorithm's requirements. However, as the memory size of the images to be processed increases, the required storage space also increases, and the power consumption for accessing the images also increases. Summary of the Invention

[0003] This application proposes a method, apparatus, electronic device, and computer-readable medium for accessing histogram statistical data to improve upon the aforementioned deficiencies.

[0004] In a first aspect, embodiments of this application provide a method for storing and retrieving histogram statistical data, applied to an electronic device. The electronic device includes a static random access memory (SRAM) having multiple storage areas. The method includes: dividing an image to be processed into multiple image blocks, each image block corresponding to one storage area, with different image blocks corresponding to different storage areas; determining a target storage area corresponding to a target image block; obtaining histogram statistical data of the target image block; and writing the histogram statistical data into the target storage area.

[0005] Secondly, embodiments of this application also provide a histogram statistical data storage and retrieval device. The electronic device includes a static random access memory (SRAM) having multiple storage areas. The device includes an image block partitioning unit, a storage area determination unit, and a data writing unit. The image block partitioning unit is used to divide the image to be processed into multiple image blocks, each image block corresponding to one storage area, and the image blocks corresponding to each storage area are different. The storage area determination unit is used to determine the target storage area corresponding to the target image block. The data writing unit is used to obtain the histogram statistical data of the target image block and write the histogram statistical data into the target storage area.

[0006] Thirdly, embodiments of this application also provide an electronic device, including: a static random access memory; one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured for the methods described above.

[0007] Fourthly, embodiments of this application also provide a computer-readable storage medium storing processor-executable program code, which, when executed by the processor, causes the processor to perform the above-described method.

[0008] This application provides a method for storing and retrieving histogram statistics data. This method is applied to an electronic device, which includes a static random access memory (SRAM) with multiple storage areas. The method includes first dividing the image to be processed into multiple image blocks, then determining the target storage area corresponding to the target image block, obtaining the histogram statistics data of the target image block, and writing the histogram statistics data into the target storage area. Therefore, since each image block corresponds to one storage area, and the image blocks corresponding to different storage areas are different, by placing the histogram statistics data of each image block into different storage areas, the histogram statistics data stored in each storage area are different. Thus, when storing the same size of image histogram data, the method of this application requires less storage space, reducing chip size. Furthermore, when reading the statistical results of histogram statistics data of four adjacent image regions on a frame of an image, the reading operation can be performed in parallel, reading the histogram statistics data of four image blocks from four storage areas at once, ensuring data reading efficiency while avoiding data redundancy.

[0009] Other features and advantages of the embodiments of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the embodiments of this application. The objects and other advantages of the embodiments of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating a method for accessing histogram statistical data provided in an embodiment of this application is shown.

[0012] Figure 2 This illustration shows a schematic diagram of the image block structure of an image to be processed according to an embodiment of this application.

[0013] Figure 3 This illustration shows a data storage structure for a static random access memory (SRAM) provided in an embodiment of this application.

[0014] Figure 4 A flowchart of another histogram statistical data access method provided in an embodiment of this application is shown.

[0015] Figure 5 A flowchart illustrating another method for accessing histogram statistical data provided in an embodiment of this application is shown.

[0016] Figure 6 This paper illustrates a flowchart of another method for accessing histogram statistical data provided in an embodiment of this application.

[0017] Figure 7 This application illustrates a histogram statistics data access device according to an embodiment of the present application.

[0018] Figure 8 A structural block diagram of an electronic device provided in an embodiment of this application is shown.

[0019] Figure 9 A structural block diagram of a computer-readable storage medium provided in an embodiment of this application is shown.

[0020] Figure 10 A structural block diagram of a computer program product provided in an embodiment of this application is shown. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. The components of the embodiments of the present application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without inventive effort are within the scope of protection of the present application.

[0022] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0023] A histogram is a commonly used statistical data graph. In image processing, histograms can be built based on any image attribute value, such as image gradient and the angle of each pixel, but histograms based on image pixel values ​​are the most common. Generally, an image histogram is mainly used to describe the statistical characteristics of each gray level of an image. Further, a gray-level histogram is a two-dimensional image, with the horizontal axis representing the gray level of each pixel in the image, and the vertical axis representing the number of times and the frequency of pixels with each gray level appearing in the image. In image processing, histogram data is typically statistically analyzed from the image to be processed and stored in memory. Then, based on the specific algorithm requirements for generating the image, the histogram statistical results are read from memory to generate the image histogram.

[0024] However, the inventors discovered that in the prior art, static random-access memory (SRAM) is generally used to store histogram statistics. Due to the uncertainty of the grayscale values ​​of each frame of the image and the bandwidth limitation of SRAM itself, it is necessary to copy all the histogram statistics of a frame of the image eight times and store them in eight SRAMs respectively, which makes the area of ​​the image processing chip too large. At the same time, when it is necessary to read the statistical results of histogram statistics of four adjacent image regions on a frame of the image, the data stored in each SRAM will not be fully utilized. As the memory of the image to be processed increases, the amount of histogram statistics that need to be stored also increases, resulting in a large amount of data redundancy, wasting storage space and having a large power consumption for access.

[0025] Therefore, in order to overcome the above-mentioned defects, this application provides a method, apparatus, electronic device and computer-readable storage medium for accessing histogram statistical data.

[0026] Please see Figure 1 , Figure 1 This document illustrates a flowchart of a histogram statistical data access method according to an embodiment of this application. The method is applied to an electronic device, which includes a static random access memory (SRAM) having multiple storage areas. Specifically, the processor of the electronic device can be used as the execution entity of this method, which includes steps S110 to S130.

[0027] Step S110: Divide the image to be processed into multiple image blocks, each image block corresponding to a storage area, and the image blocks corresponding to each storage area are different.

[0028] An image is composed of a large number of pixels, each with a grayscale value. Performing histogram analysis on each pixel would significantly increase the complexity of data storage and retrieval. Therefore, please refer to [link to relevant documentation]. Figure 2 , Figure 2 A schematic diagram of an image block structure of an image to be processed is shown. In this embodiment, the image to be processed 100 is divided into multiple image blocks, each of which includes multiple pixels. Histogram data statistics are performed on the target image block 101 to collect histogram data of multiple pixels at once. Then, the histogram data of multiple image blocks are stored and retrieved, simplifying the data storage and retrieval steps.

[0029] In this embodiment, each image block corresponds to a storage region, and the image blocks corresponding to each storage region are different. By placing the histogram statistics of each image block into different storage regions, the histogram statistics stored in each storage region are different. Therefore, when storing the same size of image histogram data, the method provided in this embodiment requires less storage space, thus reducing the chip size.

[0030] Step S120: Determine the target storage area corresponding to the target image block.

[0031] As can be seen from the above embodiments, since different image blocks correspond to different storage areas, when it is necessary to access the histogram statistics of a target image block, it is necessary to first determine the storage address of the image block, that is, after determining the corresponding target storage area, the data is then stored in the corresponding area.

[0032] In some implementations, the method for determining the target storage area corresponding to the target image block may be that the image block has a specific identifier code to identify the position of a certain image block in the image to be processed. Further, the storage area has a specific area code, and there is a certain correspondence between the identifier code and the area code, so that each identifier code can correspond to a unique area code, thereby enabling each image block to correspond to a unique storage area based on the correspondence.

[0033] As one implementation, the specific identification code mentioned above can be a position parameter, that is, each image block has a unique position parameter, which is used to identify the position of the image block in the image to be processed. Further, the method for determining the target storage area corresponding to the target image block can be to determine the target storage area corresponding to the target image block based on the position parameter.

[0034] As one implementation method, please refer to Figure 3 , Figure 3 A data storage structure for a static random access memory (SRAM) 200 is illustrated. The plurality of storage regions may include a first storage region 201, a second storage region 202, a third storage region 203, and a fourth storage region 204. Each storage region has a specific region code. The position parameters include row parameters and column parameters. Therefore, the correspondence between image blocks and storage regions can be defined as follows: When the row parameter is odd and the column parameter is odd, the position parameter corresponds to the first storage region, thus determining the target storage region corresponding to the target image block as the first storage region; when the row parameter is odd and the column parameter is even, the position parameter corresponds to the second storage region, thus determining the target storage region corresponding to the target image block as the second storage region; when the row parameter is even and the column parameter is odd, the position parameter corresponds to the third storage region, thus determining the target storage region corresponding to the target image block as the third storage region; when the row parameter is even and the column parameter is even, the position parameter corresponds to the fourth storage region, thus determining the target storage region corresponding to the target image block as the fourth storage region.

[0035] Specifically, with Figure 3Taking the target image block 101 as an example, assuming the target image block 101 has a position parameter of (1,1), then based on the above correspondence between position parameters and storage areas, it can be seen that the histogram statistics of the target image block correspond to the first storage area 201. The storage areas corresponding to image blocks with other position parameters are deduced similarly. It can be seen that when the image block and storage area conform to the above correspondence, the four storage areas respectively store the image blocks in the image to be processed that have position parameters of (2k+1,2k+1), (2k+1,2k), (2k,2k+1), and (2k,2k), where k is a natural number starting from zero. That is, a single static random access memory stores all the histogram statistics of all image blocks in the image to be processed. The histogram statistics stored in each storage area are different. Therefore, when storing the same size of image histogram data, the method provided in this embodiment requires less storage space, reducing the chip size. Furthermore, since the four storage areas store the histogram statistics of each image block sequentially according to the logic of odd rows and odd columns, odd rows and even columns, even rows and odd columns, when reading the statistical results of the histogram statistics of four adjacent image regions on a frame of image, the reading operation can be performed in parallel. The histogram statistics of four image blocks can be read from the four storage areas at one time. Taking the position parameters of the image blocks to be read as (0,0), (0,1), (1,0) and (1,1) as an example, it is only necessary to read the histogram statistics of the image block with position parameter (1,1) from the first storage area 201, the histogram statistics of the image block with position parameter (1,0) from the second storage area 202, the histogram statistics of the image block with position parameter (0,1) from the third storage area 203, and the histogram statistics of the image block with position parameter (0,0) from the fourth storage area 204. In this way, the efficiency of data reading is guaranteed while avoiding data redundancy.

[0036] S130: Obtain the histogram statistics of the target image block and write the histogram statistics into the target storage area.

[0037] In this embodiment, the method for obtaining the histogram statistics of the target image block can be to use the function `hist = cv2.calcHist(img, channels, histSize, ranges, accumulate)` to calculate the histogram data. The object `hist` returned by this function is a one-dimensional array, and the elements in the array are the number of pixels at each gray level. The obtained one-dimensional array is then written into the target storage area of ​​the static random access storage region. The parameters in the function have the following meanings: `img` refers to the original image; `channels`: if the input image is a grayscale image, the value is [0], and if it is a color image, it is [0], [1], [2], corresponding to B, G, B respectively; `histSize`: the number of bins, for example

[256] or

[16] ; `ranges`: the range of pixel values, usually [0, 256]; `accumulate`: the cumulative (accumulated, superimposed) flag, the default value is False. Then, the histogram statistics are written into the target storage area using preset program statements, including C++, Python, and other programming languages.

[0038] This application provides a method for storing and retrieving histogram statistics data. This method is applied to an electronic device, which includes a static random access memory (SRAM) with multiple storage areas. The method includes first dividing the image to be processed into multiple image blocks, then determining the target storage area corresponding to the target image block, obtaining the histogram statistics data of the target image block, and writing the histogram statistics data into the target storage area. Since each image block corresponds to a storage area, and the image blocks corresponding to different storage areas are different, by placing the histogram statistics data of each image block into different storage areas, the histogram statistics data stored in each storage area are different. Therefore, when storing the same amount of image histogram data, the method of this application requires less storage space, reducing the chip size. Furthermore, when reading the statistical results of histogram statistics data of four adjacent image regions on a frame of an image, the reading operation can be performed in parallel, reading the histogram statistics data of four image blocks from four storage areas at once, ensuring data reading efficiency while avoiding data redundancy.

[0039] An image block still contains many pixels. Performing histogram data analysis and writing operations on all pixels in an image block at once would require significant memory bandwidth and place a heavy workload on the system. Therefore, please refer to [the relevant documentation / reference]. Figure 4 , Figure 4This illustration shows a flowchart of a method for accessing histogram statistical data according to an embodiment of this application, applied to an electronic device. The electronic device includes a static random access memory (SRAM) 200 and a register 300. The SRAM 200 has multiple storage areas, and the register 300 includes a first cache area 301, such as... Figure 2 As shown. Specifically, the processor of the electronic device can be used as the execution subject of the method, which includes steps S210 to S250.

[0040] S210: Divide the image to be processed into multiple image blocks, each image block corresponding to a storage area, and the image blocks corresponding to each storage area are different.

[0041] S220: Determine the target storage area corresponding to the target image block.

[0042] The implementation methods of steps S210 and S220 can be referred to the foregoing embodiments, and will not be repeated here.

[0043] S230: Obtain the target row pixel histogram statistics of the target image block, and write the target row pixel histogram statistics into the first cache area.

[0044] Specifically, the method for obtaining the target row pixel histogram statistics of the target image block can refer to the method for obtaining the histogram statistics of the target image block in the foregoing embodiments. It is worth noting that in this embodiment, all pixels in the target image block are divided into sets of multiple rows of pixels according to their positions within the target image block. When performing histogram data statistics, only the histogram data of a specific row of pixels in the target image block is statistically analyzed. Further, the target row pixel histogram statistics are written to the first cache area, and then the target row pixel histogram statistics are written to the target area through the first cache area.

[0045] S240: Read the histogram statistics of the target image block from the target storage area, and update the histogram statistics based on the target row pixel histogram statistics.

[0046] Specifically, the histogram statistics of the target image block can refer to the histogram statistics of the row pixels of the target image block that have been statistically analyzed up to the aforementioned specific row pixels, and these statistically analyzed row pixels have been stored in the corresponding target storage area in the static random access memory. For example, suppose the target image block can be divided into a block consisting of n rows of pixels, and the target row is the kth row, then the histogram statistics of the target image block can be the histogram statistics of all row pixels from the 1st row to the (k-1)th row. Further, after the first buffer area has been written with the target row pixel histogram statistics of the target image block, the histogram statistics of the target image block are read back into the first buffer area, and the two sets of data are merged to obtain the histogram statistics of all row pixels from the 1st row to the kth row, which is used as the updated histogram statistics of the target image block.

[0047] It can be concluded that step S240 can be repeatedly executed on any row of pixels in the target image block until the histogram statistics of n rows of pixels are all counted. At this time, the histogram statistics stored in the target storage area are the total data including the histogram data of all pixels in the target image block.

[0048] S250: Write the updated histogram statistics into the target storage area.

[0049] Specifically, the specific implementation of step S250 can be referred to the foregoing embodiments, and will not be repeated here.

[0050] This application provides a method for storing and retrieving histogram statistics data. This method is applied to an electronic device, which includes a static random access memory (SRAM) and registers. The SRAM has multiple storage areas, and the registers include a first cache area. The method includes: first, dividing the image to be processed into multiple image blocks; then, determining the target storage area corresponding to the target image block; obtaining the target row pixel histogram statistics data of the target image block; writing the target row pixel histogram statistics data into the first cache area; reading the histogram statistics data of the target image block from the target area; updating the histogram statistics data based on the target row pixel histogram statistics data; and writing the updated histogram statistics data into the target storage area. Because all pixels of a target image block are classified by row, and histogram data of one row of pixels is calculated each time, and then the histogram data of that row of pixels is integrated and merged with the histogram data of the previous row of pixels of the target image block stored in the target storage area before being written back to the target storage area, the computational load is reduced and the operating speed is improved.

[0051] Please see Figure 5 , Figure 5 This illustration shows a flowchart of a histogram statistical data access method according to an embodiment of this application, applied to an electronic device. The electronic device includes a static random access memory (SRAM) 200 and a register 300. The SRAM 200 has multiple storage areas, and the register 300 includes a first cache area 301 and a second cache area 302, as shown below. Figure 2 As shown. Specifically, the processor of the electronic device can be used as the execution subject of the method, which includes steps S310 to S360.

[0052] S310: Divide the image to be processed into multiple image blocks, each image block corresponding to a storage area, and the image blocks corresponding to each storage area are different.

[0053] S320: Determine the target storage area corresponding to the target image block.

[0054] S330: Obtain the target row pixel histogram statistics of the target image block, and write the target row pixel histogram statistics into the first cache area.

[0055] The implementation methods of steps S310 and S330 can be referred to the foregoing embodiments, and will not be repeated here.

[0056] S340: When the target row pixel histogram statistics are written to the first cache area, the historical histogram statistics in the second cache area are written to the storage area corresponding to the historical histogram statistics, wherein the image block corresponding to the historical histogram statistics is the previous image block of the target image block in the preset writing order.

[0057] When the register uses the first buffer area to write the histogram statistics of the target image block into the static random access memory, the static random access memory cannot immediately complete the processing and return. As a result, the register must wait for the static random access memory to complete the processing before it can send new data, which will cause a significant loss in performance and affect the data transmission efficiency.

[0058] In this embodiment, the register further includes a second cache area. When the target row pixel histogram statistics are written to the first cache area, the historical histogram statistics in the second cache area are written to the storage area corresponding to the historical histogram statistics. The image block corresponding to the historical histogram statistics is the previous image block of the target image block in a preset writing order. Specifically, the preset writing order can be an order in which position parameters increase sequentially. For example, if the position parameter of the target image block is (0,1), then the position parameter of the image block corresponding to the historical histogram statistics can be (0,0). Furthermore, the steps for obtaining the historical histogram statistics can refer to the aforementioned embodiments.

[0059] S350: Read the histogram statistics of the target image block from the target storage area, and update the histogram statistics based on the target row pixel histogram statistics.

[0060] S360: Write the updated histogram statistics to the target storage area.

[0061] Steps S350 and S360 can be referred to the aforementioned embodiments, and will not be repeated here.

[0062] This application provides a method for accessing histogram statistics. This method is applied to an electronic device, which includes a static random access memory (SRAM) and registers. The SRAM has multiple storage areas, and the registers include a first cache area and a second cache area. When the target row pixel histogram statistics are written to the first cache area, the method simultaneously writes historical histogram statistics from the second cache area to the storage area corresponding to the historical histogram statistics. The image block corresponding to the historical histogram statistics is the previous image block of the target image block in a preset writing order. Therefore, it is possible to always keep the histogram statistics in one cache area utilized while using the other cache area to store different histogram statistics, thus achieving continuous transmission of histogram statistics by simultaneously utilizing both the first and second cache areas, thereby improving the transmission rate.

[0063] Please see Figure 6 , Figure 6 This document illustrates a flowchart of a histogram statistical data access method according to an embodiment of this application. The method is applied to an electronic device, which includes a static random access memory (SRAM) having multiple storage areas. Specifically, the processor of the electronic device can be used as the execution entity of this method, which includes steps S410 to S440.

[0064] Step S410: Divide the image to be processed into multiple image blocks, each image block corresponding to a storage area, and the image blocks corresponding to each storage area are different.

[0065] Step S420: Determine the target storage area corresponding to the target image block.

[0066] Step S430: Obtain the histogram statistics of the target image block and write the histogram statistics into the target storage area.

[0067] Step S440: Based on the received location index, read the histogram statistics of the image to be processed in multiple storage areas, wherein the location index is used to identify the position of a specific image block in the image to be processed.

[0068] As one implementation, the location index can be an index that corresponds one-to-one with the location parameters. The method of reading the histogram statistics of the image to be processed in multiple storage areas based on the received location index can be: finding the corresponding location parameters through the location index to determine the specific image block; determining four adjacent image blocks based on the specific image block; and reading the histogram statistics of the four adjacent image blocks in parallel from multiple storage areas based on the location parameters of the four adjacent image blocks.

[0069] Specifically, taking (1,1) as an example, four adjacent image blocks can be determined based on this specific image block: (1,1), (1,2), (2,1), and (2,2). That is, the positions of the adjacent image blocks are determined by using the first image block of the square region formed by the four adjacent image blocks as the reference. Furthermore, the method of determining the storage area for histogram statistics of the image blocks based on the position parameters, and reading the histogram statistics of the four adjacent image blocks in parallel from multiple storage areas, can be found in the aforementioned embodiments and will not be repeated here. Furthermore, the logic for determining the four adjacent image blocks based on the specific image block may vary depending on the specific algorithm. That is, in addition to the examples given in the above embodiments, the positions of the adjacent image blocks can also be determined by using the last image block of the square region formed by the four adjacent image blocks as the reference, and so on.

[0070] Please see Figure 7 , Figure 7This application illustrates a histogram statistics data access device 400, which is applied to an electronic device. The electronic device includes a static random access memory (SRAM) with multiple storage areas. The device includes an image block partitioning unit 401, a storage area determination unit 402, and a data writing unit 403.

[0071] The image block division unit 401 is used to divide the image to be processed into multiple image blocks, each image block corresponding to a storage area, and the image blocks corresponding to each storage area are different.

[0072] The storage area determination unit 402 is used to determine the target storage area corresponding to the target image block.

[0073] The data writing unit 403 is used to obtain the histogram statistics of the target image block and write the histogram statistics into the target storage area.

[0074] Optionally, the histogram statistics storage device 400 further includes a data reading unit 404, used to read the histogram statistics of the image to be processed in multiple storage areas based on the received location index, wherein the location index is used to identify the position of a specific image block in the image to be processed.

[0075] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0076] In the several embodiments provided in this application, the coupling between the units can be electrical, mechanical or other forms of coupling.

[0077] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0078] Please see Figure 8 , Figure 8This diagram illustrates a structural block diagram of an electronic device 500 provided in an embodiment of this application. The electronic device 500 can be a smartphone, laptop, desktop computer, tablet computer, or other device capable of digital image processing. The electronic device 500 includes a static random access memory (SRAM) 501 having multiple storage areas; a processor 502; and one or more application programs. The processor 502 is electrically connected to the SRAM 501, and the one or more programs are configured to execute the methods described in the foregoing embodiments of the histogram statistics data access method.

[0079] Processor 502 may include one or more processing cores. 2 Various interfaces and lines are used to connect different parts within the electronic device 110. By running or executing instructions, programs, code sets, or instruction sets stored in the static random access memory 501, and by calling data stored in the static random access memory 501, the electronic device 110 performs various functions and processes data. Optionally, the processor 50... 2 It can be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 502 can integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and computer programs; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 502 and can be implemented using a separate communication chip. Specifically, the methods described in the foregoing embodiments can be executed by one or more processors 502.

[0080] Static random access memory 501 can be used to store instructions, programs, code, code sets, or instruction sets. Static random access memory 501 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created by the electronic device 500 during use.

[0081] Please see Figure 9This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 600 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0082] The computer-readable storage medium 600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 600 has storage space for program code 610 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.

[0083] Please refer to Figure 10 The diagram illustrates a structural block diagram 700 of a computer program product provided in an embodiment of this application. The computer program product 700 includes a computer program / instructions 710, which, when executed by a processor, implements the steps of the aforementioned method.

[0084] 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 spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for storing and retrieving histogram statistical data, characterized in that, Applied to an electronic device, the electronic device including a static random access memory (SRAM) having multiple storage regions, the multiple storage regions including a first storage region, a second storage region, a third storage region, and a fourth storage region, the method includes: The image to be processed is divided into multiple image blocks, each image block corresponds to a storage area, and the image blocks corresponding to each storage area are different. Each image block has a position parameter, which is used to identify the position of the image block in the image to be processed. The position parameter includes row parameters and column parameters. When the row parameter is odd and the column parameter is odd, the target storage area corresponding to the target image block is determined to be the first storage area; When the row parameter is odd and the column parameter is even, the target storage area corresponding to the target image block is determined to be the second storage area; When the row parameter is even and the column parameter is odd, the target storage area corresponding to the target image block is determined to be the third storage area; When the row parameter is even and the column parameter is even, the target storage area corresponding to the target image block is determined to be the fourth storage area; Obtain histogram statistics of the target image block and write the histogram statistics into the target storage area; Based on the received location index, the image block corresponding to the location index is determined, and the location index is used to identify the position of the corresponding image block in the image to be processed; Based on the image block corresponding to the location index, four adjacent image blocks are determined; Based on the position parameters of the four adjacent image blocks, histogram statistics of the four adjacent image blocks are read in parallel from multiple storage areas.

2. The method according to claim 1, characterized in that, The electronic device further includes a register, the register including a first buffer area, and the step of obtaining histogram statistics of the target image block and writing the histogram statistics into the target storage area includes: Obtain the target row pixel histogram statistics of the target image block, and write the target row pixel histogram statistics into the first cache area; Read the histogram statistics of the target image block from the target storage area, and update the histogram statistics based on the target row pixel histogram statistics; Write the updated histogram statistics into the target storage area.

3. The method according to claim 2, characterized in that, The register further includes a second cache area, and the method further includes: When the target row pixel histogram statistics are written to the first cache area, the historical histogram statistics in the second cache area are written to the storage area corresponding to the historical histogram statistics, wherein the image block corresponding to the historical histogram statistics is the previous image block of the target image block in the preset writing order.

4. A histogram statistical data storage and retrieval device, characterized in that, An electronic device, comprising a static random access memory (SRAM) having multiple storage regions, including a first storage region, a second storage region, a third storage region, and a fourth storage region, wherein the device includes: An image block partitioning unit is used to divide the image to be processed into multiple image blocks. Each image block corresponds to a storage area. The image blocks corresponding to each storage area are different. Each image block has a position parameter, which is used to identify the position of the image block in the image to be processed. The position parameter includes row parameters and column parameters. A storage region determination unit is configured to: determine the target storage region corresponding to the target image block as the first storage region when the row parameter is odd and the column parameter is odd; determine the target storage region corresponding to the target image block as the second storage region when the row parameter is odd and the column parameter is even; determine the target storage region corresponding to the target image block as the third storage region when the row parameter is even and the column parameter is odd; and determine the target storage region corresponding to the target image block as the fourth storage region when the row parameter is even and the column parameter is even. A data writing unit is used to obtain histogram statistics of the target image block and write the histogram statistics into the target storage area. The data reading unit is used to determine the image block corresponding to the received location index, wherein the location index is used to identify the position of the corresponding image block in the image to be processed; determine four adjacent image blocks based on the image block corresponding to the location index; and read the histogram statistics of the four adjacent image blocks in parallel from multiple storage areas based on the position parameters of the four adjacent image blocks.

5. An electronic device, characterized in that, include: Static random access memory; One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to be used in the method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The readable storage medium stores processor-executable program code, which, when executed by the processor, causes the processor to perform the method according to any one of claims 1-3.