Adaptive non-sine-like orthogonal transform method and storage medium
Patent Information
- Application Number
- CN202610881692.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-09-22
AI Technical Summary
计算效率与实时性不足:传统的图像变换算法多基于通用处理器(CPU)或图形处理器(GPU)通过软件指令实现
对于现有技术中计算效率与实时性不足的问题,本申请通过蝶形加减法运算和多级处理流程,能够替代传统基于通用处理器(CPU/GPU)的软件计算方式;通过这种并行化处理方式,大幅降低了单次变换的计算延迟,能够轻松应对高分辨率、高帧率图像数据的实时处理需求,特别适用于安防监控、工业检测等对时效性要求极高的场景。
Smart Images

Figure CN122796342A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital signal processing, specifically to an adaptive non-sinusoidal orthogonal transform method and storage medium. Background Technology
[0002] Orthogonal transform is a core technology for efficiently analyzing and processing signals by converting them from the spatial / time domain to the transform domain. In the field of image processing, non-sinusoidal orthogonal transforms are simpler to compute than Fourier transforms, offer higher real-time processing efficiency, and have lower algorithmic overhead.
[0003] With the rapid development of multimedia technology and computer vision, image processing technology has been widely used in fields such as security monitoring, medical imaging, industrial inspection, and consumer electronics. Among the many stages of image processing, orthogonal transformation is one of the core steps, mainly used for data compression, feature extraction, and noise suppression.
[0004] Common orthogonal transforms include the Discrete Cosine Transform (DCT), the Discrete Sine Transform (DST), and non-sinusoidal orthogonal transforms (such as the Walsh Transform, the Haar Transform, and the Slant Transform).
[0005] However, in practical applications, existing image processing solutions still have the following main problems: Insufficient computational efficiency and real-time performance: Traditional image transformation algorithms are mostly implemented through software instructions on general-purpose processors (CPUs) or graphics processing units (GPUs). When faced with high-resolution, high-frame-rate image data, the computational load of software solutions is enormous, making it difficult to meet the high real-time requirements of scenarios (such as high-speed pipelined detection or real-time video encoding). Although some existing hardware accelerators can improve speed, they are often optimized for specific algorithms and have poor versatility.
[0006] High storage resource overhead: When performing multi-level transformation operations (such as butterfly operations), traditional architectures typically need to store the intermediate results of each level of operation in a separate memory buffer for use by the next level. This "non-bitwise" computing method leads to a huge demand for on-chip memory (SRAM) or external memory bandwidth, which not only increases hardware costs but also causes increased power consumption and data transmission latency due to frequent data read and write operations.
[0007] Low algorithm flexibility: Different application scenarios have different requirements for transform algorithms. For example, the Walsh transform is suitable for fast spectral analysis, the Haar transform is suitable for edge detection, while the skew transform performs better in specific image coding. Existing hardware acceleration modules usually have a single algorithm fixed. If the algorithm needs to be switched, the hardware often needs to be reconfigured or the chip replaced, lacking the ability to flexibly support multiple transform modes under the same hardware architecture. Summary of the Invention
[0008] In view of the deficiencies in the existing technology, the technical problem to be solved by this application is: how to improve the efficiency and flexibility of digital signal conversion.
[0009] To achieve the above objectives, in a first aspect, embodiments of this application provide an adaptive non-sinusoidal orthogonal transformation method, which includes the following steps: Convert the data to be transformed into a numerical matrix; Perform transformations on the digital matrix; Transformation processing includes: Primary transformation processing flow: Perform butterfly addition and subtraction operations on adjacent data pairs to obtain primary transformation data; Multi-level transformation processing flow: Determine the data pairing method corresponding to the required non-sinusoidal orthogonal transformation type, pair the primary transformation data according to the data pairing method, and then perform butterfly addition and subtraction operations to obtain multi-level transformation data.
[0010] In conjunction with the first aspect, in one implementation, the calculation formula for butterfly addition and subtraction operations on adjacent data pairs in the primary transformation processing flow is as follows: I represents the identity matrix, and N represents the data length. The second-order matrix representing Hadamard. Represents the Kronecker product.
[0011] In conjunction with the first aspect, in one implementation, the non-sinusoidal orthogonal transform type includes at least one of Walsh, Haar, and Slant; Both Walsh and Slant use the following data pairing method: divide the data into two equal groups, with the data in each group being consecutive; divide the data in the same group into two subgroups according to the continuity of the data arrangement and align them; then pair the data in each row and perform butterfly addition and subtraction operations. Haar's data pairing method is as follows: take adjacent half of the data as a group, divide the data in the same group into two groups according to the continuity of the data arrangement and align them, then pair the data in the first row and perform butterfly addition and subtraction operations.
[0012] In conjunction with the first aspect, in one implementation, the basis functions for the data pairing method of Walsh and Slant are both: , Let n represent the 4x4 matrix of Hadamard, where n represents the number of bits N converted to binary, and x represents the number of recursions. ; The basis functions for the data pairing method of Haar are: ; .
[0013] In conjunction with the first aspect, in one implementation, the process of performing butterfly addition and subtraction operations on the paired data according to the data pairing method to obtain multi-level transformed data includes: After obtaining the transformed data through a multi-level transformation process, determine whether the data group length has reached a preset threshold: If so, the multi-level transformation process will not be performed again, and the current transformed data will be used as the multi-level transformation data; If not, continue to pair the transformed data according to the data pairing method and then perform butterfly addition and subtraction operations to obtain the transformed data.
[0014] In conjunction with the first aspect, in one implementation, the transformation result is 2 for Walsh and Slant, and 4 for Haar.
[0015] In conjunction with the first aspect, in one implementation, after the multi-level transformation process, a mutation transformation process is further included: If the non-sine orthogonal transformation type is Haar, perform a butterfly addition and subtraction operation after pairing the data according to the Haar data pairing method; If the non-sine orthogonal transformation type is Slant, select specific rows of data for pairing and perform weighted butterfly addition and subtraction operations.
[0016] In conjunction with the first aspect, in one implementation, the selection of specific row data pairing specifically involves pairing N / 2 rows and 3N / 4 rows of data, with each pair consisting of 4 adjacent data items. The formula for the weighted butterfly addition and subtraction operation is as follows:
[0017] , The mutation matrix represents Slant, where k is an even number greater than or equal to 4.
[0018] In conjunction with the first aspect, in one implementation, the data to be transformed is image data, and the process of converting the data to be transformed into a digital matrix includes: If the image data is color data, convert it to grayscale data; The grayscale value of each pixel in the converted data is represented as a digital matrix using a preset bit width.
[0019] Secondly, embodiments of this application provide a computer-readable storage medium storing an adaptive non-sinusoidal orthogonal transformation program, wherein the computer program, when executed, implements the method provided in the first aspect.
[0020] Compared with the prior art, the advantages of this application are: To address the issues of insufficient computational efficiency and real-time performance in existing technologies, this application utilizes butterfly addition and subtraction operations and a multi-level processing flow to replace traditional software computation methods based on general-purpose processors (CPU / GPU). This parallel processing method significantly reduces the computational latency of a single transformation, easily meeting the real-time processing requirements of high-resolution, high-frame-rate image data. It is particularly suitable for scenarios with extremely high timeliness requirements, such as security monitoring and industrial inspection.
[0021] To address the issue of low algorithm flexibility in existing technologies, this application enables flexible switching between different non-sinusoidal orthogonal transformation types on the same hardware architecture through the cooperation of a data gate and a corresponding control module. Users can dynamically configure the transformation mode according to specific application scenarios (such as feature extraction, data compression, edge detection, etc.) without replacing hardware or redesigning circuits, significantly improving the system's versatility and adaptability. Attached Figure Description
[0022] 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.
[0023] Figures 1 to 3 This is a schematic diagram of the data flow for the transformation process in an embodiment of this application; Figure 4 This is a schematic diagram of the workflow of the adaptive non-sinusoidal orthogonal transform system in the embodiments of this application; Figure 5 This is a hardware schematic diagram of a general four-point input method as described in the embodiments of this application; Figure 6 This is a schematic diagram illustrating the effect of image reconstruction in an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0027] In a first aspect, embodiments of this application provide an adaptive non-sinusoidal orthogonal transform method, the steps of which include: Convert the data to be transformed into a digital matrix format and store it. Perform transformations on the digital matrix; Transformation processing includes primary transformation processing flow and multi-level transformation processing flow; The primary transformation process includes: performing butterfly addition and subtraction operations on adjacent data pairs to obtain primary transformation data; The multi-level transformation process includes: determining the data pairing method corresponding to the required non-sinusoidal orthogonal transformation type; pairing the primary transformation data according to the data pairing method; performing butterfly addition and subtraction operations to obtain the multi-level transformation data.
[0028] After multi-level transformation processing, it is necessary to perform mutation transformation processing on the non-sinusoidal orthogonal transformation types that produce mutations, so that all rows and columns become orthogonal; the mutation transformation processing is selected according to different non-sinusoidal orthogonal bases.
[0029] Therefore, we can conclude that: To address the issues of insufficient computational efficiency and real-time performance in existing technologies, this application utilizes butterfly addition and subtraction operations and a multi-level processing flow to replace traditional software computation methods based on general-purpose processors (CPU / GPU). This parallel processing method significantly reduces the computational latency of a single transformation, easily meeting the real-time processing requirements of high-resolution, high-frame-rate image data. It is particularly suitable for scenarios with extremely high timeliness requirements, such as security monitoring and industrial inspection.
[0030] To address the issue of low algorithm flexibility in existing technologies, this application enables flexible switching between different non-sinusoidal orthogonal transformation types on the same hardware architecture through the cooperation of a data gate and a corresponding control module. Users can dynamically configure the transformation mode according to specific application scenarios (such as feature extraction, data compression, edge detection, etc.) without replacing hardware or redesigning circuits, significantly improving the system's versatility and adaptability.
[0031] In one embodiment, the application scenario is image processing, that is, the data to be transformed is image data. In this case, the process of converting the data to be transformed into a digital matrix includes: If the image data is color data (YUV / Ycbcr), convert it to grayscale data; If the image data is grayscale data, the conversion process remains unchanged; The grayscale value of each pixel in the converted data (0-255 (8 bits, i.e., the color depth is represented by numbers from 0 to 255) is represented as a two-dimensional digital matrix (256*256) with a preset bit width and stored in memory.
[0032] In one embodiment, the calculation formula for butterfly addition and subtraction operations on adjacent data pairs in the above primary transformation processing flow is as follows: I represents the identity matrix, and N represents the data length. The second-order matrix representing Hadamard. Represents the Kronecker product.
[0033] For example, see Figure 1 As shown, selecting by column, for example, the first data x0 in the first column and the first data x1 in the second column, then pairing x0 and x1 and performing butterfly addition and subtraction operations, yields x0+x1 (i.e., addition via butterfly operation) and x0-x1 (i.e., subtraction via butterfly operation); the first data x2 in the second column and the first data x3 in the third column; then pairing x2 and x3 and performing butterfly addition and subtraction operations, yields x2+x3 and x2-x3.
[0034] Furthermore, the aforementioned non-sinusoidal orthogonal transformation types include Walsh, Haar, or Slant.
[0035] Both Walsh and Slant use the following data pairing method: divide the data into two equal groups, with the data in each group being continuous; divide the data in the same group into two subgroups according to the continuity of the data arrangement and align them; then pair the data in each row and perform butterfly addition and subtraction operations, i.e., full calculation.
[0036] For example, see Figure 1 As shown, when selecting by column, the first data in each of the first to fourth columns (x0+x1, x0-x1, x2+x3, x2-x3) form one group; Divide x0+x1 and x0-x1 into one group, and x2+x3 and x2-x3 into another group. After aligning: If x0+x1 and x2+x3 are on the same line, then the butterfly addition and subtraction operations are: x0+x1+x2+x3, x0+x1-x2+x3; If x0-x1 and x2-x3 are on the same line, then the butterfly addition and subtraction operations are: x0-x1+x2-x3, x0-x1-x2-x3.
[0037] Specifically, the basis functions for data pairing in both Walsh and Slant are: , Let n represent the 4x4 matrix of Hadamard, where n represents the number of bits N converted to binary, and x represents the number of recursions. .
[0038] Haar's data pairing method is as follows: take adjacent half of the data as a group, divide the data in the same group into two groups according to the continuity of the data arrangement and align them, then only pair the data in the first row and perform butterfly addition and subtraction operations, and do not perform pairing operations on the remaining data.
[0039] Specifically, the basis functions for Haar's data pairing method are: ; .
[0040] It should be noted that the result of each operation directly overwrites the original data location to avoid data conflicts, and there is no need to allocate additional memory space to store intermediate results; this can be achieved by reordering the data registers used for paired operations.
[0041] Therefore, this application, through its unique in-place computation mechanism, allows the calculation result of each stage to directly overwrite the original input data location in memory during multi-stage transformations, eliminating the need to allocate separate memory buffers for intermediate results. This not only significantly reduces the capacity requirements of on-chip SRAM or external memory but also lowers the bandwidth pressure and power consumption caused by data read / write operations, solving the problem of high storage overhead in traditional architectures.
[0042] Meanwhile, the process of performing butterfly addition and subtraction operations on the data after pairing according to the data pairing method to obtain multi-level transformed data includes: After obtaining the transformed data through a multi-level transformation process, it is determined whether the data group length has reached a preset threshold. Specifically, based on the data sequence number, it is determined whether the transformation result after multiple binary divisions (divided by 2) of the base number meets the requirements of a non-sinusoidal orthogonal transformation type. If so, the multi-level transformation process will not be performed again, and the current transformed data will be used as the multi-level transformation data; If not, continue to pair the transformed data according to the above data pairing method and perform butterfly addition and subtraction operations to obtain the transformed data, that is, perform the second level of multi-level transformation. At this time, the pairing distance within the group increases with the increase of the level (for example, the third level may be the 1st and the 5th pair).
[0043] Specifically, for Walsh and Slant, the above transformation result is 2, and for Haar, the above transformation result is 4.
[0044] Furthermore, the above-mentioned mutation transformation process specifically includes: If the non-sine orthogonal transformation type is Walsh, see [link / reference]. Figure 1 As shown, no additional processing will be performed; If the non-sinusoidal orthogonal transformation type is Haar, see [link / reference]. Figure 2 As shown, a butterfly addition and subtraction operation is performed after the data is paired according to Haar's data pairing method; If the non-sine orthogonal transformation type is Slant, see [link to relevant documentation]. Figure 3 As shown, specific rows of data are selected, paired, and weighted butterfly addition and subtraction operations are performed, with a standardization coefficient added.
[0045] For details, see Figure 3 As shown, the above-mentioned selection of specific rows of data pairing is as follows: pairing rows N / 2 and 3N / 4 with 4 adjacent data as a group; The formula for weighted butterfly addition and subtraction is:
[0046] , The mutation matrix represents Slant, where k is an even number greater than or equal to 4.
[0047] Similarly, since this operation is a bitwise operation, we only need to pay attention to the output of each level of reordering (designing registers at empty nodes in parallel with the adders and subtractors) to ensure parallelism.
[0048] Furthermore, after the mutation processing, the method has already formed an orthogonal transformation; if it is necessary to generate a standard non-sinusoidal orthogonal transformation type in the future, it may also include the following steps: reordering the data according to the preset sorting rules, and restoring the data whose positions were disordered due to parallel computing to the specified order.
[0049] Secondly, embodiments of this application provide an adaptive non-sinusoidal orthogonal transform system, the system comprising: Data input interface module: used to receive raw data from external image sensors or memory; supports multiple input formats, including RGB format, YUV format or existing Gray format.
[0050] The preprocessing module (grayscale conversion unit) is used to execute the above process of converting the data to be transformed into a digital matrix for storage.
[0051] Specifically, the preprocessing module is connected to the data input interface and integrates a color space conversion algorithm circuit. When the input is color data, this unit converts the color pixels into 8-bit or 10-bit grayscale values through a weighted adder (e.g., according to the Rec.601 standard: Y=0.299R+0.587G+0.114B). When the input is already grayscale data, this unit passes through, and the converted data is organized into a two-dimensional matrix.
[0052] Storage module: It adopts dual-port SRAM or on-chip register file to store the preprocessed grayscale matrix data and intermediate results of each transformation. The key to this embodiment is to support bit-by-bit storage, that is, the read and write addresses are the same, which reduces data handling.
[0053] Multi-stage transformation processing module: This is the core computing unit of the system, consisting of multiple cascaded processing stages.
[0054] The multi-level transformation processing module specifically includes: The primary transformation processing unit is used to: execute the above-described primary transformation processing flow; Specifically, the primary transformation processing unit includes a default-on data gate and several parallel butterfly units, each containing an adder and a subtractor for processing adjacent data pairs.
[0055] A multi-level transformation processing unit is used to: execute the above-mentioned multi-level transformation processing flow; Specifically, the multi-level transformation processing unit structure is similar to the primary transformation processing unit type, but the data gate at the data input end is controlled by the mode signal of the control module, which determines which data is paired or special pairing operations, and which data is not paired.
[0056] The mutation processing unit is used to execute the above mutation processing procedure. Specifically, the mutation processing unit mainly performs specific row operations and coefficient weighting on Haar and Slant.
[0057] Control module: Implemented using a finite state machine (FSM). It is responsible for generating enable signals for each processing unit, mode selection signals for data strobes (Walsh / Haar / Slant), read / write address signals for memory, and synchronization signals for the pipeline.
[0058] Data reordering module: Located at the output end, optional configuration; contains address mapping logic to rearrange out-of-order data output from the pipeline according to its natural order.
[0059] Data output interface module: Sends the processed data to the subsequent encoding module or external storage.
[0060] See below. Figure 5 As shown, the workflow of the above system is illustrated through an example with time sequence as the main dimension (the application scenario is image data processing).
[0061] S1: Data Acquisition and Standardization: Receive image data. If the image resolution is 256x256, the preprocessing module converts it into a 256x256 grayscale matrix. Each pixel is quantized into an 8-bit integer (0-255). Data is written to the starting address of the storage module in row-major order.
[0062] S2: Primary Transformation: The control module starts the primary transformation processing unit, and the memory reads two adjacent data (e.g., data at address 0 and address 1) at the same time; the primary transformation processing unit obtains the primary transformation data after performing the above primary transformation processing flow.
[0063] This step is performed in parallel on all adjacent data pairs.
[0064] S3: Multi-level transformation processing: The primary transformation data enters the multi-level transformation processing unit to undergo the above multi-level transformation processing flow to obtain multi-level transformation processed data.
[0065] The first multi-level transformation process is as follows: Data is grouped into sets of four (e.g., addresses 0-3). The control module configures the data selector based on the user-defined mode signal. Walsh and Slant: The gates send the first and third data items in the group to the arithmetic unit, and the second and fourth data items to the arithmetic unit. All data items participate in the calculation.
[0066] Haar: The squeegee only sends the first and third data to the arithmetic unit; the second and fourth data are not calculated.
[0067] S4: Mutation Processing: The multi-level transformed data is sent to the mutation processing unit to execute the above mutation processing procedure; specifically: Walsh: Straight through, no operation required.
[0068] Haar: The control module instructs that the first row and middle row of data in the matrix be added or subtracted again to complete the final normalization step of the Haar wavelet.
[0069] Slant: The control module enables the weighted multiplier. Select a specific row (such as row N / 2 and row 3N / 4), multiply it by a preset standardization factor, and then perform addition and subtraction combinations.
[0070] S5: Data Reordering and Output: Due to hardware parallel computing and bitwise operations, the physical address of the output data in memory may be in bit-reversed order. Therefore: If a natural order is required later, the control module will activate the data reordering module to read out and rearrange the data through the address mapping table.
[0071] If subsequent modules support randomized input, this step can be skipped.
[0072] The following explanation will be elaborated using three scenarios corresponding to different types of non-sinusoidal orthogonal transformations.
[0073] Scenario 1: Walsh Transformation (8 points) The application scenario is image processing, specifically, the data to be transformed is image data (color). The specific process is as follows: S101: Convert image data to grayscale data.
[0074] S102: The grayscale value (0-255 (8 bits), that is, the color depth is represented by numbers 0 to 255) of each pixel of the converted data is represented by a two-dimensional digital matrix (256*256) with a preset bit width and stored in the memory.
[0075] S103: Primary Transformation Process: The general steps here are: perform butterfly addition and subtraction operations on adjacent data pairs to obtain the first-level transformed data (the primary transformed data mentioned above), i.e., see [link to documentation]. Figure 1 As shown, the first-level output is x0+x1, x0-x1, x2+x3, x2-x3, x3+x4, x3-x4, x5+x6, x5-x6, x7+x8, x7-x8.
[0076] S104: Multi-level transformation processing flow: Same as S103. The second level takes the output of the first level as input and divides the output data into two groups again. The first and third rows, and the second and fourth rows are paired and butterfly operations are performed to obtain the outputs x0+x1+(x2+x3), x0-x1-(x2-x3)... Using the data index as the base, the multi-level transformation ends when the result of multiple binary divisions of the base is 2, and then proceeds to S105.
[0077] S105: Sequencing process, this step is the same as S5 above.
[0078] Scenario 2: Haar Transform (8 points) The application scenario is image processing, specifically, the data to be transformed is image data (color). The specific process is as follows: S201: Convert image data to grayscale data.
[0079] S202: The grayscale value (0-255 (8 bits), that is, the color depth is represented by numbers from 0 to 255) of each pixel of the converted data is represented by a two-dimensional digital matrix (256*256) with a preset bit width and stored in the memory.
[0080] S203: Primary Transformation Process: The general steps here are: perform butterfly addition and subtraction operations on adjacent data pairs to obtain the first-level transformed data (the primary transformed data mentioned above), i.e., see [link to documentation]. Figure 1 As shown, the first-level output is x0+x1, x0-x1, x2+x3, x2-x3, x3+x4, x3-x4, x5+x6, x5-x6, x7+x8, x7-x8.
[0081] S204: Multi-level transformation processing flow: Divide the output of S203 into two groups. Perform butterfly addition and subtraction operations on the first row x0 / x4 and the middle row x2 / x6 of each group. Using the data sequence number as the base, the multi-level transformation ends when the base is 4 after multiple binary divisions, and then proceeds to S205; if there are 8 inputs, then S4 will only have 1 level.
[0082] S205: Mutation processing flow, performing butterfly addition and subtraction operations on the first row x0+x1+x2+x3 and the middle row x4+x5+x6+x7.
[0083] S206: Sequencing process, this step is the same as S5 above.
[0084] Scenario 3: Slant Transform (8 points) The application scenario is image processing, specifically, the data to be transformed is image data (color). The specific process is as follows: S301: Convert image data to grayscale data.
[0085] S302: The grayscale value (0-255 (8 bits), i.e., the color depth is represented by numbers from 0 to 255) of each pixel in the converted data is represented by a two-dimensional digital matrix (256*256) with a preset bit width and stored in the memory.
[0086] S303: Primary Transformation Process: The general steps here are: perform butterfly addition and subtraction operations on adjacent data pairs to obtain the first-level transformed data (the primary transformed data mentioned above), i.e., see [link to relevant documentation]. Figure 1 As shown, the first-level output is x0+x1, x0-x1, x2+x3, x2-x3, x3+x4, x3-x4, x5+x6, x5-x6, x7+x8, x7-x8.
[0087] S304: Multi-level transformation processing flow: Following S103, the second level takes the output of the first level as input, and divides the output data into two groups again. The first and third rows, and the second and fourth rows, are paired and butterfly operations are performed to obtain outputs x0+x1+(x2+x3), x0-x1-(x2-x3)... Using the data sequence number as the base, the multi-level transformation ends when the base equals 2 after multiple binary divisions, and the process proceeds to S305. If there are 8 input points, then S4 only has 2 levels.
[0088] S305: The mutation process still divides the output data into two consecutive groups. The first-level mutation selects the data in rows 3 (x2) and 4 (x3) / 7 (x6) and 8 (x7) for butterfly addition and subtraction. The second-level mutation selects only rows 5 and 6 for butterfly addition and subtraction. The selection rule for mutation is that the elements in rows i / 2 and 3i / 4 (row numbers are counted from 0 to i-1) of each group are processed. Weighting coefficients can be input via multipliers and registers.
[0089] S306: Sequencing process, this step is the same as S5 above.
[0090] In practical applications, edge detection aims to find regions where the image grayscale levels change in a gradient. Based on the calculated degree of grayscale change between adjacent regions, it determines whether to use them as boundaries for image segmentation, which is similar to the principles of human vision.
[0091] Existing edge detection operators, such as the Sobel edge operator, Canny edge operator, and Prewitt edge operator, use difference operators to perform computational thresholding on the image. Instead, sinusoidal orthogonal transforms are simpler to compute than Fourier transforms, have higher real-time processing efficiency, and lower algorithm overhead.
[0092] See Figure 5 As shown, the method of this application can effectively construct a general-purpose hardware system (e.g., Figure 5 The copy module, mutation module, and reordering module in this application implement different types of non-sinusoidal orthogonal transformations, and use relatively few logic gates; the image reconstruction effect of this application can be found in [reference needed]. Figure 6 As shown.
[0093] Thirdly, embodiments of this application also provide a computer-readable storage medium.
[0094] The computer-readable storage medium of this application stores an adaptive non-sinusoidal orthogonal transformation program, wherein when the adaptive non-sinusoidal orthogonal transformation program is executed by a processor, it implements the steps of the adaptive non-sinusoidal orthogonal transformation method as described above.
[0095] The method implemented when the adaptive non-sinusoidal orthogonal transform program is executed can be referred to in various embodiments of the adaptive non-sinusoidal orthogonal transform method of this application, and will not be repeated here.
[0096] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0097] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0098] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0099] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0100] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0102] The above are merely specific embodiments of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the scope of the claims.
Claims
1. An adaptive non-sinusoidal orthogonal transform method, characterized in that, The method includes the following steps: Convert the data to be transformed into a numerical matrix; Perform transformations on the digital matrix; Transformation processing includes: Primary transformation processing flow: Perform butterfly addition and subtraction operations on adjacent data pairs to obtain primary transformation data; Multi-level transformation processing flow: Determine the data pairing method corresponding to the required non-sinusoidal orthogonal transformation type, pair the primary transformation data according to the data pairing method, and then perform butterfly addition and subtraction operations to obtain multi-level transformation data.
2. The adaptive non-sinusoidal orthogonal transform method as described in claim 1, characterized in that: The calculation formula for butterfly addition and subtraction operations on adjacent data pairs in the primary transformation processing flow is as follows: ; I represents the identity matrix, and N represents the data length. The second-order matrix representing Hadamard. Represents the Kronecker product.
3. The adaptive non-sinusoidal orthogonal transform method as described in claim 1, characterized in that: The non-sinusoidal orthogonal transformation type includes at least one of Walsh, Haar, and Slant; Both Walsh and Slant use the following data pairing method: divide the data into two equal groups, with the data in each group being consecutive; divide the data in the same group into two subgroups according to the continuity of the data arrangement and align them; then pair the data in each row and perform butterfly addition and subtraction operations. Haar's data pairing method is as follows: take adjacent half of the data as a group, divide the data in the same group into two groups according to the continuity of the data arrangement and align them, then pair the data in the first row and perform butterfly addition and subtraction operations.
4. The adaptive non-sinusoidal orthogonal transform method as described in claim 3, characterized in that: The basis functions for the data pairing methods of Walsh and Slant are both: , Let n represent the 4x4 matrix of Hadamard, where n represents the number of bits N converted to binary, and x represents the number of recursions. ; The basis functions for the data pairing method of Haar are: ; 。 5. The adaptive non-sinusoidal orthogonal transform method as described in claim 3, characterized in that, The process of performing butterfly addition and subtraction operations on data paired according to the data pairing method to obtain multi-level transformed data includes: After obtaining the transformed data through a multi-level transformation process, determine whether the data group length has reached a preset threshold: If so, the multi-level transformation process will not be performed again, and the current transformed data will be used as the multi-level transformation data; If not, continue to pair the transformed data according to the data pairing method and then perform butterfly addition and subtraction operations to obtain the transformed data.
6. The adaptive non-sinusoidal orthogonal transform method as described in claim 5, characterized in that: For Walsh and Slant, the transformation result is 2; for Haar, the transformation result is 4.
7. The adaptive non-sinusoidal orthogonal transform method as described in claim 3, characterized in that: After multi-level transformation processing, the process also includes mutation transformation processing: If the non-sine orthogonal transformation type is Haar, perform a butterfly addition and subtraction operation after pairing the data according to the Haar data pairing method; If the non-sine orthogonal transformation type is Slant, select specific rows of data for pairing and perform weighted butterfly addition and subtraction operations.
8. The adaptive non-sinusoidal orthogonal transform method as described in claim 7, characterized in that: The specific method for selecting and pairing specific rows of data is as follows: pair rows N / 2 and 3N / 4 of data into groups of four adjacent rows; The formula for the weighted butterfly addition and subtraction operation is as follows: , The mutation matrix represents Slant, where k is an even number greater than or equal to 4.
9. The adaptive non-sinusoidal orthogonal transform method according to any one of claims 1 to 8, characterized in that: The data to be transformed is image data, and the process of converting the data to be transformed into a digital matrix includes: If the image data is color data, convert it to grayscale data; The grayscale value of each pixel in the converted data is represented as a digital matrix using a preset bit width.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an adaptive non-sinusoidal orthogonal transformation program, wherein when the adaptive non-sinusoidal orthogonal transformation program is executed, it implements the steps of the adaptive non-sinusoidal orthogonal transformation method as described in any one of claims 1 to 9.