A method for realizing image projection based on content addressable memory

By using content-addressable memory-based hardware to implement image projection in image processing, the problems of high computer computing power and slow processing speed caused by existing software implementation are solved, and hardware acceleration and multiple projection methods of the image projection method are realized. support.

CN115546184BActive Publication Date: 2025-01-21SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211326564.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2025-01-21
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

The existing image projection method is mainly implemented through software, resulting in high computer computing power requirements and affecting the speed of image processing.

Method used

Image projection is implemented using content-addressable memory (CAM)-based hardware, and the TCAM array parallel unit quickly counts the number of mismatched bits to achieve hardware acceleration of the image projection method.

Benefits of technology

It greatly accelerates the speed of image processing, can realize horizontal, vertical, tilt angle and other image projections, and improves the efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546184B_ABST
    Figure CN115546184B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for realizing image projection based on content addressable memory. The method is based on a TCAM array of a traditional architecture and introduces an example of feature extraction for horizontal and vertical projection of a binary image using hardware. When it is necessary to extract pixel stacking in the horizontal direction, it is only necessary to store the pixel values ​​of the binary image in the TCAM array. After that, all "1" inputs are used to match the data stored in the TCAM array, and the number of unmatched bits, that is, the number of bits of pixel "0", will be output on the ML of each row, so that the number of "0" pixels in the horizontal direction can be counted. If the vertical direction is to be processed, it is only necessary to transpose the image before storing it in the TCAM array, and then the operation is the same as above to obtain the pixel stacking statistics in the vertical direction. The present invention realizes the use of hardware to accelerate the processing of the early feature vector extraction process, greatly improving the work efficiency of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, in particular to a method for realizing image projection based on a content addressable memory, belonging to a method for accelerating image processing by hardware. Background Art

[0002] Image processing is the act of processing given image information to meet people's visual, psychological and application needs, mainly including image transformation, image coding compression, image enhancement and restoration, image segmentation, image description and image recognition. In the process of image processing, especially the processing of binary images, projection method is a common processing method, which is widely used in image segmentation, image description and image recognition. Generally speaking, image projection is divided into horizontal projection and vertical projection. The positive projection in the horizontal plane direction is called horizontal projection, which means that the two-dimensional image is projected along the horizontal axis; vertical projection refers to the projection of the two-dimensional image in the vertical direction, and the result after projection can be regarded as a one-dimensional image. For a two-dimensional image, projection is to stack the pixels of the image after binarization in a certain direction to obtain the pixel distribution histogram of the two-dimensional image. Since the pixel distribution histogram of the two-dimensional image is a one-dimensional feature vector, the projection method can realize efficient processing of data dimensionality reduction. At the same time, for image description and image recognition with higher precision requirements, more feature vectors with analytical value can be obtained through image projection operations at different rotation angles to achieve the analysis purpose. In summary, the image projection method plays an important role in the feature extraction step of image processing.

[0003] Existing image projection methods are generally implemented through software, such as the implementation steps of horizontal projection:

[0004] 1. Binarize the image, the object is black and the background is white;

[0005] 2. Loop through each row, determine whether the pixel value of each column is black, and count the number of all black pixels in the row. If there are M black pixels in the row, set the first column to the Mth column in the row to black.

[0006] Steps to implement vertical projection:

[0007] 1. Binarize the image, the object is black and the background is white;

[0008] 2. Loop through each column, determine whether the pixel value of each row is black, and count the number of all black pixels in the column. If there are M black pixels in the column, set the first row to the row to black.

[0009] The method of implementing image projection with the above software is relatively complicated and requires high computer computing power, which will affect the time required to implement image processing.

[0010] Content Addressable Memory (CAM) is a special storage array that uses content for addressing, matches an input data item with the data item stored in the cell, and outputs matching information. Ternary Content Addressable Memory (TCAM) is a storage cell structure developed on the basis of content addressable memory. TCAM mainly has three different states, namely "0" state, "1" state and "X" state. Unlike CAM, in addition to simply comparing the match and mismatch of "0" items and "1" items, TCAM also introduces a wildcard "X" state. When the "X" state is stored in the TCAM cell, regardless of whether the input is "0" or "1", the output is in a matching state. During operation, each cell is written into a different state during the programming phase. In the read phase, the data line DL (Data Line) and (Complementary of Data Line) Input different data and search the storage state in the cell. If the input data is the same as the cell storage data, the cell is in a high-impedance state, and the voltage on the originally pre-charged match line (ML, Match Line) remains unchanged. If the data is different, the ML is discharged. Usually, since each TCAM cell is connected in parallel, there is more or less discharge on each ML, and the speed of discharge has a certain functional relationship with the number of mismatches on each ML. By measuring the discharge speed on the ML, the number of mismatches on each ML can be deduced and calculated. Summary of the invention

[0011] The technical problem to be solved by the present invention is to provide a method for realizing image projection based on content addressable memory, and to realize the image projection method by using content addressable memory hardware to accelerate the speed of image processing.

[0012] In order to solve the technical problem, the technical solution adopted by the present invention is: a method for realizing image projection based on content addressable memory, comprising the following steps:

[0013] S01), determine whether the image is a binary image, if yes, proceed to step S02), if not, binarize the image and then proceed to step S02);

[0014] S02), image segmentation, segmenting the image into a number of pixel blocks of the same size as the TCAM array, the TCAM array is formed by connecting a plurality of content addressable memories in parallel;

[0015] S03), writing the pixel value corresponding to the pixel block into the TCAM array;

[0016] S04), the TCAM array is fully written with data item 1 corresponding to the white pixel block, and matched with the pixel value of the image block in the TCAM array;

[0017] S05), if the data item 1 corresponding to the white pixel block matches the pixel value of the image block in the TCAM array, the voltage on the match line of the TCAM array is flat; if the data item 1 corresponding to the white pixel block does not match the pixel value of the image block in the TCAM array, the originally pre-charged match line of the TCAM array is discharged through the peripheral circuit, and the discharge voltage and discharge time of the match line in the discharge process are obtained, and the number of mismatch bits of the pixel block is deduced according to the linear relationship between the discharge voltage and the discharge time and the number of mismatch bits, and the number of mismatch bits is the number of pixel points with a pixel value of 0 in the pixel block;

[0018] S06), repeating steps S03) to S05), obtaining the number of mismatch bits of other pixel blocks, thereby realizing image projection.

[0019] Furthermore, the discharge voltage on the matching line and the discharge attenuation coefficient satisfy the functional relationship: , where y represents the discharge voltage, t represents the discharge time, and A is a fixed value. The discharge attenuation coefficient τ is calculated according to the functional relationship and the discharge voltage and discharge time of the discharge process in step S05). The discharge attenuation coefficient τ is linearly related to the number of mismatch bits. The linear relationship is obtained through simulation. The number of mismatch bits of the pixel block in step S05) is obtained through the linear relationship and the discharge attenuation coefficient τ.

[0020] Furthermore, when obtaining the projection in the horizontal direction, the pixel values ​​corresponding to the pixel block are directly stored in the TCAM array.

[0021] Furthermore, when obtaining the projection in the vertical direction, the pixel block is transposed and its corresponding pixel value is stored in the TCAM array.

[0022] Furthermore, when obtaining the projection of the tilt angle, the pixel value corresponding to the tilt angle of the pixel block is stored in the TCAM array, and the empty cells in the TCAM array store the X state.

[0023] Furthermore, a TCAM array is composed of M*N TCAM units connected in parallel, where M represents the number of rows of the TCAM array, and N represents the number of columns of the TCAM array. The N TCAM units in each row are connected in parallel to a matching line, and then the matching lines corresponding to different rows are connected in parallel.

[0024] Furthermore, the content addressable memory in the TCAM array is a flash memory unit, a memristor or a ferroelectric memory.

[0025] Furthermore, the method is used for the feature extraction step of binary image digital recognition and edge recognition.

[0026] Furthermore, the method realizes the statistics of grayscale histogram distribution of binary images.

[0027] Beneficial effects of the present invention: The present invention realizes image projection based on a ternary content addressable memory, that is, realizes image projection through hardware, which can greatly speed up the realization speed of existing image portraits. And according to the characteristics of the ternary content addressable memory, image projection at horizontal, vertical, and inclined angles (any angle) can be realized. The present invention uses the idea that the parallel TCAM unit array is easy to count the number of mismatch bits, realizes feature extraction in binary image projection processing, and in image processing, realizes the use of hardware acceleration to process the early feature vector extraction process, greatly improving the work efficiency of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a schematic diagram of the realization and application of projection image processing;

[0029] Figure 2 is a schematic diagram of a TCAM array used for binary image projection processing;

[0030] Figure 3 It is a schematic diagram of the process of realizing binary image projection method processing by using TCAM array;

[0031] Figure 4 is an implementation flow chart of this method;

[0032] Figure 5 Schematic diagram of discharge characteristics of a single TCAM cell;

[0033] Figure 6 The mismatch characteristic diagram of an ML line composed of 8 TCAM cells;

[0034] Figure 7 It is a schematic diagram of the linear relationship between the number of mismatch bits X and the discharge attenuation coefficient τ in an array of 8×8 size;

[0035] Figure 8 It is a projection statistical graph of a circular pattern in the horizontal and vertical directions calculated by this method;

[0036] Fig. 9 This is a projection statistical chart of a bird pattern in the horizontal and vertical directions calculated by this method. DETAILED DESCRIPTION

[0037] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0038] Figure 1This is a diagram illustrating the binary image projection method. Taking a set of two lines of numbers as an example, through horizontal projection, the dividing point between the two lines can be clearly divided, thereby realizing the text segmentation between lines. Through the vertical projection of each line of text, the dividing point between each character can be obtained, thereby realizing the character segmentation. In addition, for the horizontal and vertical projections of a single character (or projections at any other angle), some simple numbers can also be recognized. Therefore, the image projection method is of great significance for image threshold segmentation, character segmentation, and contour analysis.

[0039] Figure 2 This is a schematic diagram of the composition of a TCAM array. A TCAM array is composed of several TCAM units connected in parallel to an ML line, and then several MLs connected in parallel. The image information is stored in the TCAM array by executing a write operation, and data search and matching are performed through the basic read operation of the TCAM unit. Finally, the voltage on the ML is passed through the sensing amplifier and the voltage decoder to realize the decoding calculation of the number of mismatch bits, and obtain the Hamming distance between the data stored in the row and the actual input data, that is, the total number of mismatches. For a one-dimensional vector, this operation can extract a single eigenvalue, and for a two-dimensional image, this operation can obtain a one-dimensional eigenvector, thereby realizing the function of dimensionality reduction by projection method. Each pixel of a binary image is stored in a TCAM unit in the form of a "0" or "1" data item, and the matching input is from DL and Write, the counted number of stacked pixels is read from ML.

[0040] In this embodiment, the TCAM cells in the TCAM array are new memory devices such as flash memory cells, memristors or ferroelectric memories.

[0041] Figure 3 This is a schematic diagram of mapping a binary image into a TCAM array. First, a large binary image is segmented into small pixel blocks that are easy to process (the pixel block size shown in the figure is 8×8). Secondly, the "0" pixel of the binary image corresponds to the data item "0" in the TCAM array, and the "1" pixel corresponds to the data item "1" in the TCAM array, and they are written into the TCAM array one by one. For the projection calculation in the horizontal direction, the result can be obtained directly by decoding the voltage on the ML. For the vertical projection, the original binary image matrix is ​​transposed and the above operation is repeated.

[0042] Figure 4This is a flowchart for the implementation of this method. First, for any image, it is necessary to convert it into a binary image for processing. This solution adopts the statistics of the number of mismatch bits of cutting small pixel blocks (the size of the pixel block does not exceed 16×16). In order to facilitate the statistics in the vertical direction, a square matrix with equal numbers of horizontal and vertical TCAM units is established during the implementation process. The present invention specifically takes the implementation of a TCAM array of size 8×8 as an example. First, the input binary image is divided into pixel blocks of size 8×8. Secondly, after the image is divided, the image (or the transpose of the image matrix) is stored in the TCAM array. At this time, the data items can be written into the TCAM array one by one. Thirdly, through the data lines DL and By searching for the data item "1", the number of "0" pixels in each row can be counted on each ML. Finally, the same operation is performed on each divided pixel block, and the obtained data is integrated to obtain the horizontal and vertical projection feature vectors of the initial image.

[0043] When obtaining the projection in the horizontal direction, the pixel value corresponding to the pixel block is directly stored in the TCAM array.

[0044] When obtaining the projection in the vertical direction, the pixel block is transposed and its corresponding pixel value is stored in the TCAM array.

[0045] For projection processing at any angle, due to the special properties of TCAM, adaptation items of any length can be counted in one array. Therefore, for projections at any angle, this solution can also achieve the number of projections. When obtaining projections at any / oblique angles, the pixel values ​​corresponding to the oblique angles of the pixel blocks are stored in the TCAM array, and the empty cells in the TCAM array store the X state, which can be achieved.

[0046] Figure 5 is the discharge characteristic of a single TCAM cell. For a single TCAM cell, when the input data matches the data stored in the cell (the input is consistent with the storage or the data stored in the cell is a wildcard item X), the voltage output on the originally precharged ML will not change, that is, the level is maintained. If the written data does not match the cell, the originally precharged ML will be discharged through the peripheral circuit.

[0047] Figure 6 It is the output of a small array of eight columns and one row composed of eight TCAM units in parallel. These eight TCAM units share one ML. As can be seen from the figure, as the number of mismatch bits in the array increases, the discharge rate on ML also increases. Through data fitting, it is found that these curves all follow the function , where B is a constant whose influence on the previous term can be ignored, and A is a fixed value, so the function is further simplified to , y represents the discharge voltage, t represents the discharge time, and A is a fixed value. In this functional relationship, the only difference between each curve is the discharge attenuation coefficient τ.

[0048] Figure 7 This is the relationship between the mismatch bit number X and the discharge attenuation coefficient τ. It can be found that τ and the mismatch bit number are linearly related. Therefore, the ML voltage at any time can be measured and substituted into the relationship The value of τ is calculated from the binary image, and then the number of mismatches is deduced based on the linear relationship between τ and the number of mismatches X. In the binary image projection method, the number of mismatches between the TCAM array storing the binary image and the input 1 represents the number of projected pixels. Therefore, this method can accurately use hardware to implement the image

[0049] In the binary image projection method, if the data item 1 corresponding to the white pixel block matches the pixel value of the image block in the TCAM array, the voltage on the match line of the TCAM array is flat; if the data item 1 corresponding to the white pixel block does not match the pixel value of the image block in the TCAM array, the originally pre-charged match line of the TCAM array is discharged through the peripheral circuit, and the discharge voltage and discharge time of the match line in the discharge process are obtained. The number of mismatch bits of the pixel block is deduced based on the linear relationship between the discharge voltage and discharge time and the number of mismatch bits. The mismatch bit is the number of pixel points with a pixel value of 0 in the pixel block.

[0050] Specifically, the discharge voltage on the matching line and the discharge attenuation coefficient τ satisfy the functional relationship: , where y represents the discharge voltage, t represents the discharge time, and A is a fixed value. The discharge attenuation coefficient τ is calculated according to the functional relationship and the discharge voltage and discharge time of the discharge process. The discharge attenuation coefficient τ is linearly related to the number of mismatch bits. The linear relationship is obtained through simulation, and the number of mismatch bits of the pixel block is obtained through the linear relationship and the discharge attenuation coefficient τ.

[0051] Figure 8 and 9 The following are the horizontal and vertical projections of two different patterns obtained by this method. Figure 8 and Fig. 9 It can be seen that this method can achieve the normal effect of binary image projection.

[0052] This method is used for feature extraction steps in binary image digital recognition, edge recognition, etc. This solution not only realizes projection but also realizes the statistics of grayscale histogram distribution of binary images.

[0053] What is described above are only the basic principles and preferred embodiments of the present invention. Improvements and substitutions made by those skilled in the art based on the present invention belong to the protection scope of the present invention.

Claims

1. A method for realizing image projection based on content addressable memory, characterized in that: The following steps are involved: S01), determine whether the image is a binary image, if yes, proceed to step S02), if not, binarize the image and then proceed to step S02); S02), image segmentation, segmenting the image into a number of pixel blocks of the same size as the TCAM array, the TCAM array is formed by connecting a plurality of content addressable memories in parallel; S03), writing the pixel value corresponding to the pixel block into the TCAM array; S04), the TCAM array is fully written with data item 1 corresponding to the white pixel block, and matched with the pixel value of the image block in the TCAM array; S05), if the data item 1 corresponding to the white pixel block matches the pixel value of the image block in the TCAM array, the voltage on the match line of the TCAM array is flat; if the data item 1 corresponding to the white pixel block does not match the pixel value of the image block in the TCAM array, the originally pre-charged match line of the TCAM array is discharged through the peripheral circuit, and the discharge voltage and discharge time of the match line in the discharge process are obtained, and the number of mismatch bits of the pixel block is deduced according to the linear relationship between the discharge voltage and the discharge time and the number of mismatch bits, and the number of mismatch bits is the number of pixel points with a pixel value of 0 in the pixel block; S06), repeating steps S03) to S05), obtaining the number of mismatch bits of other pixel blocks, thereby realizing image projection.

2. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: Discharge voltage and discharge attenuation coefficient on matching line Satisfies the functional relationship: , where y represents the discharge voltage, t represents the discharge time, and A is a fixed value. The discharge attenuation coefficient is calculated based on the functional relationship and the discharge voltage and discharge time of the discharge process in step S05). , discharge attenuation coefficient It is linearly related to the number of mismatches. This linear relationship is obtained through simulation. Through this linear relationship and the discharge attenuation coefficient The number of mismatch bits of the pixel block in step S05) is obtained.

3. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: When obtaining the projection in the horizontal direction, the pixel value corresponding to the pixel block is directly stored in the TCAM array.

4. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: When obtaining the projection in the vertical direction, the pixel block is transposed and its corresponding pixel value is stored in the TCAM array.

5. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: When obtaining the projection of the tilt angle, the pixel value corresponding to the tilt angle of the pixel block is stored in the TCAM array, and the empty cells in the TCAM array store the X state.

6. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: A TCAM array consists of M*N TCAM units connected in parallel, where M represents the number of rows of the TCAM array and N represents the number of columns of the TCAM array. The N TCAM units in each row are connected in parallel to a match line, and then the match lines corresponding to different rows are connected in parallel.

7. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: The content addressable memory in the TCAM array is a flash memory cell, a memristor or a ferroelectric memory.

8. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: This method is used for the feature extraction step of binary image digital recognition and edge recognition.

9. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: This method realizes the statistics of grayscale histogram distribution of binary images.

10. The method for realizing image projection based on content addressable memory according to claim 1, characterized in that: This method is used for image threshold segmentation, character segmentation and contour analysis.

Citation Information

Patent Citations

  • Self-adapting projection template method-based automobile plate positioning method

    CN101739566A

  • Apparatus and method for displaying warped version of source image

    CN102460503A