OCT (Optical Coherence Tomography)-based depth scanning information splicing method
Through the OCT-based depth scan information splicing method, laser tomography data is processed, which solves the problem of data processing time and incoherence in depth information in OCT technology, and realizes efficient data processing and intuitive deep information display.
Patent Information
- Application Number
- CN202510176322.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-02-18
AI Technical Summary
In the field of laser welding, OCT technology takes a long time to process data due to large amounts of data, and the collected effective depth information is incoherent, making it difficult to intuitively display the overall condition of welding depth, affecting the accurate evaluation of welding quality.
The OCT-based depth scan information splicing method is adopted to receive the original data of laser tomography, divide it into groups, extract the maximum value of each group to form a compressed data matrix, and perform normalization processing to generate a grayscale image, add a depth scale bar, and support grayscale and pseudo-color display.
It significantly improves data processing speed, realizes data compression, improves storage efficiency, can more intuitively represent the depth information of welding melting, supports output in multiple image formats, and meets different application needs.
Smart Images

Figure CN120107064A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser welding, and in particular to a method for splicing deep scanning information based on OCT. Background Art
[0002] OCT (optical coherence tomography) technology plays a vital role in the field of laser welding. Its core advantage lies in the ability to achieve high-precision, real-time penetration depth detection and quality monitoring. However, in practical applications, OCT technology also faces some challenges. Due to the large amount of data collected by OCT, the data processing process takes a long time, which to a certain extent limits its application efficiency in real-time detection scenarios. The effective depth information collected by OCT often presents an incoherent state, making it difficult to intuitively display the overall situation of welding penetration, which brings inconvenience to the accurate evaluation of welding quality. In order to solve the above problems, the depth information splicing method came into being; this method reasonably integrates the collected depth information according to the welding speed and length, realizes the compression of invalid depth data and the amplification of effective depth data, so as to more intuitively represent the depth information of welding penetration; by adjusting the relevant parameters, the depth information splicing method can generate a fitting curve that is closer to the real depth curve, which provides strong support for the accurate monitoring of welding quality. However, there are defects such as low data processing efficiency, unintuitive information display, and incoherent effective depth information collected.
[0003] Prior art 1, application number: CN202411024475.4 discloses a scanning laser welding penetration prediction method based on independent temporal multi-feature fusion. By collecting visual image information in the scanning laser welding process, a semantic segmentation method based on deep learning and an image processing algorithm are used to extract the static and dynamic feature information of the keyhole and the molten pool in the visual signal, and an image processing algorithm is used to extract the penetration of the weld as the input and output of the penetration prediction model. A penetration prediction model is constructed, and the temporal static and dynamic features are input into the penetration prediction model in parallel. The Encoder unit of Transformer is used to independently fit the relationship between each temporal feature and the penetration, and the feature fusion is performed in a fully connected manner. The prediction result of the scanning laser welding penetration regression model is output, and the prediction error is only 0.03mm. Although the stability of welding is ensured and the quality and performance of the welded joint are significantly improved; however, the use of the model for data processing and prediction results in a large amount of sample data required for model training, which reduces the efficiency of data processing to a certain extent.
[0004] Prior art 2, application number: CN202410914787.6 discloses a lithium battery production process and system that eliminates the helium inspection process, including: cell assembly; pressing the cell into the cell shell; welding the cell shell and the top cover, the welding beam includes a welding laser and a detection light, the welding laser irradiates the connection between the cell shell and the top cover to form a keyhole, the detection light is separated by a spectroscope into a first detection light and a first detection light, the first detection light is coupled with the welding laser and irradiated at the bottom of the keyhole, and the first detection light is irradiated at the weld; the penetration depth of the keyhole is obtained based on the first detection light and the first detection light; the standard penetration depth and the obtained penetration depth are compared, and it is judged whether the welding is qualified. Although the helium inspection process is eliminated, the welding is judged by detecting the welding penetration depth; however, its judgment method is relatively simple, relying on laser judgment, and it needs to rely on the accuracy of laser installation and debugging, which is greatly limited in practical applications.
[0005] Prior art three, application number: CN202411238714.6 discloses a cover plate assembly and a battery, the cover plate assembly includes: a cover plate, a pole, a sealing ring and a welding ring. The outer contour of the first column section of the pole is larger than the outer contour of the second column section, the first column section is limited to the first side of the cover plate, a welding ring is provided on the second side of the cover plate and the welding ring is welded to the second column section, when the cover plate assembly is assembled, it is only necessary to weld the welding ring to the second column section, the assembly process is simple, and the welding penetration A of the weld is limited to a value range of 1.2PM / D≤A≤0.8T, and the welding penetration is associated with the full life cycle pressure P of the sealing ring, the ratio M of the contact area between the sealing ring and the welding ring and the circumference of the inner ring of the welding ring, the shear strength D of the weld and the thickness T of the welding ring. Although it can ensure sufficient welding strength and avoid melting the sealing ring, ensure airtightness, and control product quality by controlling the welding penetration depth; however, there is a lack of visualization means for the welding penetration depth, which makes the production process uncontrollable and is not conducive to process improvement.
[0006] At present, the prior art 1, prior art 2 and prior art 3 have the defects of low data processing efficiency, non-intuitive information display and incoherent effective depth information collected. Therefore, the present invention provides a method for splicing depth scanning information based on OCT. Summary of the invention
[0007] In order to solve the above technical problems, the present invention provides a method for stitching deep scanning information based on OCT, comprising the following steps:
[0008] Receive the raw data of laser tomography and input the floating-point data matrix; divide each row of data into a group, extract the maximum value in each group, and form a compressed data matrix; use the ProcessedResults class to manage the processed data;
[0009] Normalize the values of the compressed data matrix to the range of 0-255; create an 8-bit grayscale image, support both grayscale and pseudo-color display modes, and rotate the grayscale image; add a depth scale to the right of the grayscale image, and draw tick marks and unit logos on the scale;
[0010] Save the grayscale image with added scale, select the save path and file name; it also supports capturing and handling abnormal situations during file saving, and provides clear error prompts.
[0011] Optionally, use the ProcessedResults class to manage the processed data, including the following steps:
[0012] The raw data of each frame of laser tomography is a 1024×1024 floating point matrix, which represents 1024 rows of data. Each row contains 1024 pixels. The 1024 rows of data are divided into 16 groups, each containing 64 rows.
[0013] For each group of 64 rows of data, process them column by column, and for each column, extract the maximum value from the 64 rows; store each group of 1024 extracted maximum values as a 1×1024 row vector; stack the 16 groups of extracted row vectors in sequence to form a 16×1024 compressed data matrix;
[0014] In the ProcessGroup method of the DataProcessor class, a two-dimensional array result is defined to store the final compressed data matrix. The size of result is RESULT_ROWS rows and ROW_LENGTH columns. The processing tasks of 16 groups of data are assigned to multiple threads or computing units. Each thread independently processes a group of 64 rows of data, extracts the maximum value and fills it into the corresponding row of result.
[0015] Optionally, the process of forming a 16×1024 compressed data matrix comprises the following steps:
[0016] 1024 rows of data are divided into 16 groups, each with 64 rows, using a dynamic grouping strategy; the group size is dynamically adjusted according to the local characteristics of the laser tomography data; the clustering strategy is used to pre-analyze the laser tomography data and automatically determine the grouping strategy;
[0017] Extract multiple eigenvalues of each column, including the maximum, minimum, average value of laser reflection intensity and variance of scattering coefficient; generate a multidimensional eigenvector by calculating the laser reflection intensity and scattering coefficient;
[0018] According to the local characteristics of laser tomography data, the compression weight is dynamically adjusted by calculating the laser reflection intensity and scattering coefficient.
[0019] Optionally, the process of assigning the processing tasks of the 16 sets of data to multiple threads or computing units includes the following steps:
[0020] Each thread independently processes a set of 64 rows of data, calculates the gradient of the laser reflection intensity and the gradient of the scattering coefficient, and multiplies the two gradients to calculate the gradient product of each set of data;
[0021] The gradient products of each group of data need to be summed, and the gradient products of all groups of data are summed, and the sum of the gradient products of each group of data is divided by the sum of the total gradient products;
[0022] The storage parameters are introduced to adjust the range of the storage hierarchy, and each group of data is allocated to a different storage hierarchy according to the calculated storage hierarchy.
[0023] Optionally, the process of drawing tick marks and unit labels on the scale bar includes the following steps:
[0024] Normalize each data point in the compressed data matrix and scale all data points to the range of 0-1;
[0025] Convert the grayscale value of the normalized data point to a grayscale level, assign the processed data to the corresponding position of the grayscale image, and convert the grayscale image to a grayscale image used for pseudo-color image; after setting the rotation angle using the RotateTransform method of the Graphics object, use the DrawImage of the Graphics object to draw the original image to the new position and apply the rotation transformation at the same time;
[0026] The scale range of the scale bar is determined according to the minimum and maximum grayscale values of the data, and the scale bar is drawn on the image using the Graphics object.
[0027] Optionally, the process of scaling all data points to the range 0-1 consists of the following steps:
[0028] Extract the numerical characteristics of each data point from the compressed data matrix, including its original grayscale value and the overall distribution characteristics of the data set; determine the value range of the data by analyzing the minimum and maximum grayscale values of the data points;
[0029] The original grayscale value of each data point is offset adjusted, and the starting point of the data is aligned to the zero point by subtracting the minimum grayscale value of the data set; the offset-adjusted data points are scaled using the value range; the data point value range is compressed to between 0 and 1 by dividing the offset data point by the value range to achieve data normalization;
[0030] The normalized data points are verified to be in the range of 0 to 1.
[0031] Optionally, the process of setting the rotation angle using the Graphics object's RotateTransform method includes the following steps:
[0032] The normalized value is then converted to a grayscale level, which is an integer between 0 and 255; the processed data is assigned to the corresponding position of the image by multiplying the normalized value by 255 and ensuring that the result is between 0 and 255;
[0033] For each pixel in the grayscale image, a corresponding pseudo color is selected according to its grayscale value; the selection of the pseudo color is realized by a color mapping function, and the selected pseudo color is set to the corresponding position in the new color image;
[0034] After setting the rotation angle using the Graphics object's RotateTransform method, use the Graphics object's DrawImage method to draw the original image to the new position while applying the rotation transformation.
[0035] Optionally, the process of drawing a scale bar on the image using a Graphics object consists of the following steps:
[0036] Input the minimum grayscale value, maximum grayscale value, scale width, scale height and scale interval; determine the scale range of the scale according to the minimum grayscale value and maximum grayscale value; calculate the scale interval according to the scale height and scale range; calculate the total number of scales according to the scale range and scale interval; generate scale label values according to the scale interval and scale range;
[0037] Use the Graphics object to create a new image or canvas for drawing the scale; Draw vertical lines to represent the scale marks according to the scale's height and tick interval; Use the DrawLine method of the Graphics object to draw the tick marks; Draw tick labels next to each tick mark, and use the DrawString method of the Graphics object to draw the tick labels, with the label content being the tick label value; Draw unit labels at the top or bottom of the scale; Use the DrawString method of the Graphics object to draw the unit labels;
[0038] Use the RotateTransform method of the Graphics object to set the rotation angle to 90 degrees; use the DrawImage method of the Graphics object to draw the rotated scale to the target position; save the drawn scale image as a file or display it on the interface.
[0039] Optionally, the process of drawing tick marks, drawing tick labels, and drawing unit identifiers includes the following steps:
[0040] According to the height and scale interval of the scale bar, the vertical position of each scale mark is calculated; the vertical line is drawn using the Graphics.DrawLine method, and the color of the scale mark is selected to contrast with the main color of the tomographic image; the thickness of the scale mark is dynamically adjusted according to the width of the scale bar;
[0041] The scale label is used to mark the grayscale value or depth value corresponding to each scale line. Leave a space on the right or left side of each scale line for drawing the label. The vertical position of the label is aligned with the scale line, and the horizontal position is dynamically adjusted according to the scale width. The scale label value is generated according to the scale range and scale interval. The labelValue is formatted as a string and the decimal places are retained. The label is drawn using the Graphics.DrawString method. The font is a sans-serif font, and the label color is consistent with the scale line color.
[0042] The unit identifier is used to indicate the unit of the scale bar and is placed at the top or bottom of the scale bar. The specific position is adjusted according to the image layout. If the scale bar is long, place the unit identifier in the middle. Depending on the specific application of laser tomography, the unit identifier is a grayscale value or a depth value.
[0043] Optionally, use the Graphics.DrawString method to draw the unit logo, with a font larger than the scale label and the same color as the scale label; use a grayscale gradient in the background of the scale bar, from the minimum grayscale value to the maximum grayscale value, which is consistent with the grayscale distribution of the tomographic image.
[0044] The present invention adopts parallel computing technology, which significantly improves the data processing speed; through the group processing strategy, it effectively reduces the memory usage; realizes the data compression function, and the compression ratio is 64:1, which significantly improves the storage efficiency. It can retain key depth information to ensure the integrity of image information; supports two display modes, grayscale and pseudo-color, to meet different observation needs; the image has high clarity and strong detail expression, which is convenient for observation and analysis. It supports the output of multiple image formats to meet different application needs; it can store multiple sets of data, which is convenient for comparative analysis and research; it is easy to integrate into other systems and has good compatibility and scalability. The operation is simple and convenient, and users can use it without professional training; the processing process has a high degree of automation, which reduces manual intervention and errors; it is equipped with a complete error handling mechanism to ensure the stable operation of the system.
[0045] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0046] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0048] Figure 1 This is a flow chart of a method for stitching deep scan information based on OCT in Example 1 of the present invention;
[0049] Figure 2 This is a schematic diagram of a method for stitching deep scan information based on OCT in Example 1 of the present invention;
[0050] Figure 3 This is a process diagram of using the ProcessedResults class to manage processed data in Example 2 of the present invention;
[0051] Figure 4 A process diagram of forming a 16×1024 compressed data matrix in Embodiment 3 of the present invention;
[0052] Figure 5 This is a process diagram of allocating the processing tasks of 16 groups of data to multiple threads or computing units in Embodiment 4 of the present invention;
[0053] Figure 6 A process diagram of drawing scale lines and unit identifiers on a scale in Embodiment 5 of the present invention;
[0054] Figure 7 This is a process diagram of scaling all data points to a range of 0-1 in Example 6 of the present invention;
[0055] Figure 8 A process diagram of setting the rotation angle using the RotateTransform method of the Graphics object in Embodiment 7 of the present invention;
[0056] Fig. 9 2. FIG. 1 is a process diagram of pseudo color selection in Embodiment 8 of the present invention being achieved through a color mapping function;
[0057] Fig.10 A process diagram of drawing a scale on an image using a Graphics object in Embodiment 9 of the present invention;
[0058] Fig.11 This is a process diagram for drawing scale lines, drawing scale labels, and drawing unit identifiers in embodiment 10 of the present invention. DETAILED DESCRIPTION
[0059] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0060] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0061] When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the present application. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0062] Example 1: Figure 1 As shown, an embodiment of the present invention provides a method for stitching deep scan information based on OCT, comprising the following steps:
[0063] S100: Receive the raw data of laser tomography and input a floating point data matrix of size 1024×1024; divide every 64 rows of data into a group, a total of 16 groups, extract the maximum value in each group, and form a 16×1024 compressed data matrix; use the ProcessedResults class to manage the processed data;
[0064] S200: Normalize the values of the compressed data matrix to the range of 0-255; create an 8-bit grayscale image, support grayscale and pseudo-color display modes, and rotate the grayscale image 90 degrees; add a depth scale to the right of the grayscale image, with a default depth range of 0-3000 microns, and draw tick marks and unit logos on the scale;
[0065] S300: Save the grayscale image with added scale in PNG, JPEG, BMP and other formats, and select the save path and file name; it also supports capturing and processing abnormal situations during file saving and provides clear error prompts.
[0066] The working principle and beneficial effects of the above technical solution are as follows: This embodiment first receives the raw data of laser tomography and inputs a floating-point data matrix of size 1024×1024; divides every 64 rows of data into a group, a total of 16 groups, extracts the maximum value in each group, and forms a compressed data matrix of 16×1024; uses the ProcessedResults class to manage the processed data; secondly, normalizes the value of the compressed data matrix to the range of 0-255; creates an 8-bit grayscale image, supports grayscale and pseudo-color display modes, and rotates the grayscale image by 90 degrees; adds a depth scale to the right side of the grayscale image, with a default depth range of 0-3000 microns, and draws scale lines and unit logos on the scale; finally, saves the grayscale image with the scale in PNG, JPEG, BMP and other formats, and selects the save path and file name; at the same time, it supports capturing and processing abnormal situations in the file saving process, and provides clear error prompts (the principle is referred to in the attached Figure 2 ). Step S100 of the above scheme significantly reduces the amount of data while retaining key depth information; uses the ProcessedResults class to uniformly manage the compressed data, supports the storage, access and clearing of multiple sets of data, and improves the flexibility and scalability of data processing. Significance: By extracting the maximum value, the amount of data is greatly reduced while retaining key information, saving computing resources for processing; managing data through classes is convenient for calling and analysis, and the degree of automation of the overall process is improved. Step S200 image conversion and visualization, normalizes the values of the compressed data matrix to the range of 0-255 to facilitate the generation of 8-bit grayscale images; creates 8-bit grayscale images, supports grayscale and pseudo-color display modes, and meets the visualization requirements of different scenes; rotates the image 90 degrees to optimize the display effect for easy observation and analysis; adds a depth scale on the right side of the image, with a default range of 0-3000 microns, and draws scale lines and unit logos to enhance the readability and scientificity of the image. Significance: Through normalization and image generation, the abstract depth data is converted into intuitive images, which is convenient for quick understanding of the data; adding scales and tick marks makes the image more scientifically valuable and convenient for quantitative analysis and comparison. Step S300 Image saving and error handling, supports saving in multiple formats such as PNG, JPEG, BMP, etc., provides a file saving dialog box, allowing users to select the save path and file name; captures and handles abnormal situations during file saving, provides clear error prompts, and ensures a smooth saving process. Significance: Save the processed images in multiple formats for easy use, sharing and archiving; through error handling and prompt functions, improve the robustness and user-friendliness of the system and avoid data loss due to saving failure.
[0067] The performance advantages of this embodiment: the use of parallel computing technology significantly improves the data processing speed; the group processing strategy effectively reduces memory usage; realizes data compression function, with a compression ratio of 64:1, which significantly improves storage efficiency. Image quality advantages: It can retain key depth information to ensure the integrity of image information; it supports both grayscale and pseudo-color display modes to meet different observation needs; the image has high clarity and strong detail expression, which is convenient for observation and analysis. System scalability: It supports the output of multiple image formats to meet different application needs; it can store multiple sets of data for comparative analysis and research; it is easy to integrate into other systems and has good compatibility and scalability. Practicality: It is simple and convenient to operate, and users can use it without professional training; the processing process is highly automated, reducing human intervention and errors; it is equipped with a complete error handling mechanism to ensure the stable operation of the system.
[0068] In summary, this embodiment achieves efficient data compression and management; converts data into intuitive images and adds scientific annotations to improve the readability and analytical value of images; ensures the persistence and reliability of processing results and improves user experience. The overall process forms a complete closed loop from data reception, processing to visualization and preservation, which is suitable for efficient splicing and analysis of OCT deep scanning information and has important scientific research and clinical application value.
[0069] Example 2: Figure 3 As shown, based on Example 1, the process of using the ProcessedResults class to manage processed data provided by the embodiment of the present invention includes the following steps:
[0070] S101: Each frame of raw data of laser tomography is a 1024×1024 floating point matrix, which represents 1024 rows of data, each row contains 1024 pixels, and the 1024 rows of data are divided into 16 groups, each group contains 64 rows;
[0071] S102: for each group of 64 rows of data, process column by column, and for each column, extract the maximum value from the 64 rows; store the 1024 maximum values extracted from each group as a 1×1024 row vector; stack the 16 groups of extracted row vectors in sequence to form a 16×1024 compressed data matrix;
[0072] S103: In the ProcessGroup method of the DataProcessor class, define a two-dimensional array result for storing the final compressed data matrix, the size of result is RESULT_ROWS rows (16 rows) and ROW_LENGTH columns (1024 columns); assign the processing task of 16 groups of data to multiple threads or computing units, each thread independently processes a group of 64 rows of data, extracts the maximum value and fills it into the corresponding row of result;
[0073] Among them, the ProcessedResults class data management defines TOTAL_ROWS to represent the total number of rows, MERGE_GROUP_SIZE to represent the number of columns merged in each group, and RESULT_ROWS to represent the number of result rows (calculated by dividing the total number of rows by the number of columns merged in each group); in the ProcessGroup method, the input array sourceData and the two-dimensional array result used to store the processing results are defined; RESULT_ROWS (the number of result rows) are processed in parallel through the Parallel.For loop; in each iteration, the flipped row index flippedRow is calculated and each column is traversed; in the column traversal, an internal loop is performed on MERGE_GROUP_SIZE (the number of columns merged in each group), the value of the corresponding position is read from the input array sourceData, and the maximum value in the group is found; the found maximum value is stored in the flipped position flippedRow of the result array result and the current column col; after the parallel processing is completed, the processed result array result is added to _results (a result set of ProcessedResults type) through the AddResult method.
[0074] The working principle and beneficial effects of the above technical solution are as follows: First, in this embodiment, the raw data of each frame of laser tomography is a 1024×1024 floating-point matrix, representing 1024 rows of data, each row containing 1024 pixels, and the 1024 rows of data are divided into 16 groups, each group containing 64 rows; secondly, for each group of 64 rows of data, column by column processing is performed, and for each column, the maximum value is extracted from the 64 rows; the 1024 maximum values extracted from each group are stored as a 1×1024 row vector; the 16 groups of extracted row vectors are stacked in sequence to form a 16×1024 compressed data matrix; finally, in the ProcessGroup method of the DataProcessor class, a two-dimensional array result is defined to store the final compressed data matrix, and the size of result is RESULT_ROWS rows (16 rows) and ROW_LENGTH columns (1024 columns); the processing tasks of 16 groups of data are assigned to multiple threads or computing units, and each thread independently processes a group of 64 rows of data, extracts the maximum value and fills it into the corresponding row of result. In step S101 of the above scheme, the original 1024×1024 floating-point matrix is grouped into 16 groups, each group contains 64 rows of data. The grouping method decomposes large-scale data into smaller units for parallel processing. Significance: By dividing the data into smaller units, the amount of data processed at a single time is reduced, and the computational complexity is reduced; after grouping, each group of data can be processed independently, laying the foundation for multi-threaded or distributed computing; after grouping, the memory usage is more controllable, avoiding memory overflow caused by loading too much data at one time. Step S102 data compression, each group of 64 rows of data is processed column by column, the maximum value of each column is extracted, and a 1×1024 row vector is generated; the 16 groups of row vectors are stacked in sequence to form a 16×1024 compressed data matrix. Significance: By extracting the maximum value, 64 rows of data are compressed into one row, which significantly reduces the amount of data; the maximum value extraction retains the important features of each column, ensuring that the compressed data can still reflect the key information of the original data; the compressed data matrix is smaller in size and convenient for storage and transmission. Step S103 makes full use of computing resources through multi-threading or distributed computing, significantly shortening the processing time; through thread-safe design, it ensures that no data conflict occurs when multiple threads operate the result array at the same time; and encapsulates the data processing task in the ProcessGroup method to facilitate code reuse and maintenance.
[0075] In summary, the ProcessedResults class of this embodiment realizes efficient management and processing of large-scale laser tomography data; reduces computational complexity and provides a basis for parallel processing; reduces data volume, retains key information, and improves storage and transmission efficiency; fully utilizes computing resources, improves processing efficiency, and ensures data consistency. It not only optimizes the data processing process, but also provides high-quality input data for data analysis, visualization, or further operations.
[0076] Example 3: Figure 4 As shown, based on Example 2, the process of forming a 16×1024 compressed data matrix provided in the embodiment of the present invention includes the following steps:
[0077] S1021: 1024 rows of data are divided into 16 groups, each with 64 rows, using a dynamic grouping strategy; the group size is dynamically adjusted according to the local characteristics of the laser tomography data (such as reflection intensity, scattering coefficient, etc.); the laser tomography data are pre-analyzed using a clustering strategy to automatically determine the grouping strategy;
[0078] The group size is calculated using the following formula"
[0079]
[0080] Where, (G_i) represents the group size of the i-th group; I(x ij ) represents the laser reflection intensity of the j-th row of data in the i-th group; I(x ik ) represents the laser reflection intensity of the k-th row of data in the i-th group; represents the variance of the scattering coefficient of the j-th row of data in the i-th group; α, β, γ, δ represent dynamic adjustment parameters, which are used to control the range of the grouping size; the dynamic grouping strategy dynamically adjusts the grouping size by calculating the local characteristics of the laser tomography data (such as reflection intensity and scattering coefficient); it can automatically optimize the grouping size according to the degree of data change, thereby improving the flexibility and efficiency of data processing;
[0081] The group optimization weight is calculated using the following formula:
[0082]
[0083] Where W i represents the group optimization weight of the i-th group; C(x ij ) represents the cluster center of the laser reflection intensity of the j-th row of data in the i-th group; D(x ij) represents the distance from the jth row of data in the i-th group to the cluster center; η, θ, κ, λ represent optimization parameters, which are used to control the range of group optimization weights; the group optimization algorithm dynamically adjusts the group optimization weights by calculating the cluster center and distance of the laser tomography data; it can automatically optimize the grouping strategy according to the distribution characteristics of the data and improve the intelligent level of data processing;
[0084] S1022: extract multiple eigenvalues of each column, the eigenvalues including the maximum value, minimum value, average value and scattering coefficient variance of the laser reflection intensity; generate a multi-dimensional eigenvector by calculating the laser reflection intensity and the scattering coefficient;
[0085] The multi-eigenvector is calculated using the following formula:
[0086]
[0087] In the formula, F i represents the multi-eigenvector of the i-th group; S(x ij ) represents the scattering coefficient S(x ik ) represents the scattering coefficient of the k-th row of data in the i-th group; μ, ν, ξ, ρ represent feature extraction parameters, which are used to control the range of multiple feature vectors; they can more comprehensively reflect the characteristics of laser tomography data and avoid the information loss that may be caused by a single feature;
[0088] S1023: dynamically adjusting the compression weight by calculating the laser reflection intensity and the scattering coefficient according to the local characteristics of the laser tomography data;
[0089] The compression weight is calculated using the following formula:
[0090]
[0091] In the formula, C i represents the compression weight of the i-th group; φ, ψ, ω, χ represent compression parameters, which are used to control the range of compression weight; the adaptive compression algorithm dynamically adjusts the compression weight by calculating the laser reflection intensity and scattering coefficient; it can dynamically adjust the compression strategy according to the data characteristics to achieve a balance between compression efficiency and data quality.
[0092] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, first, 1024 rows of data are divided into 16 groups, each with 64 rows, and a dynamic grouping strategy is adopted; the group size is dynamically adjusted according to the local characteristics of the laser tomography data (such as reflection intensity, scattering coefficient, etc.); the laser tomography data is pre-analyzed using a clustering strategy to automatically determine the grouping strategy; secondly, multiple eigenvalues of each column are extracted, and the eigenvalues include the maximum value, minimum value, average value of the laser reflection intensity and the variance of the scattering coefficient, etc.; a multidimensional eigenvector is generated by calculating the laser reflection intensity and the scattering coefficient; finally, according to the local characteristics of the laser tomography data, the compression weight is dynamically adjusted by calculating the laser reflection intensity and the scattering coefficient. Step S1021 of the above solution is a dynamic grouping strategy. According to the local characteristics of laser tomography data (such as reflection intensity, scattering coefficient, etc.), the grouping size is dynamically adjusted to avoid resource waste or information loss that may be caused by fixed grouping; by calculating the change rate of reflection intensity and the variance of scattering coefficient, the grouping strategy is dynamically optimized to ensure the uniformity and representativeness of each group of data; clustering algorithm is used to pre-analyze data, calculate grouping optimization weights, and dynamically adjust grouping strategies; by calculating the laser reflection intensity cluster center and the distance from the data to the cluster center, the grouping strategy is further optimized to improve the intelligent level of data processing. Significance achieved: The dynamic grouping strategy can automatically adjust the grouping size according to the local characteristics of the data to adapt to the needs of different data distributions; through clustering analysis and grouping optimization weight calculation, computing resources are reasonably allocated to avoid resource waste; the dynamic grouping strategy can adapt to complex and changeable laser tomography data and improve the robustness of the algorithm. Step S1022 multi-feature extraction, extract multiple eigenvalues of each column (such as the maximum value, minimum value, average value and scattering coefficient variance of laser reflection intensity, etc.) to generate a multi-dimensional feature vector; by calculating the change rate of reflection intensity and scattering coefficient, dynamically adjust the feature extraction strategy to ensure that the extracted features can fully reflect the characteristics of the data; the multi-feature extraction mechanism avoids the information loss problem that may be caused by a single feature, and ensures that the compressed data matrix can retain the key information of the original data. Significance achieved: The multi-dimensional feature vector can more comprehensively describe the characteristics of laser tomography data and provide richer information for subsequent analysis and processing; by extracting multiple eigenvalues, it is ensured that the compressed data matrix can support a variety of application scenarios (such as target recognition, feature analysis, etc.); the multi-feature extraction mechanism avoids the limitations that may be caused by a single feature and improves the reliability of data processing. Step S1023 adaptive compression algorithm dynamically adjusts the compression weight according to the local characteristics of the laser tomography data to ensure the balance between compression efficiency and data quality; dynamically adjusts the compression strategy by calculating the rate of change of the reflection intensity and the scattering coefficient to achieve adaptive compression; the adaptive compression algorithm can dynamically adjust the compression strategy according to the data characteristics to ensure that the compressed data matrix is both efficient and accurate; and achieves a balance between compression efficiency and data quality by controlling the compression parameters.Significance achieved: The adaptive compression algorithm can dynamically adjust the compression strategy according to the data characteristics, significantly improving the compression efficiency; by dynamically adjusting the compression weight, it ensures that the compressed data matrix can retain the key information of the original data and avoid data distortion; the adaptive compression algorithm can adapt to the needs of different scenarios and improve the practicality and versatility of the algorithm.
[0093] In summary, this embodiment achieves the following technical effects and significances in the process of forming a 16×1024 compressed data matrix through dynamic grouping strategy, multi-feature extraction and adaptive compression algorithm: improve the flexibility and efficiency of data processing, the dynamic grouping strategy and adaptive compression algorithm can dynamically adjust the processing strategy according to the data characteristics, significantly improve the efficiency and flexibility of data processing; enhance the characterization ability and availability of data, the multi-feature extraction mechanism can fully reflect the characteristics of laser tomography data, and ensure that the compressed data matrix can support a variety of application scenarios; optimize resource allocation and data quality, and achieve efficient resource utilization and data quality optimization by dynamically adjusting the grouping size, feature extraction strategy and compression weight. It not only improves the intelligent level of laser tomography data processing, but also provides a solid foundation for data analysis and application.
[0094] Example 4: Figure 5 As shown, based on Example 2, the process of allocating the processing tasks of 16 groups of data to multiple threads or computing units provided in the embodiment of the present invention includes the following steps:
[0095] S1031: Each thread independently processes a group of 64 rows of data, calculates the gradient of the laser reflection intensity and the gradient of the scattering coefficient, and multiplies the two gradients to calculate the gradient product of each group of data;
[0096] Calculate the gradient of the laser reflection intensity. For each set of data i, calculate the laser reflection intensity I(x ij )’s gradient;
[0097]
[0098] In the formula, x ij Represents the coordinate value of the j-th row of data in the i-th group;
[0099] Calculate the gradient of the scattering coefficient and calculate the scattering coefficient S(x ij )’s gradient:
[0100]
[0101] To calculate the gradient product, multiply the two gradients together to get the gradient product:
[0102]
[0103] S1032: The gradient products of each group of data need to be summed, the gradient products of all groups of data are summed, and the sum of the gradient products of each group of data is divided by the sum of the total gradient products;
[0104] For each set of data i, multiply the gradient product G ij Sum:
[0105]
[0106] In the formula, V = 64, which indicates the number of rows in each group of data;
[0107] Sum the gradient products of all groups of data:
[0108]
[0109] In the formula, W = 16, indicating the total number of groups;
[0110] Divide the sum of the gradient products of each group of data by the sum of the total gradient products:
[0111]
[0112] The purpose is to eliminate the impact of data size and ensure the rationality of storage hierarchy;
[0113] S1033: introducing storage parameters to adjust the range of storage levels, and allocating each group of data to different storage levels according to the calculated storage levels;
[0114] Compute storage hierarchy:
[0115]
[0116] Where ι, κ, λ, and μ are storage parameters used to control the range of the storage hierarchy; ι and κ are used to enlarge the range of the storage hierarchy; λ and μ are used to reduce the range of the storage hierarchy. The parameters can be adjusted according to actual needs to achieve dynamic optimization of the storage hierarchy. If L i If the value is large, it means that the change trend of this group of data is significant and can be allocated to high-speed storage media (such as memory); if L i A smaller value indicates that the data group has a slow change trend and can be allocated to a low-speed storage medium (such as a hard disk);
[0117] Fill the processing results of each set of data into the corresponding row of the two-dimensional array result:
[0118] result[i][j]=max(x i1 ,x i2 ,…,x i64 )
[0119] In the formula, max represents the maximum value extracted from 64 rows of data.
[0120] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, first, each thread independently processes a group of 64 rows of data, calculates the gradient of the laser reflection intensity and the gradient of the scattering coefficient, and multiplies the two gradients to calculate the gradient product of each group of data; secondly, the gradient product of each group of data needs to be summed, and the gradient products of all groups of data are summed, and the sum of the gradient products of each group of data is divided by the sum of the total gradient products; finally, the storage parameter is introduced to adjust the range of the storage hierarchy, and each group of data is allocated to a different storage hierarchy according to the calculated storage hierarchy. In step S1031 of the above scheme, the gradient calculation and gradient product, each thread independently processes a group of 64 rows of data, fully utilizing the parallel capability of multi-threading or computing units, and significantly improving the computing efficiency; by calculating the gradient of the laser reflection intensity and the scattering coefficient row by row, the change trend of the data is extracted; the two gradients are multiplied to obtain the gradient product, which is used to quantify the comprehensive effect of the data change. Significance: Gradient calculation can effectively capture the changing characteristics of data and provide a basis for data storage and optimization; by allocating tasks through multi-threading, the computing time is greatly shortened, which is suitable for large-scale data processing scenarios. Step S1032: Gradient product summation and normalization. After summing the gradient products of each group of data, divide the summation result by the total gradient product summation result to eliminate the influence of data scale and ensure the comparability between different groups of data. Significance: Lay the foundation for the dynamic allocation of storage levels to ensure the rationality and efficiency of data storage. Step S1033: Storage level allocation and result filling. By introducing storage parameters, dynamically adjust the range of storage levels to achieve optimal configuration of storage resources. According to the size of the storage level value, allocate data to high-speed storage media (such as memory) or low-speed storage media (such as hard disk) to improve data access efficiency. Fill the maximum value of each group of data into the two-dimensional array result for easy analysis and use. Significance: By dynamically adjusting the storage level, reasonably allocate storage resources, reduce storage costs, and improve data access speed. By extracting the maximum value of each group of data, reduce data redundancy, and facilitate subsequent analysis and processing.
[0121] In summary, this embodiment realizes efficient processing and storage optimization of large-scale data through parallel computing, gradient analysis, normalization processing and dynamic storage allocation. Through multi-threaded parallelization and data feature extraction, the calculation time is significantly shortened; through dynamic storage level allocation, efficient use of storage resources is achieved; and a high-quality data foundation is provided for data analysis. It fully reflects the coordinated optimization of computing and storage, and is suitable for application scenarios that require efficient processing of large-scale data; multi-threaded processing improves the efficiency of data processing, and the hierarchical storage mechanism further optimizes the allocation of storage resources and avoids storage bottlenecks; through the gradient information of laser reflection intensity and scattering coefficient, storage resources can be allocated more flexibly to adapt to the changing trends of different data. It not only improves the efficiency of data processing, but also optimizes the utilization of storage resources, and is suitable for large-scale data processing scenarios. This embodiment can significantly improve the efficiency and quality of data processing by combining the hierarchical storage mechanism with multi-threaded processing. It has high technical value and market potential, and is suitable for scenarios that require efficient storage and processing, such as laser tomography, image processing, and big data analysis.
[0122] Example 5: Figure 6 As shown, based on Example 1, the process of drawing scale lines and unit marks on a scale provided by an embodiment of the present invention includes the following steps:
[0123] S201: performing normalization calculation on each data point in the compressed data matrix, scaling all data points to a range of 0-1;
[0124] S202: converting the grayscale value of the normalized data point into a grayscale level, assigning the processed data to the corresponding position of the grayscale image, and converting the grayscale image into a grayscale image used for a pseudo-color image; after setting the rotation angle (90 degrees) using the RotateTransform method of the Graphics object, using the DrawImage of the Graphics object to draw the original image to the new position, and applying the rotation transformation at the same time;
[0125] S203: Determine the scale range of the scale according to the minimum grayscale value and the maximum grayscale value of the data, and use the Graphics object to draw the scale on the image.
[0126] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, each data point in the compressed data matrix is first normalized and calculated, and all data points are scaled to a range of 0-1; secondly, the grayscale value of the normalized data point is converted to a grayscale level, the processed data is assigned to the corresponding position of the grayscale image, and the grayscale image is converted into a grayscale image used for a pseudo-color image; after setting the rotation angle (90 degrees) by the RotateTransform method of the Graphics object, the original image is drawn to a new position using the DrawImage of the Graphics object, and the rotation transformation is applied at the same time; finally, the scale range of the scale is determined according to the minimum grayscale value and the maximum grayscale value of the data, and the scale is drawn on the image using the Graphics object. Step S201 of the above scheme performs data normalization calculation to ensure that all data points are in the same numerical range. Significance: Normalization can eliminate the dimensional differences between different data points and make the data comparable; the normalized data is easier to perform grayscale mapping, pseudo-color conversion and other operations, thereby improving processing efficiency; the normalized data can more clearly show the change trend in the image. Step S202 Gray value conversion and image rotation. Pseudo-color conversion can display subtle changes in gray images with more intuitive color differences, which is convenient for observation and analysis; image rotation can adjust the display direction of the image to make it more in line with the needs of actual application scenarios (for example, adjust horizontal data to vertical display); through gray value mapping and pseudo-color conversion, image processing is more flexible and can meet the needs of different scenarios. Step S203 scale drawing. According to the minimum gray value and maximum gray value of the data, the scale range is determined; according to the scale width, minimum depth and maximum depth, the scale interval and the total number of scales are calculated; the Graphics object is used to draw vertical lines on the image as scale lines, and scale labels are marked at appropriate locations. Significance: The scale provides users with a quantitative reference for data, which is convenient for understanding the specific meaning of gray values or depth values in the image; through scale lines and labels, users can intuitively understand the distribution range and change trend of data; the drawing of the scale makes the image more professional while ensuring the accurate communication of data.
[0127] In summary, this embodiment unifies the data range, eliminates the impact of dimensions, simplifies subsequent processing, enhances visual effects, adapts to different needs, and improves the flexibility of image processing; provides data reference, enhances image readability, and improves professionalism and accuracy. This makes image processing and depth scale generation more efficient, intuitive, and professional, providing users with a better data visualization experience.
[0128] Example 6: Figure 7 As shown, based on Example 5, the process of scaling all data points to a range of 0-1 provided in the embodiment of the present invention includes the following steps:
[0129] S2011: Extract the numerical characteristics of each data point from the compressed data matrix, including its original grayscale value and the overall distribution characteristics of the data set; determine the value range of the data by analyzing the minimum and maximum grayscale values of the data points;
[0130] S2012: offset the original grayscale value of each data point, align the starting point of the data to the zero point by subtracting the minimum grayscale value of the data set; scale the offset-adjusted data points using the value range; compress the value range of the data points to between 0 and 1 by dividing the offset data points by the value range, and achieve data normalization;
[0131] S2013: Verify the normalized data points, and the values are in the range of 0 to 1.
[0132] The working principle and beneficial effects of the above technical solution are as follows: the present embodiment first extracts the numerical characteristics of each data point from the compressed data matrix, including its original grayscale value and the overall distribution characteristics of the data set; determines the value range of the data by analyzing the minimum grayscale value and the maximum grayscale value of the data point; secondly, performs offset adjustment on the original grayscale value of each data point, and aligns the starting point of the data to the zero point by subtracting the minimum grayscale value of the data set; scales the offset-adjusted data point using the value range; compresses the numerical range of the data point to between 0 and 1 by dividing the offset data point by the value range, and realizes the normalization of the data; finally, verifies the normalized data point, and the value is within the range of 0 to 1. Step S2011 of the above solution extracts the numerical characteristics of the data point and determines the value range, extracts the original grayscale value of each data point from the data set, and analyzes the distribution characteristics of the entire data set. By calculating the minimum grayscale value and the maximum grayscale value, the value range of the data (i.e., the value range of the data) is determined. Significance: Determining the value range is the basis of normalization. Only when the value range of the data is known can the offset and scaling operations be performed; the accuracy and consistency of data processing are ensured, and the deviation caused by uneven data distribution is avoided. Step S2012 offset adjustment and scaling, by subtracting the minimum gray value of the data set, aligning the starting point of the data to the zero point, eliminating the influence of the minimum value of the data on subsequent calculations; using the value range to scale the offset-adjusted data, the data is compressed to between 0 and 1. Significance: The role of offset adjustment and scaling is to eliminate the dimensional influence of the data, so that data with different characteristics can be compared and analyzed at the same scale. Normalized data is more suitable for machine learning algorithms, especially those algorithms that are sensitive to data scale (such as gradient descent, K nearest neighbor algorithm, etc.). Normalization can also accelerate the convergence speed of the model and improve the stability of the model. Step S2013 verify the normalization results, verify the normalized data, and ensure that the value of each data point is within the range of 0 to 1; if some data points are found to be beyond this range, it means that there may be problems in the normalization process, and the calculation steps need to be rechecked. Significance: The purpose of verifying the normalization results is to ensure the correctness and reliability of data processing; only verified data can be used for modeling and analysis to avoid degradation of model performance or result deviation due to data processing errors.
[0133] In summary, in this embodiment, the data is unified into the range of 0 to 1, eliminating the dimensionality effect of the data and making the data more suitable for processing by machine learning algorithms; normalization is a key step in data preprocessing, which can improve the training efficiency and performance of the model while ensuring the comparability and consistency of the data.
[0134] Example 7: Figure 8As shown, based on Example 5, the process of setting the rotation angle using the RotateTransform method of the Graphics object provided in the embodiment of the present invention includes the following steps:
[0135] S2021: The normalized value is then converted to a grayscale level, which is an integer between 0 and 255; the processed data is assigned to the corresponding position of the image by multiplying the normalized value by 255 and ensuring that the result is between 0 and 255 (through Math.Max(0,Math.Min(1,normalizedValue)));
[0136] S2022: for each pixel in the grayscale image, a corresponding pseudo color is selected according to its grayscale value (R component, because the grayscale image has only R component, and G and B components are the same as R component); the selection of pseudo color is realized by a color mapping function (GetHeatMapColor), and the selected pseudo color is set to the corresponding position in the new color image (colorBitmap);
[0137] S2023: After setting the rotation angle (90 degrees) using the RotateTransform method of the Graphics object, use the DrawImage method of the Graphics object to draw the original image to the new position while applying the rotation transformation.
[0138] The working principle and beneficial effects of the above technical solution are as follows: in this embodiment, the normalized value is first converted into a grayscale level, which is an integer between 0 and 255; by multiplying the normalized value by 255 and ensuring that the result is between 0 and 255 (through Math.Max(0,Math.Min(1,normalizedValue))), the processed data is assigned to the corresponding position of the image; secondly, for each pixel in the grayscale image, a corresponding pseudo color is selected according to its grayscale value (R component, because the grayscale image has only R component, G and B components are the same as R component); the selection of the pseudo color is implemented by a color mapping function (GetHeatMapColor), and the selected pseudo color is set to the corresponding position in the new color image (colorBitmap); finally, after setting the rotation angle (90 degrees) using the RotateTransform method of the Graphics object, the original image is drawn to the new position using the DrawImage method of the Graphics object, and the rotation transformation is applied at the same time. The grayscale conversion of the normalized value in step S2021 of the above scheme provides basic data for pseudo-color rendering. The calculation of the grayscale value ensures that the brightness information of the image can be accurately mapped to the pseudo-color image, thereby providing clear input data for further processing of the image (such as rotation). Step S2022 The pseudo-color rendering of the grayscale image makes the information in the grayscale image more intuitive and easy to understand. By mapping the grayscale value to color, the details in the image or the changes in specific areas can be observed more clearly; for example, in thermal imaging or medical images, pseudo-color rendering can help quickly identify temperature changes or lesion areas. Step S2023 The rotation transformation of the image enables the image to be displayed at different angles, which is very useful in image processing; for example, in image editing, computer vision or graphical interface design, rotating the image can help users better observe or analyze the image content. In addition, the rotation transformation can also be used for image correction, such as adjusting a tilted image to a horizontal direction.
[0139] In summary, this embodiment converts normalized values into grayscale values; converts grayscale images into color images through pseudo-color rendering to enhance visual effects; and changes the display direction of the image through rotation transformation to meet specific display or analysis requirements. Grayscale conversion, pseudo-color rendering and rotation transformation of the image are realized, and finally a processed color image is generated.
[0140] Example 8: Fig. 9 As shown, based on Example 7, the selection of pseudo color provided by the embodiment of the present invention is a process implemented by a color mapping function, comprising the following steps:
[0141] S20221: The calculation of the red component is based on the sine function, using phase shift and grayscale scaling; the output range of the sine function is [-1,1], which is mapped to the [0,1] interval by adding 1 and dividing by 2; the intensity of the nonlinear mapping is adjusted by the exponential parameter, and the red component presents a smooth transition when the grayscale value changes;
[0142] S20222: The calculation of the green component is based on the cosine function, using phase shift and grayscale scaling; the output range of the cosine function is [-1,1], which is mapped to the [0,1] interval by adding 1 and dividing by 2; the exponential parameter is used to adjust the nonlinear mapping intensity of the green component, and the green component presents a smooth transition when the grayscale value changes;
[0143] S20223: The calculation of the blue component is based on the hyperbolic tangent function, which uses the scaling and offset of the grayscale value. The output range of the hyperbolic tangent function is [-1,1], which is mapped to the [0,1] interval by adding 1 and dividing by 2. The exponential parameter is used to adjust the nonlinear mapping intensity of the blue component to ensure that the blue component presents a smooth transition when the grayscale value changes.
[0144] Among them, the calculation of the red component R is:
[0145]
[0146] Calculation of the green component G:
[0147]
[0148] Calculation of blue component B:
[0149]
[0150] Where g represents the input grayscale value, ranging from 0 to 255, is the input parameter of the color mapping function, and represents the grayscale value of a pixel in the grayscale image; π represents the circumference of a circle, which is approximately equal to 3.1415926535 and is used for the calculation of trigonometric functions; (sin(x)), (cos(x)), (tanh(x)) are the sine function, cosine function, and hyperbolic tangent function, respectively, which are used to generate a smooth color transition effect; α, β, and γ represent exponential parameters, which are used to adjust the nonlinear mapping of color components and control the intensity changes of color components; Represents the floor rounding function, which converts the calculation result into an integer to ensure that the RGB value is between 0 and 255; 2 represents the phase shift and scaling parameters, which are used to adjust the phase and amplitude of the trigonometric function, thereby affecting the distribution of color components. Through the above complex color mapping function, the grayscale value can be mapped to the pseudo color. The trigonometric function and exponential parameters in the formula make the color transition smoother and more natural.
[0151] The working principle and beneficial effects of the above technical solution are as follows: in this embodiment, first, the calculation of the red component is based on the sine function, using phase shift and grayscale scaling; the output range of the sine function is [-1, 1], and it is mapped to the [0, 1] interval by adding 1 and dividing by 2; the intensity of the nonlinear mapping is adjusted by the exponential parameter, and the red component presents a smooth transition when the grayscale value changes; secondly, the calculation of the green component is based on the cosine function, using phase shift and grayscale scaling; the output range of the cosine function is [-1, 1], and it is mapped to the [0, 1] interval by adding 1 and dividing by 2; the exponential parameter is used to adjust the nonlinear mapping intensity of the green component, and the green component presents a smooth transition when the grayscale value changes; finally, the calculation of the blue component is based on the hyperbolic tangent function, using grayscale scaling and offset; the output range of the hyperbolic tangent function is [-1, 1], and it is mapped to the [0, 1] interval by adding 1 and dividing by 2; the exponential parameter is used to adjust the nonlinear mapping intensity of the blue component to ensure that the blue component presents a smooth transition when the grayscale value changes. In step S20221 of the above scheme, the calculation of the red component is carried out through the periodic change of the sine function, and the red component presents rich color levels in the image, which enhances the visual expression of the image; different gray values are mapped to different red intensities, which helps to highlight certain specific areas or details in the image; the adjustment of the exponential parameter ensures the smooth transition of the red component when the gray value changes, avoids color mutation, and makes the image more natural. In step S20222, the calculation of the green component is carried out. The introduction of the green component complements the red component, enriches the color expression of the image, and enhances the color balance of the image; through the periodic change of the cosine function, the green component can better reflect the detail information in the image, especially in the area where the gray value changes greatly; similar to the red component, the green component also achieves a smooth transition through the exponential parameter, making the image color change more natural. Step S20223 calculates the blue component. The introduction of the blue component further enriches the color expression of the image, especially in the low gray value area, the blue component can provide more color changes; the characteristics of the hyperbolic tangent function make the blue component more obvious in the high contrast area, which helps to highlight the highlights or shadows in the image; the blue component also achieves a smooth transition through the exponential parameter to ensure the continuity of the image color changes.
[0152] In summary, this embodiment converts a grayscale image into a color image by calculating the red, green and blue components and using pseudo color processing technology, which not only enhances the visual effect of the image, but also highlights the key information in the image through color changes. The calculation of each color component is based on a different mathematical function, and the intensity of the nonlinear mapping is adjusted through an exponential parameter to ensure a smooth transition of color changes.
[0153] Example 9: Fig.10As shown, based on Example 5, the process of drawing a scale on an image using a Graphics object provided in an embodiment of the present invention includes the following steps:
[0154] S2031: input the minimum grayscale value, the maximum grayscale value, the width of the scale, the height of the scale and the scale interval; determine the scale range of the scale according to the minimum grayscale value and the maximum grayscale value; calculate the scale interval according to the height of the scale and the scale range; calculate the total number of scales according to the scale range and the scale interval; generate the scale label value according to the scale interval and the scale range;
[0155] S2032: Use the Graphics object to create a new image or canvas for drawing the scale; draw vertical lines to represent the tick marks according to the height and tick interval of the scale; use the DrawLine method of the Graphics object to draw the tick marks; draw tick labels next to each tick mark, and use the DrawString method of the Graphics object to draw the tick labels, with the label content being the tick label value (tickLabels); draw unit identifiers (such as "grayscale value" or "depth value") at the top or bottom of the scale; use the DrawString method of the Graphics object to draw the unit identifiers;
[0156] S2033: Use the RotateTransform method of the Graphics object to set the rotation angle to 90 degrees; use the DrawImage method of the Graphics object to draw the rotated scale to the target position; save the drawn scale image as a file or display it on the interface.
[0157] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, the minimum grayscale value, the maximum grayscale value, the width of the scale, the height of the scale and the scale interval are first input; the scale range of the scale is determined according to the minimum grayscale value and the maximum grayscale value; the scale interval is calculated according to the height and scale range of the scale; the total number of scales is calculated according to the scale range and the scale interval; the scale label value is generated according to the scale interval and the scale range; secondly, a new image or canvas is created using the Graphics object for drawing the scale; vertical lines are drawn according to the height and scale interval of the scale to represent the scale lines; the scale lines are drawn using the DrawLine method of the Graphics object; at each scale line Draw a tick label next to the scale, use the DrawString method of the Graphics object to draw the tick label, and the label content is the tick label value (tickLabels); draw a unit mark (such as "gray value" or "depth value") at the top or bottom of the scale; use the DrawString method of the Graphics object to draw the unit mark; finally, use the RotateTransform method of the Graphics object to set the rotation angle to 90 degrees; use the DrawImage method of the Graphics object to draw the rotated scale to the target position; save the drawn scale image as a file or display it on the interface. Step S2031 of the above scheme determines the scale range of the scale and generates the tick label value. By inputting the minimum gray value, the maximum gray value, the width, height and scale interval of the scale, the scale range can be determined; according to the height and scale range of the scale, calculate the appropriate scale interval to ensure that the scale lines are evenly distributed and easy to read; according to the scale range and scale interval, generate the tick label value, and the label value will be used to mark the specific value on the scale. Significance: By calculating the scale interval and generating the scale label value, ensure that the scale scale accurately reflects the grayscale or depth distribution in the image; reasonable scale interval and label value make the scale easy to read, and the user can quickly understand the numerical distribution in the image. Step S2032 draws the scale, uses the Graphics object to create a new image or canvas for drawing the scale; according to the height and scale interval of the scale, draw vertical lines to represent the scale lines, using the DrawLine method to achieve; draw scale labels next to each scale line, and use the DrawString method to draw the label content; draw unit identifiers at the top or bottom of the scale, such as "grayscale value" or "depth value", using the DrawString method to achieve. Significance: By drawing scale lines and labels, the scale can intuitively display the numerical distribution in the image; the addition of unit identifiers makes the scale information more complete, and the user can clearly know the physical quantity represented by the scale.Step S2033 rotates the scale bar and draws it to the target position. Use the RotateTransform method to set the rotation angle to 90 degrees so that the scale bar can be displayed in a vertical direction. Use the DrawImage method to draw the rotated scale bar to the target position to ensure that the scale bar is aligned with the image. Save the drawn scale bar image as a file or display it on the interface for easy viewing and use by users. Significance: By rotating the scale bar, the display direction of the scale bar can be adjusted as needed to adapt to different image layouts. Draw the scale bar to the target position and save or display it so that the scale bar can be closely integrated with the image, which is convenient for users to conduct subsequent analysis.
[0158] In summary, this embodiment can create an accurate, readable and beautiful scale to help users better understand the grayscale or depth distribution in an image, and ensure the functionality and practicality of the scale.
[0159] Example 10: Fig.11 As shown, based on Example 9, the process of drawing scale lines, drawing scale labels, and drawing unit identifiers provided in the embodiment of the present invention includes the following steps:
[0160] S20321: Calculate the vertical position of each tick mark based on the height and tick interval of the scale; Use the Graphics.DrawLine method to draw the vertical line, and choose the color of the tick mark to contrast with the main color of the tomographic image; The thickness of the tick mark is dynamically adjusted according to the width of the scale;
[0161] S20322: The scale label is used to mark the grayscale value or depth value corresponding to each scale line. A certain distance is left on the right or left side of each scale line for drawing the label. The vertical position of the label is aligned with the scale line, and the horizontal position is dynamically adjusted according to the scale width. The scale label value is generated according to the scale range and scale interval. The labelValue is formatted as a string and the decimal places are retained. The label is drawn using the Graphics.DrawString method. The font is a sans serif font, and the label color is consistent with the scale line color.
[0162] S20323: The unit label is used to indicate the unit of the scale bar. It is placed at the top or bottom of the scale bar. The specific position is adjusted according to the image layout. If the scale bar is long, place the unit label in the middle. Depending on the specific application of laser tomography, the unit label is "grayscale value", "depth value (mm)" or other related units. Use the Graphics.DrawString method to draw the unit label. The font is larger than the scale label and the color is consistent with the scale label. Use a grayscale gradient in the background of the scale bar, from the minimum grayscale value to the maximum grayscale value, which is consistent with the grayscale distribution of the tomography image.
[0163] The working principle and beneficial effects of the above technical solution are as follows: This embodiment first calculates the vertical position of each scale line according to the height and scale interval of the scale; uses the Graphics.DrawLine method to draw vertical lines, and the color of the scale lines is selected to contrast with the main color of the tomographic image; the thickness of the scale lines is dynamically adjusted according to the width of the scale; secondly, the scale labels are used to mark the grayscale value or depth value corresponding to each scale line, and a certain spacing is left on the right or left side of each scale line for drawing labels; the vertical position of the label is aligned with the scale line, and the horizontal position is dynamically adjusted according to the scale width; the scale label value is generated according to the scale range and scale interval; the labelValue is formatted as a string, retaining decimals digits; use the Graphics.DrawString method to draw the label, choose a sans serif font, and the label color should be consistent with the scale line color; finally, the unit logo is used to indicate the unit of the scale bar and is placed at the top or bottom of the scale bar. The specific position is adjusted according to the image layout; if the scale bar is long, place the unit logo in the middle; according to the specific application of laser tomography, the unit logo is "grayscale value", "depth value (mm)" or other related units; use the Graphics.DrawString method to draw the unit logo, with a font larger than the scale label and the color consistent with the scale label; use a grayscale gradient in the background of the scale bar, from the minimum grayscale value to the maximum grayscale value, which is consistent with the grayscale distribution of the tomography image. Step S20321 of the above scheme draws scale lines*, and accurately calculates the vertical position of each scale line according to the height and scale interval of the scale, ensuring that the scale lines correspond to the grayscale or depth value in the image one by one; the calculation method ensures that the scale scale is evenly distributed and can accurately reflect the numerical changes in the image; the color of the scale line contrasts with the main color of the tomographic image (such as white or light gray), so that the scale line is clearly visible in the image; the design avoids confusion between the scale line and the image content, and improves the readability of the scale; the thickness of the scale line is dynamically adjusted according to the width of the scale, the main scale line is thicker, and the secondary scale line is thinner; the dynamic adjustment enables the scale to maintain a good visual effect in images of different resolutions or sizes. The significance achieved: the position and distribution of the scale line strictly correspond to the numerical changes in the image, ensuring that the user can accurately read the grayscale or depth value; through color contrast and dynamic thickness adjustment, the scale line is still clearly visible in complex tomographic images; the dynamic adjustment design enables the scale to adapt to images of different sizes and resolutions, improving versatility.Step S20322 draws the scale labels, leaving spacing on the right or left side of each scale mark to ensure that the labels do not overlap with the scale marks; the vertical position of the labels is aligned with the scale marks, and the horizontal position is dynamically adjusted according to the scale width to ensure that the labels are neatly laid out; the scale label values are generated according to the scale range and scale interval, and formatted as strings (such as retaining two decimal places); the formatting method ensures the accuracy and consistency of the label content; a sans-serif font (such as Arial or Helvetica) is used to ensure that the labels are clear and easy to read in high-resolution images; the label color is consistent with the scale mark color to maintain the visual unity of the scale. The significance achieved: the label content is clear and accurate, and the user can quickly understand the value corresponding to each scale mark; the font and color of the label are consistent with the scale mark to avoid visual confusion; the position and layout of the label are carefully designed, making the scale beautiful and practical as a whole. Step S20323 draws the unit logo, which is placed at the top, bottom or middle of the scale, and the specific position is dynamically adjusted according to the image layout; the flexibility ensures that the unit logo will not block important image content; according to the specific application of laser tomography, the unit logo can be "grayscale value", "depth value (mm)" or other related units; this design makes the unit logo closely related to the image content and improves the professionalism of the scale; the font of the unit logo is slightly larger than the scale label, and the color is consistent with the scale label to ensure that the unit logo is eye-catching but not abrupt; this design makes the unit logo occupy an appropriate visual weight in the scale; a grayscale gradient is used in the background of the scale, from the minimum grayscale value to the maximum grayscale value, which is consistent with the grayscale distribution of the tomography image; this design makes the scale and image content visually integrated, improving the overall coordination. Significance achieved: The unit logo is closely related to the image content, reflecting the professionalism and pertinence of the scale; the font and color design of the unit logo makes it clearly visible in the scale, ensuring that users can quickly understand the unit of the scale; the gradient background design makes the scale and image content more visually coordinated, improving the overall aesthetics.
[0164] In summary, the precise drawing of the scale lines and labels in this embodiment ensures that the user can accurately read the grayscale or depth value in the image; the design of the labels and unit logos makes the scale content clear and easy to read, and consistent with the image content; the design of the gradient background and dynamic adjustment makes the scale and the image content visually integrated, improving the overall aesthetics; the design of the scale is closely integrated with the application scenario of laser tomography, reflecting professionalism and practicality. Through the above design, the scale is not only a functional tool, but also an indispensable visual auxiliary element in image analysis.
[0165] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention belong to the scope of equivalent technologies of the present invention, the present invention is also intended to include these modifications and variations.
Claims
1. A method for splicing deep scan information based on OCT, characterized in that: The following steps are involved: Receive the raw data of laser tomography and input the floating point data matrix; divide each row of data into a group, extract the maximum value in each group, and form a compressed data matrix; Use the ProcessedResults class to manage the processed data; Normalize the values of the compressed data matrix to the range of 0-255; create an 8-bit grayscale image, support both grayscale and pseudo-color display modes, and rotate the grayscale image; add a depth scale to the right of the grayscale image, and draw tick marks and unit logos on the scale; Save the grayscale image with added scale, select the save path and file name; it also supports capturing and handling abnormal situations during file saving, and provides clear error prompts.
2. The method for splicing deep scan information based on OCT according to claim 1, characterized in that: The process of managing processed data using the ProcessedResults class includes the following steps: The raw data of each frame of laser tomography is a 1024×1024 floating point matrix, which represents 1024 rows of data. Each row contains 1024 pixels. The 1024 rows of data are divided into 16 groups, each containing 64 rows. For each group of 64 rows of data, process them column by column, and for each column, extract the maximum value from the 64 rows; store each group of 1024 extracted maximum values as a 1×1024 row vector; stack the 16 groups of extracted row vectors in sequence to form a 16×1024 compressed data matrix; In the ProcessGroup method of the DataProcessor class, a two-dimensional array result is defined to store the final compressed data matrix. The size of result is RESULT_ROWS rows and ROW_LENGTH columns. The processing tasks of 16 groups of data are assigned to multiple threads or computing units. Each thread independently processes a group of 64 rows of data, extracts the maximum value and fills it into the corresponding row of result.
3. The method for splicing deep scan information based on OCT according to claim 2, characterized in that: The process of forming a 16×1024 compressed data matrix includes the following steps: 1024 rows of data are divided into 16 groups, each with 64 rows, using a dynamic grouping strategy; the group size is dynamically adjusted according to the local characteristics of the laser tomography data; the clustering strategy is used to pre-analyze the laser tomography data and automatically determine the grouping strategy; Extract multiple eigenvalues of each column, including the maximum, minimum, average value of laser reflection intensity and variance of scattering coefficient; generate a multidimensional eigenvector by calculating the laser reflection intensity and scattering coefficient; According to the local characteristics of laser tomography data, the compression weight is dynamically adjusted by calculating the laser reflection intensity and scattering coefficient.
4. The method for splicing deep scan information based on OCT according to claim 2, characterized in that: The process of assigning the processing tasks of 16 sets of data to multiple threads or computing units includes the following steps: Each thread independently processes a set of 64 rows of data, calculates the gradient of the laser reflection intensity and the gradient of the scattering coefficient, and multiplies the two gradients to calculate the gradient product of each set of data; The gradient products of each group of data need to be summed, and the gradient products of all groups of data are summed, and the sum of the gradient products of each group of data is divided by the sum of the total gradient products; The storage parameters are introduced to adjust the range of the storage hierarchy, and each group of data is allocated to a different storage hierarchy according to the calculated storage hierarchy.
5. The method for splicing deep scan information based on OCT according to claim 1, characterized in that: The process of drawing tick marks and unit labels on a scale bar includes the following steps: Normalize each data point in the compressed data matrix and scale all data points to the range of 0-1; Convert the grayscale value of the normalized data point to a grayscale level, assign the processed data to the corresponding position of the grayscale image, and convert the grayscale image to a grayscale image used for pseudo-color image; after setting the rotation angle using the RotateTransform method of the Graphics object, use the DrawImage of the Graphics object to draw the original image to the new position and apply the rotation transformation; The scale range of the scale bar is determined according to the minimum and maximum grayscale values of the data, and the scale bar is drawn on the image using the Graphics object.
6. The method for splicing deep scan information based on OCT according to claim 5, characterized in that: The process of scaling all data points to the range of 0-1 consists of the following steps: Extract the numerical characteristics of each data point from the compressed data matrix, including its original grayscale value and the overall distribution characteristics of the data set; By analyzing the minimum grayscale value and the maximum grayscale value of the data points, the value range of the data is determined; The original grayscale value of each data point is offset adjusted to align the starting point of the data to the zero point by subtracting the minimum grayscale value of the data set; Scale the offset-adjusted data points using the range; By dividing the offset data points by the value range, the value range of the data points is compressed to between 0 and 1 to achieve data normalization; The normalized data points are verified to be in the range of 0 to 1.
7. The method for splicing deep scan information based on OCT according to claim 5, characterized in that: The process of setting the rotation angle using the RotateTransform method of the Graphics object includes the following steps: The normalized value is then converted to a grayscale level, which is an integer between 0 and 255; the processed data is assigned to the corresponding position of the image by multiplying the normalized value by 255 and ensuring that the result is between 0 and 255; For each pixel in the grayscale image, a corresponding pseudo color is selected according to its grayscale value; the selection of the pseudo color is realized by a color mapping function, and the selected pseudo color is set to the corresponding position in the new color image; After setting the rotation angle using the Graphics object's RotateTransform method, use the Graphics object's DrawImage method to draw the original image to the new position while applying the rotation transformation.
8. The method for splicing deep scan information based on OCT according to claim 5, characterized in that: The process of drawing a scale bar on an image using the Graphics object consists of the following steps: Input the minimum grayscale value, maximum grayscale value, scale width, scale height and scale interval; determine the scale range of the scale according to the minimum grayscale value and maximum grayscale value; calculate the scale interval according to the scale height and scale range; calculate the total number of scales according to the scale range and scale interval; generate scale label values according to the scale interval and scale range; Use the Graphics object to create a new image or canvas for drawing the scale; Draw vertical lines to represent the scale marks according to the scale's height and tick interval; Use the DrawLine method of the Graphics object to draw the tick marks; Draw tick labels next to each tick mark, and use the DrawString method of the Graphics object to draw the tick labels, with the label content being the tick label value; Draw unit identifiers at the top or bottom of the scale; Use the DrawString method of the Graphics object to draw the unit logo; Use the RotateTransform method of the Graphics object to set the rotation angle to 90 degrees; use the DrawImage method of the Graphics object to draw the rotated scale to the target position; save the drawn scale image as a file or display it on the interface.
9. The method for splicing deep scan information based on OCT according to claim 8, characterized in that: The process of drawing tick marks, tick labels, and unit identifiers includes the following steps: According to the height and scale interval of the scale bar, the vertical position of each scale mark is calculated; the vertical line is drawn using the Graphics.DrawLine method, and the color of the scale mark is selected to contrast with the main color of the tomographic image; the thickness of the scale mark is dynamically adjusted according to the width of the scale bar; The scale label is used to mark the grayscale value or depth value corresponding to each scale line. Leave a space on the right or left side of each scale line for drawing the label. The vertical position of the label is aligned with the scale line, and the horizontal position is dynamically adjusted according to the scale width. The scale label value is generated according to the scale range and scale interval. The labelValue is formatted as a string and the decimal places are retained. The label is drawn using the Graphics.DrawString method. The font is a sans-serif font, and the label color is consistent with the scale line color. The unit identifier is used to indicate the unit of the scale bar and is placed at the top or bottom of the scale bar. The specific position is adjusted according to the image layout. If the scale bar is long, place the unit identifier in the middle. Depending on the specific application of laser tomography, the unit identifier is a grayscale value or a depth value.
10. The method for splicing deep scan information based on OCT according to claim 9, characterized in that: Use the Graphics.DrawString method to draw the unit logo, with a font larger than the scale label and the same color as the scale label; use a grayscale gradient in the background of the scale bar, from the minimum grayscale value to the maximum grayscale value, which is consistent with the grayscale distribution of the tomographic image.
Citation Information
Patent Citations
Independent sequential multi-feature fusion-based scanning laser welding penetration prediction method
CN118587205A
Cover plate assembly and battery
CN118763366A
Lithium battery production process and system without helium detection process
CN118888939A
A method for quickly and automatically extracting a rectangular scanning part from a digital photograph
CN109359652A
Medical image adjusting method and digital pathological section browsing system
CN110163820A