Multi-object dependent constraint streaming stitch compression method and device and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]本发明实施例提供了一种面向多焦层玻片扫描的多对象依赖约束流式拼接压缩方法、装置及介质,针对现有技术在多焦层玻片扫描过程中,无法在不长期保留大量未压缩图像数据的前提下,同时满足相邻行、相邻列以及不同焦层之间拼接、补偿和压缩所需数据的准确回放与依赖顺序控制,导致内存占用高或数据依赖紊乱等问题
1.本发明将采集后的视野图像块尽早编码为整图块中间压缩数据和过渡条中间压缩数据,系统无需长期保留多行、多列、多焦层的未压缩图像数据,仅在最终拼接压缩时按需解码少量图像块,显著降低了流式处理阶段的内存占用。
Smart Images

Figure CN122550352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of digital pathological slide scanning, microscopic image processing, and large image streaming compression storage, and in particular to a multi-object-dependent constraint streaming stitching compression method, apparatus, and medium for multi-focal-layer slide scanning. Background Technology
[0002] Digital pathology slide scanning equipment typically divides the slide into multiple field-of-view image blocks and acquires them sequentially. These blocks are then stitched together, compressed, and saved as a digital slide file. In multi-focal-slice scanning scenarios, images from multiple focal layers need to be acquired at the same spatial location, requiring the processing pipeline to simultaneously handle data in the row, column, and focal layer directions. Each field-of-view image block typically includes a cropping boundary, a stitching transition region, and an effective image area. X-direction transition processing is required between adjacent columns, Y-direction transition processing between adjacent rows, and inter-slice offset compensation is also necessary between different focal layers.
[0003] In existing technologies, one approach is to directly cache all acquired raw image blocks in memory, and then perform stitching and compression uniformly once all row, column, and focal layer data are ready. This approach suffers from memory consumption that increases linearly with the data volume when the number of rows, columns, and focal layers is large, easily leading to resource constraints in high-magnification, large-field-of-view, and multi-focal-layer scanning scenarios. Another approach is to compress and save each image block independently immediately after acquisition. However, during subsequent Y-axis stitching, the dependency between the previous row's complete image block and the current row's transition area has been severed, making it difficult to replay the required data at low cost. Furthermore, the lack of a unified dependency state control mechanism makes it prone to concurrency errors such as data being read before it is ready or cache being reused before it is released. Summary of the Invention
[0004] This invention provides a multi-object dependency-constrained streaming stitching and compression method, apparatus, and medium for multifocal layer slide scanning. It addresses the problems of high memory usage or disordered data dependencies in existing technologies during multifocal layer slide scanning, which cannot simultaneously meet the requirements for accurate playback and dependency order control of data required for stitching, compensation, and compression between adjacent rows, adjacent columns, and different focal layers without retaining a large amount of uncompressed image data for a long time.
[0005] The core technology of this invention is to construct a multi-object dependency relationship that includes cross-row, cross-column, and cross-focal layer dependencies, so that multiple focal layers in the same physical scan row share a row-level cache slot and register intermediate compressed data and completion status according to the focal layer index. The transition bar result obtained by Y-axis splicing is used as an intermediate state cache for subsequent cross-processing cycle backfilling. The cache slot is only released after all focal layers and columns have completed the final compression, thereby realizing on-demand decoding, dependency constraints, and orderly release of cache resources in streaming processing.
[0006] In a first aspect, the present invention provides a multi-object dependency-constrained streaming concatenation compression method, the method comprising the following steps:
[0007] Construct multi-object dependencies, which include at least cross-row dependencies, cross-column dependencies, and cross-focal layer dependencies, to constrain the execution order among the previous row whole image block, the current row transition bar, the transition bar backfill cache, the adjacent column decoding status, the non-base focal layer inter-layer offset data, and the row-level cache slot release status; Assign a row-level buffer slot to the current scan line. Multiple focal layers of the same physical scan line share the same row-level buffer slot. However, within the row-level buffer slot, register the corresponding whole block intermediate compressed data, transition bar intermediate compressed data, inter-layer offset data, and completion status according to the focal layer index. Get the field image blocks of each column under the current focal layer of the current scan row, encode each field image block into compressed data of the whole image block, and encode the transition area used for vertical stitching into compressed data of the transition strip. Record the corresponding storage location and write completion status through image block metadata. Based on multi-object dependencies, the previous row of whole image blocks and the current row of transition bars are decoded as needed when the dependency conditions are met. Combined with inter-layer offset data and transition bar backfilling cache, cross-row splicing in the Y direction is performed, and the spliced transition bar result is saved as an intermediate state cache for subsequent cross-processing cycle backfilling. After the horizontal transition dependency between the current column and the adjacent column is satisfied, perform cross-column splicing in the X direction and then perform final compression and saving. Once all focal layers and all columns of the current scan row have been finally compressed and saved, the corresponding row-level cache slots are released.
[0008] Furthermore, the spliced transition bar results are saved as intermediate state caches for subsequent backfilling across processing cycles. This includes: after the current row participates in the Y-direction splicing of the previous row, the generated transition bar results are temporarily stored in the transition bar backfilling cache of the current row, and the corresponding transition bar backfilling area is recorded; when the current row is the previous row to be finally compressed in the next processing cycle, the transition bar results are backfilled to the corresponding area of the current row's entire image block according to the transition bar backfilling area.
[0009] Furthermore, allocating row-level buffer slots for the current scan line also includes: when the current focal layer is the reference focal layer, selecting a writable buffer slot from the row-level buffer slots and marking it as non-reusable; when the current focal layer is a non-reference focal layer, using the row-level buffer slot associated with the corresponding current scan line; the decoding, backfilling, or splicing steps for non-reference focal layers are configured to wait for the corresponding inter-layer offset data to be generated before execution.
[0010] Furthermore, the conditions for releasing the corresponding row-level cache slot are: all column fields of view of the scan row have been finally compressed and saved, all focal layers have been finally compressed and saved, the backfill status of the transition strips related to the scan row has been completed, and the interlayer offset status of the non-reference focal layers has been completed. After the above conditions are met, the write offset and status flag of the row-level cache slot are reset, and the row-level cache slot is marked as reusable. When the scan row number is greater than the number of row-level cache slots, the row-level cache slots are reused in a cyclic manner according to the row number. Before reuse, it is checked whether the scan row carried by the cache slot in the previous round has been finally compressed and saved.
[0011] Furthermore, the image block metadata includes at least the column number, row number, focal layer number, total image block compressed size, total image block storage offset, transition bar compressed size, transition bar storage offset, total image block write completion flag, transition bar write completion flag, and total image block decoding completion flag. The intermediate compressed data of the total image block and the intermediate compressed data of the transition bar are stored in the intermediate compressed state dispatch medium, which includes a memory buffer or a disk temporary file. The image block metadata uniformly describes the storage location and completion status in both media.
[0012] Furthermore, the on-demand decoding of the previous row's entire image block and the current row's transition bar includes: obtaining the entire image block decoding cache and the transition bar decoding cache in pairs from the single image block decoding cache pool; decoding the corresponding intermediate compressed data of the entire image block and the intermediate compressed data of the transition bar according to the image block metadata's write completion flag; releasing the transition bar decoding cache after Y-direction stitching is completed; and releasing the entire image block decoding cache after final compression is completed. Multi-object dependencies are controlled through dependency status flags, which include at least the entire image block write completion flag, the transition bar write completion flag, the entire image block decoding completion flag, the inter-layer offset completion flag, and the adjacent column decoding completion flag. Each processing step determines whether the execution conditions are met by checking the corresponding dependency status flags.
[0013] Furthermore, it also includes special processing for the first and last lines: if the current line is the first line, the transition bar is written to the completion flag and directly set to completion, without performing Y-direction cross-line splicing; if the current line is the last line, without waiting for the transition bar of the next line, the last line of the entire image block is directly decoded, its existing transition bar is backfilled into the cache, and horizontal splicing and final compression and saving are performed.
[0014] In a second aspect, the present invention provides a multi-object-dependent constrained streaming stitching and compression apparatus for multi-focal-layer slide scanning, comprising: The dependency building module is used to build multi-object dependencies, which include at least cross-row dependencies, cross-column dependencies, and cross-focal layer dependencies. The cache management module is used to allocate row-level cache slots for the current scan line. Multiple focal layers of the same physical scan line share the same row-level cache slot, and register the corresponding whole block intermediate compressed data, transition bar intermediate compressed data, inter-layer offset data and completion status according to the focal layer index. The intermediate compression module is used to encode each view image block into full-block intermediate compressed data and transition bar intermediate compressed data, and records the corresponding storage location and completion status through image block metadata; The stitching and reconstruction module is used to decode the previous row of whole image blocks and the current row of transition bars as needed based on multi-object dependencies when the dependency conditions are met. It combines inter-layer offset data and transition bar backfill cache to perform Y-direction cross-row stitching and saves the stitched transition bar results as intermediate state cache for subsequent cross-processing cycle backfilling. It also performs X-direction cross-column stitching after the horizontal transition dependency between the current column and the adjacent column is met. The final compression module is used to perform final compression and save the visual field image blocks that meet the stitching conditions; The resource release module is used to release the corresponding row-level cache slots after all focal layers and all columns of the current scan row have been finally compressed and saved.
[0015] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the above-described multi-object dependency constraint streaming splicing compression method.
[0016] Fourthly, the present invention provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the multi-object dependency constraint streaming splicing compression method described above.
[0017] The main contributions and innovations of this invention are as follows: 1. This invention encodes the acquired field-of-view image blocks into intermediate compressed data of the whole image block and intermediate compressed data of the transition bar as early as possible. The system does not need to retain uncompressed image data of multiple rows, columns and focal layers for a long time. Only a small number of image blocks are decoded as needed during the final stitching and compression, which significantly reduces the memory usage in the streaming processing stage.
[0018] 2. By recording the compressed data size and storage offset through image block metadata, and setting multi-level dependency status flags such as write completion flag and decoding completion flag, even if the original image cache has been released, the system can still accurately read and replay the required data according to the dependency relationship in the subsequent processing stage, satisfying the dependency requirements of Y-direction stitching, X-direction stitching and inter-layer compensation.
[0019] 3. By saving the transition bar results generated by stitching in the Y direction as a transition bar backfill cache and backfilling it to the whole image block in the next processing cycle, the system does not need to retain the complete uncompressed image of the current row, nor does it need to recalculate the formed transition bar results when processing the next row, thus reducing the amount of data transferred across rows and the overhead of repeated processing.
[0020] 4. Through the joint constraints of multiple object dependencies and dependency state flags, the read and write order between processing threads is explicitly controlled, avoiding concurrent read and write errors such as data being read before it is written or cache being reused before it is released, thus improving the stability and reliability of multi-threaded pipeline processing.
[0021] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of a multi-object dependency-constrained streaming splicing and compression method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a multi-threaded pipeline according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0023] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0024] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0025] Example 1 This embodiment provides a multi-object-dependent constrained streaming stitching and compression method for multi-focal-layer slide scanning. The following is combined with... Figure 1 The overall flowchart shown below provides a detailed explanation of the method.
[0026] like Figure 1 As shown, this method includes the following steps: Step S1: Build multi-object dependencies and initialize resources.
[0027] The system initializes intermediate compression processing resources based on the number of columns, focal layers, single tile size, cropping height, compression quality, and concurrency of the scanning task. Specifically, this includes: 1. Establish multi-object dependencies. These dependencies include at least cross-row, cross-column, and cross-focus layer dependencies, used to constrain the execution order among the previous row's entire image block, the current row's transition bar, the transition bar backfill cache, the decoding status of the left adjacent column, the inter-layer offset data of non-reference focus layers, and the row-level cache slot release status. Multi-object dependencies are controlled by dependency status flags, which include at least the entire image block write completion flag, the transition bar write completion flag, the entire image block decoding completion flag, the inter-layer offset completion flag, and the adjacent column decoding completion flag. Each processing step checks the corresponding dependency status flags to determine if the execution conditions are met; if not, it enters a waiting state and continuously monitors for cancellation or abnormal signals.
[0028] 2. Establish at least two row-level cache slots. One row-level cache slot is used for the current row or the row to be written, and the other row-level cache slot is used for the previous row that still needs to participate in the final compression. Row-level cache slots can also be expanded to three or more to support deeper pipelined processing.
[0029] 3. Configure an intermediate compressed state dispatch medium for each row-level cache slot. When using memory, the dispatch medium is a contiguous memory buffer, and intermediate compressed data is written to the corresponding memory address by maintaining write offsets. When using disk, the dispatch medium is a temporary disk file, and intermediate compressed data is written to the temporary file by maintaining file write offsets. Both methods use the same set of image block metadata for subsequent decoding and stitching stages.
[0030] 4. Establish an image block metadata matrix. This matrix, indexed at least by row-level buffer slot number, column number, and focal layer number, stores the metadata of the corresponding field-of-view image blocks. Different focal layers within the same physical scan row share the same row-level buffer slot number, but are distinguished by different focal layer numbers to identify complete image blocks, transition bars, and completion states.
[0031] 5. Establish an inter-layer offset data matrix. This matrix, indexed at least by row-level buffer slot number, column number, and focal layer number, is used to store the offset results of non-reference focal layers and serves as a dependency for subsequent decoding, backfilling, X / Y direction stitching, and final compression.
[0032] 6. Establish a transition bar backfill area matrix. This matrix should be indexed at least by row-level cache slot number, column number, and focal layer number to record which area of the entire map block the data in the transition bar backfill cache should be backfilled to.
[0033] 7. Establish a single tile decoding cache pool. The single tile decoding cache pool contains paired whole tile decoding caches and transition bar decoding caches. These can be occupied and released in pairs to ensure that a certain view has both the previous row of whole tiles and the current row of transition bars when performing Y-direction stitching.
[0034] 8. Mark all row-level cache slots as writable and all single-tile decoding caches as available.
[0035] Step S2: Obtain the field-of-view image patch.
[0036] The system acquires the field-of-view image blocks for each column under the current scan row and focal layer. For the same physical scan row, multiple focal layers can be processed sequentially according to their focal layer order. Each field-of-view image block contains the effective image area and the edge cropping area used for stitching.
[0037] Step S3: Allocate row-level cache slots.
[0038] The system selects a row-level cache slot for the currently scanned row. Specifically, this includes: 1. When the current focal layer is the base focal layer, the system selects a writable cache slot from the row-level cache slots and marks it as non-reusable. This cache slot must not be overwritten by the next row until all focal layers in this row and their subsequent dependencies have been compressed.
[0039] 2. When the current focal layer is not the reference focal layer, the system uses the row-level buffer slot corresponding to that scan line, ensuring that intermediate compressed data, transition data, inter-layer offset data, and completion status of different focal layers within the same physical scan line are stored under different focal layer indices within the same row-level buffer slot. Non-reference focal layers must not occupy new row-level buffer slots; otherwise, it will disrupt the consistency of release conditions between different focal layers within the same physical scan line. Decoding, backfilling, or stitching steps for non-reference focal layers are configured to wait for the corresponding inter-layer offset data to be generated before execution.
[0040] 3. If no writable row-level cache slot is available, wait for the previous row to finish compressing and release the corresponding cache slot. During the waiting period, continuously check for cancellation, exception, or timeout status.
[0041] 4. When the scan row number is greater than the number of row-level cache slots, the row-level cache slots can be reused in a cyclic manner by taking the row number as the modulo, but before reuse, the scan row carried by the cache slot in the previous round must have been finally compressed and saved.
[0042] Step S4: Intermediate compression and metadata registration.
[0043] The system performs intermediate compression encoding in parallel for each column of the current row and the current focal layer, specifically including: 1. Locate the starting address of a column of view image blocks from the uncompressed image buffer of the current row.
[0044] 2. Perform compression encoding on the complete image region of the field of view image patch to obtain intermediate compressed data of the entire patch. Intermediate compressed data of the entire patch refers to the temporary data obtained after encoding the complete image region of a field of view image patch using an intra-frame compression format. The intra-frame compression format can be the Joint Image Experts Group compression format, i.e., JPEG format, or lossless compression, near-lossless compression, or other compression formats that support independent playback of image patches.
[0045] 3. If the current row is not the first row, a transition region for Y-direction stitching is extracted from the image patch of that field of view. This transition region is then compressed to obtain the compressed data in the middle of the transition strip. The height of this transition region can be determined based on the cropping height or the stitching search height, for example, twice the cropping height.
[0046] 4. If the current line is the first line, since there is no previous line to join with it in the Y direction, the transition bar can be written to the completion flag and set directly to completion.
[0047] 5. The compression encoding quality can be the same as the final saved quality, or it can be set to higher quality or lossless compression depending on the purpose of temporary caching, so as to reduce the impact of intermediate states on splicing accuracy.
[0048] Subsequently, the system writes the intermediate compressed data of the entire image patch and the intermediate compressed data of the transition bar into the dispatch medium of the corresponding row-level cache slot, and generates or updates the image patch metadata. The image patch metadata is a descriptive object corresponding to a field-of-view image patch, and includes at least the column number, row number, focal layer number, entire image patch compressed size, entire image patch storage offset, transition bar compressed size, transition bar storage offset, entire image patch write completion flag, transition bar write completion flag, and entire image patch decoding completion flag.
[0049] When the dispatch medium is a memory buffer: (a) Read the current full map block write offset and write the compressed data in the middle of the full map block to the memory address corresponding to the offset.
[0050] (b) Before writing, check whether the sum of the current write offset and the compressed data size exceeds the capacity of the entire map block buffer. If it does, record an error and prevent further writing.
[0051] (c) After successful writing, record the compressed size of the entire image block, the storage offset of the entire image block and the corresponding memory address in the image block metadata, and set the entire image block writing completion flag.
[0052] (d) Perform the same processing on the intermediate compressed data of the transition bar using an independent transition bar write offset and transition bar buffer, and set the transition bar write completion flag.
[0053] When the dispatch medium is a temporary disk file: (a) Create a temporary file for the entire block and a temporary file for the transition bar for each row-level cache slot.
[0054] (b) Read the current full-map block file write offset and move the file pointer to that offset position.
[0055] (c) Write the intermediate compressed data of the entire image patch to a temporary file and record the compressed size and storage offset of the entire image patch in the image patch metadata.
[0056] (d) Perform the same processing on the intermediate compressed data of the transition bar using the transition bar temporary file and the transition bar write offset.
[0057] (e) The write completion flag is set after successful write.
[0058] In this way, the same set of image block metadata can describe both the intermediate compressed state in memory and the intermediate compressed state in the disk file, and the subsequent processing stage does not need to care about the specific distribution medium type.
[0059] Step S5: Calculate the interlayer offset.
[0060] If the current focal layer is not the reference focal layer, the system calculates the inter-layer offset data of the current focal layer relative to the reference focal layer or adjacent focal layers. If the current focal layer is the reference focal layer, the inter-layer offset data of this focal layer is recorded as a zero vector and directly proceeds to subsequent row and column concatenation processing. Specifically, this includes: 1. Extract the effective region from the current focal layer field of view image block and the reference focal layer field of view image block.
[0061] 2. Convert the cropped area to a grayscale image or other suitable image representation.
[0062] 3. Calculate the inter-layer offset based on the preset template clipping range, matching window, or offset search range.
[0063] 4. Write the inter-layer offset results into the inter-layer offset data matrix. For the x-th column, y-th row, and l-th focal layer, it can be denoted as... ,in and These are the offset components in the horizontal and vertical directions, respectively. If l is the reference focal layer, then... .
[0064] 5. When interlayer offset of a certain focal layer is required in the final stitching and compression stage, if the corresponding offset data has not yet been generated, wait for the state of the offset data to be completed. Before the completion of the waiting period, do not perform the transition strip backfilling, Y-direction stitching, X-direction stitching, and final compression for that focal layer.
[0065] Interlayer offsets can be obtained using methods such as template matching, phase correlation, feature matching, or pre-calibrated offset tables. The key point of this invention is to use this offset data as a necessary condition in multi-object dependencies, so that the decoding, backfilling, stitching, and final compression of non-reference focal layers are all constrained by this dependency condition.
[0066] The reference focal layer can be determined according to the following priority: if a reference focal layer is specified in the scanning protocol or device configuration, that specified focal layer is used; if not specified and the number of focal layers is odd, the middle focal layer in the Z-axis sequence is used; if the number of focal layers is even, the layer closest to the fitted focal plane or with the highest preview sharpness is used; if the system has pre-scan sharpness evaluation results, the focal layer with the highest sharpness evaluation value and located within the allowable focal plane range is used. The reference focal layer remains unchanged after being determined in a single scanning task or within a scan block. Interlayer offset data for non-reference focal layers are calculated directly relative to the reference focal layer, or obtained through cumulative offset calculations from adjacent focal layers.
[0067] Step S6: Y-axis cross-row splicing and transition strip backfilling.
[0068] Once the reference focal layer reaches a certain row, the system triggers the final stitching and compression of the previous row. For a specific column of the field of view in the previous row to be compressed, the system obtains the decoded data according to the following dependencies: 1. Retrieve image block metadata corresponding to the previous row, current column, and current focal layer.
[0069] 2. Check if the metadata exists, if the row number is equal to the row number to be compressed, and if the entire map block write completion flag is set. If not, wait or enter exception handling.
[0070] 3. Obtain a full tile decoding cache from the single tile decoding cache pool.
[0071] 4. Based on the whole tile storage offset and compressed size in the metadata, read the intermediate compressed data of the whole tile from the distribution medium and decode it into the uncompressed whole tile of the previous row.
[0072] 5. Set the complete image block decoding flag of the image block metadata to "complete".
[0073] 6. If both the current row and the previous row contain the field of view of this column, then obtain the image block metadata corresponding to the current row, the current column, and the current focal layer.
[0074] 7. Check if the metadata exists, if the row number is equal to the current row number, and if the transition bar write completion flag is set to complete. If not, wait or enter exception handling.
[0075] 8. Retrieve a transition bar decoding cache from the single tile decoding cache pool.
[0076] 9. Based on the transition bar storage offset and compression size in the metadata, read the intermediate compressed data of the transition bar from the dispatch medium and decode it into the uncompressed current row transition bar.
[0077] Through the above processing, the system does not need to retain all the uncompressed images of the current and previous rows for a long time. It only needs to decode the necessary data as needed when finally compressing a certain field of view.
[0078] After decoding the previous row's entire image block and the current row's transition bar, the system performs stitching and reconstruction by combining the transition bar backfill cache and inter-layer offset data. The transition bar result generated after the current row participates in the stitching of the previous row in the Y direction is not immediately saved as the final compression result of the current row, but is saved as the transition bar backfill cache for the current row; when the current row becomes the previous row to be finally compressed in the next processing cycle, the transition bar result is then backfilled into the current row's entire image block. Specifically, this includes: 1. If the previous row to be compressed has already generated transition bar data that needs to be backfilled in an earlier Y-direction stitching, then according to the transition bar backfilling area, the corresponding transition bar is obtained from the transition bar backfilling cache and copied to the corresponding area of the previous row's whole image block.
[0079] 2. Obtain the inter-layer offset data of the current focal layer in the previous row and the inter-layer offset data of the current focal layer in the current row.
[0080] 3. Based on the row and column correction results and interlayer offset data obtained in the scanning and stitching process, determine the relative compensation amount between the previous row of whole blocks and the current row of transition bars.
[0081] 4. Apply boundary restrictions to the compensation amount to prevent the compensation area from exceeding the cropping area or image boundary.
[0082] 5. Perform a Y-direction transition blend between the previous row block and the current row transition bar to obtain the transition bar result used to eliminate inter-row seams.
[0083] 6. Record the backfill area corresponding to this Y-direction transition fusion, and write the transition bar result to the transition bar backfill cache corresponding to the current row. This transition bar result will be backfilled into its entire map block when the current row is finally compressed as the previous row. If this backfill cache registration is not completed, the current row cannot enter the final compression completion state.
[0084] In one specific implementation, the Y-direction compensation amount and the transition strip backfill area can be determined according to the following rules. Let the focal layer to be processed be l, the interlayer offset of the reference focal layer be zero vector, and the interlayer offset of the non-reference focal layers be... ,in and These represent the horizontal and vertical offset components, respectively; let the cumulative correction amount of the current field of view obtained from row and column stitching correction be... ,in This is the horizontal correction amount. This is the vertical correction amount. Let the width of the visual field image patch be... The height is ; Horizontal cutting width is The vertical cutting height is The half-width of the fusion zone is Boundary margin is When performing Y-axis splicing on the previous row's entire image block and the current row's transition bar, first calculate separately: Previous line compensation amount: ; Current line compensation amount: ; Y-axis relative compensation amount: ; Will Limit to the allowed area of the cropping region, for example, limit to and Inside.
[0085] Transition strip backfill area It can be represented as ,in Desirable , The blending band half-width refers to the pixel overlap area used to eliminate seams during inter-line transition blending, and its half-width is... This determines the smooth range of the transition and fusion process; Desirable ; according to , and The horizontal components are calculated and clipped at the boundary. according to , , and The vertical component is calculated and then cropped at the boundary. Therefore, the transition bar backfill area is not an abstract area, but a coordinate region within the entire image patch determined by the image size, cropping parameters, fusion bandwidth, and inter-layer offset.
[0086] The above process is performed separately for each focal layer. This invention does not require different focal layers to be merged into a single image before stitching; in multi-focal-layer slice storage scenarios, each focal layer can independently complete pixel stitching and final compression, but pixel stitching of non-reference focal layers must use their inter-layer offset data for position compensation, and all focal layers in the same physical scan line share the row-level buffer slot release condition.
[0087] Release the transition bar decoding cache after the Y-direction splicing is completed.
[0088] Step S7: X-axis cross-column splicing and final compression.
[0089] When performing the final compression of the same row, dependencies also exist between adjacent columns. Specifically, these include: 1. For the current column in the row to be compressed, determine whether its left adjacent column belongs to the valid scan area.
[0090] 2. If the left adjacent column exists, obtain the image block metadata of the left adjacent column.
[0091] 3. Determine if the decoding completion flag for the entire image block in the left adjacent column is set to "complete". If not, wait for the decoding of the left adjacent column to complete.
[0092] 4. Obtain the inter-layer offset data of the left adjacent column and the current column respectively.
[0093] 5. Based on the stitching correction results between adjacent image blocks and the interlayer offset data, perform X-direction transition fusion.
[0094] 6. After the lateral transition dependency between the current column and the adjacent column is satisfied, perform final compression on the adjacent columns affected by the lateral transition. Satisfying the lateral transition dependency means that both the current column and the adjacent column have completed the necessary decoding, and the inter-layer offset data, lateral transition region, and lateral fusion result used for lateral stitching between them are ready for final compression.
[0095] 7. As a preferred approach, the current column is processed and then the adjacent left column is compressed. That is, when the current column has completed the necessary X / Y direction dependency processing, the entire current column has been decoded, and the adjacent left column has also been decoded, the adjacent left column is compressed. When the last column of the current row is reached, the last column is compressed.
[0096] In one specific implementation, the X-direction compensation amount can be calculated as follows. For the same row y and adjacent columns... Interlayer migrations were obtained for x and focal layer l, respectively. and Take the row and column splicing correction amount. horizontal components Used for calculations in the X direction, combined with lateral splicing correction. , get: Compensation amount in the left column: ; Current column compensation amount: ; X-axis relative compensation amount: ; according to Determine the location for copying, merging, or cropping the horizontal transition area.
[0097] The system performs final compression and saving on the field-of-view image blocks that have undergone transition backfilling, X-direction stitching, and Y-direction stitching. Specifically, this includes: 1. Based on the current focal layer, row number, and column number, obtain the layer number, block number, row number, column number, or other saved indexes required for the final slice file.
[0098] 2. Determine the final writing area based on the interlayer offset data, cropping parameters, and image size.
[0099] 3. Perform final compression on the image blocks according to the target slice format. The target format can be JPEG, layered JPEG, video encoding format, or other compression formats supported by digital slicing.
[0100] 4. Write the final compressed data and corresponding index to the slice file or submit it to the asynchronous save queue.
[0101] 5. Once the image block corresponding to a certain full-block decoding cache has been stitched together in the X direction and finally compressed, mark the full-block decoding cache as available.
[0102] 6. Once the Y-direction splicing involving a certain transition bar decoding cache has been completed, mark the transition bar decoding cache as available.
[0103] 7. If cancellation, encoding failure, temporary file reading failure, or compression saving failure occurs during processing, the corresponding row number, column number, focal layer number, and status flag are recorded, and the release of cache that may still be used for rollback is stopped, or the preset rollback process is entered.
[0104] Step S8: Release row-level cache slots.
[0105] Once all column views and all focal layers of a given row have been finally compressed and saved, the system releases the row-level buffer slot corresponding to that row. This release condition differs from that of a normal row buffer, which releases upon completion of the current row's write operation, and also from that of normal on-demand decoding, which releases upon completion of decoding. The row-level buffer slot is only allowed to be reset after all column views, all focal layers, transition bar backfill buffer, non-reference focal layer inter-layer offset data, and the final compression state related to that scan row have all met the completion conditions. Specifically, this includes: 1. Reset the write offset of the whole block and the write offset of the transition bar corresponding to the row-level cache slot to zero.
[0106] 2. Set the image block metadata in the row-level cache slot to empty or mark it as overwriteable.
[0107] 3. Mark the dispatch media bound to the row-level cache slot as rewritable.
[0108] 4. When the dispatch medium is a memory buffer, the entire memory block is not released immediately, but the memory buffer is reused to reduce the overhead of frequent memory allocation and release.
[0109] 5. When the dispatch medium is a temporary disk file, the file handle can be retained and the write offset reset, or the temporary file can be closed and deleted uniformly after the task ends.
[0110] 6. When the scan row number is greater than the number of row-level cache slots, the row-level cache slots are reused in a cyclic manner by taking the row number as the modulo. However, before reuse, it must be confirmed that the scan row carried by the cache slot in the previous round has been finally compressed and saved.
[0111] Step S9: First line, last line, and exception handling.
[0112] This invention also includes the following boundary handling and exception handling: 1. First line processing: If there is no previous line in the first line, Y-direction splicing is not performed, and the transition bar writing completion status can be directly set to complete.
[0113] 2. Final row processing: If there is no next row transition bar in the last row, the system decodes the entire last row block as needed, fills its existing transition bar cache, completes the X-direction transition and final compression and saving, and then releases the last row-level cache slot.
[0114] 3. Write Out-of-Bounds Handling: When writing to the memory buffer in the intermediate compressed state, if the write offset plus the compressed size exceeds the buffer capacity, the write operation stops and the corresponding row number, column number, and focal layer number are recorded. The system can switch to disk dispatch media or retry after reducing concurrency.
[0115] 4. Handling unavailable dispatch media: When memory has been freed, temporary file opening fails, or file handle is invalid, stop writing to the current line and mark the task status as uncontinuable.
[0116] 5. Dependency Waiting Cancellation Handling: While waiting for the entire image block to be written, the transition bar to be written, the left adjacent column to be decoded, or the inter-layer offset to be generated, the cancellation status is continuously monitored. If a cancellation signal is received, the waiting is exited and the cache that is already safe to release is released.
[0117] 6. Handling of non-full-image scan areas: When a column does not belong to the valid scan area in the current row or the previous row, background image blocks can be used in the final saving, or the corresponding Y-direction stitching can be skipped.
[0118] 7. Compression format rollback: When the target final compression format requires additional caching, such as video encoding line caching, the system can request additional caching through the parameter queue; when the additional caching is insufficient, it waits for the caching queue to release.
[0119] In this embodiment, the multi-threaded model is as follows: like Figure 2 As shown, this invention can be implemented using a multi-threaded pipeline, but the threads are not arbitrarily concurrent; rather, they are constrained by multiple object dependencies. A typical thread model includes an acquisition / image preprocessing thread T0, an intermediate compression thread T1, an inter-layer offset thread T2, a stitching and reconstruction thread T3, a final compression and storage thread T4, and a state and cache control unit S. The synchronization mechanism between the threads includes: 1. Row-level buffer slot availability: The acquisition / image preprocessing thread can only bind a new physical scan row to a buffer slot after the buffer slot has been released.
[0120] 2. Complete image block write status: Before decoding the previous row of complete image blocks, the stitching and reconstruction thread must wait for the complete image block write status to be set in the metadata of the corresponding image block.
[0121] 3. Transition bar writing completion status: Before decoding the current row transition bar, the splicing and reconstruction thread must wait for the corresponding transition bar writing completion flag of the current row to be set to completion.
[0122] 4. Interlayer offset completion status: Before performing transition strip backfilling, Y-direction stitching, X-direction stitching and final compression, non-reference focal layers must wait for the corresponding interlayer offset data to be generated.
[0123] 5. Adjacent column decoding completion status: When a column is affected by the horizontal transition, it is necessary to wait for the entire block of the adjacent column to be decoded, and for the horizontal transition area and fusion result to be available.
[0124] 6. Single tile decoding cache availability status: After the stitching and reconstruction thread obtains the whole tile decoding cache and transition bar decoding cache, it marks them as occupied; the transition bar decoding cache is released after the Y-direction stitching is completed, and the whole tile decoding cache is released after the X-direction stitching and final compression are completed.
[0125] 7. Row-level cache slot release status: The final compression and save thread counts whether all columns and all focal layers of a certain scan row have completed final compression; only when all are completed will the write offset and status of the row-level cache slot be reset.
[0126] In the above thread model, the intermediate compression thread, the inter-layer offset thread, and the stitching and reconstruction thread can be executed in parallel, but their read and write order is constrained by the completion of writing the entire image block, the completion of writing the transition bar, the completion of inter-layer offset, the completion of decoding adjacent columns, and the release state of the row-level cache slot.
[0127] To facilitate understanding of the data flow and processing effects of this invention, an implementable numerical embodiment is provided below. This numerical value is only for illustrating how the scheme is implemented; the actual compression size will vary depending on the image content and compression quality.
[0128] Assume the scan parameters are as follows: 1. The number of coke layers is 3, denoted as L0, L1, and L2 respectively.
[0129] 2. The number of columns scanned is 8, and the number of rows scanned is 10.
[0130] 3. The size of a single field-of-view image patch is Pixels Pixels, 3 bytes per pixel in a three-channel image.
[0131] 4. Horizontal cutting width Pixels, vertical cropping height Pixel.
[0132] 5. The height of the transition strip is taken as follows: Pixel.
[0133] 6. Y-axis fusion band half-width Pixels, margin Pixel.
[0134] 7. The number of row-level cache slots is 2, denoted as C0 and C1 respectively.
[0135] 8. If the scanning protocol does not specify a reference focal layer, the intermediate focal layer L1 is used as the reference focal layer among the three focal layers; L0 and L2 are both non-reference focal layers.
[0136] The data size of a single complete uncompressed field-of-view image patch is: Bytes, approximately 14.34 MiB. The data size of a single uncompressed transition bar is: Bytes, approximately 0.75 MiB.
[0137] If a complete, uncompressed image with 2 rows, 8 columns, and 3 focal layers is stored directly in memory, the total data size of the entire image patch would be approximately: Bytes, approximately 688.50 MiB. If the intermediate compression state method of this invention is adopted, assuming that the average compressed size of a complete image block is 1.25 MiB and the average compressed size of a transition bar is 0.08 MiB, then the intermediate compressed state stored in the two row-level buffer slots (2 rows, 8 columns, 3 focal layers) is approximately: MiB. This numerical example shows that, under the above parameters, the intermediate row cache portion alone can be reduced from approximately 688.50 MiB of uncompressed full tile cache to approximately 63.84 MiB; the actual system will also retain a small amount of single tile decoding cache and transition bar backfill cache, but it is still significantly lower than the memory footprint of simultaneously retaining multiple rows of full uncompressed images.
[0138] To handle the first Line and trigger the first Taking the final compression of rows as an example, the data flow is as follows: 1.No. The row is bound to row-level cache slot C1, the first row. The row is bound to the row-level cache slot C0.
[0139] 2. For the first line, number For each column and focal layer L1, generate an image patch metadata record. Example content is as follows: row-level cache slot number C1, row number 3, column number 2, focal layer number L1, total patch compressed size 1255936 bytes, total patch storage offset 2482176 bytes, transition bar compressed size 84096 bytes, transition bar storage offset 166784 bytes, total patch write completion flag is yes, transition bar write completion flag is yes, total patch decoding completion flag is no.
[0140] 3. Regarding the first line, number Column, L1 focal layer, generate the current row transition bar metadata. In the example, the transition bar compressed size is 82944 bytes, the transition bar storage offset is 165888 bytes, and the transition bar write completion flag is "Yes".
[0141] 4. The splicing and reconstruction thread triggers the first... During the final compression, the first line in C1 is read. line, number The intermediate compressed data of the entire image block of the L1 focal layer is compressed and decoded, and then the data in C0 is read. line, number Compress and decode the intermediate data of the transition strip of the L1 focal layer.
[0142] 5. Since L1 is the reference focal layer, , If the row and column splicing correction amount is , Then the relative compensation amount in the Y direction .
[0143] 6. According to , , , , and An exemplary transition strip backfill area can be obtained. The amount of data in this area is Bytes. The system writes the 380928-byte transition bar result obtained from the Y-axis fusion into the first... line, number The transition bar corresponding to column L1 focal layer is backfilled into the cache, and recorded. .
[0144] 7. For the non-reference focal layer L0, assume , Then, with the same row and column correction amount, the compensation amount for the previous row is... The current compensation amount is The relative compensation amount in the Y direction is Therefore, the transition bar backfill area and fusion position of L0 are not exactly the same as those of L1, indicating that the interlayer offset data directly participates in the pixel stitching calculation.
[0145] 8. During X-axis splicing, if the first... line, number Column and number If all columns have completed full-tile decoding and the horizontal fusion result has been generated, then the horizontal transition dependency is satisfied. At this point, the system can process the first column affected by this horizontal transition. The column undergoes final compression; after the last column (column 7, column numbers start from 0) has been processed, the final compression is performed on the last column.
[0146] 9. When the first After all 8 columns and 3 focal layers in row C1 have completed final compression, and the related transition bar backfill status, inter-layer offset status, and save status for that row are all complete, the system resets the entire block write offset and transition bar write offset of C1 to 0, and marks C1 as available for the next... Reuse.
[0147] 10. When processing the first In the last line, since the first line does not exist... For line transition bars, the system no longer waits for the next line transition bar in the current line, but instead decodes the first line transition bar. The entire image block is filled with its already saved transition bar cache. After horizontal splicing and final compression, the corresponding row-level cache slots are released.
[0148] In this embodiment, the present invention may also employ the following alternatives or extensions: Regarding the intermediate compression format, it is not limited to JPEG format; lossless compression formats, low-loss intra-frame coding formats, fast video intra-frame coding formats, or dedicated image block compression formats can also be used. As long as the format can support independent encoding by image block, reading by offset, and decoding on demand, the purpose of this invention can be achieved.
[0149] Regarding the dispatch media, the intermediate compressed state dispatch media can be contiguous memory, disk temporary files, memory-mapped files, solid-state drive cache, shared memory, remote cache, or a hybrid cache. The system can dynamically select the dispatch media based on image size, number of focal layers, remaining memory, disk speed, and scan speed.
[0150] Regarding the number of row-level buffer slots, at least two row-level buffer slots are sufficient to handle dependency processing between the previous and current rows. If the scan speed is higher or the final compression takes longer, it can be expanded to three or more row-level buffer slots to form a deeper encoding, decoding, and compression pipeline.
[0151] Regarding the height of the transition bar, it can be twice the clipping height, or it can be dynamically adjusted based on the splicing search range, the overlap ratio of the field of view, the maximum value of the inter-layer offset, or the real-time matching results.
[0152] Regarding the generation method of inter-layer migration, inter-layer migration can be inferred from template matching, phase correlation, feature point matching, pre-calibrated displacement tables, focal layer mechanical displacement models, or image quality models. This invention does not limit the specific algorithm of inter-layer migration; the focus is on using the inter-layer migration results as the dependent data for the final decoding, stitching, and compression in a unified manner.
[0153] Regarding dependency waiting methods, multi-object dependencies can be implemented using dependency tables, state matrices, event flags, semaphores, task dependency graphs, blocking queues, asynchronous messages, or reactive streams. As long as it can be guaranteed that a certain processing step is executed only after its dependent data is completed, the objective of this invention can be achieved.
[0154] Regarding the final save format, the final save format can be a single-layer or multi-layer JPEG slice, pyramid slice, video-encoded slice, special pathological slice format, or cloud-based chunked object.
[0155] Example 2 This embodiment provides a multi-object-dependent constraint streaming stitching and compression device for multi-focal-layer slide scanning, used to implement the method in Embodiment 1 above. The device includes: The dependency building module is used to build multi-object dependencies, which include at least cross-row dependencies, cross-column dependencies, and cross-focus layer dependencies.
[0156] The cache management module is used to allocate row-level cache slots for the current scan line. Multiple focal layers of the same physical scan line share the same row-level cache slot, and register the corresponding whole block intermediate compressed data, transition bar intermediate compressed data, inter-layer offset data and completion status according to the focal layer index.
[0157] The intermediate compression module is used to encode each view image block into intermediate compressed data of the whole image block and intermediate compressed data of the transition bar, and to record the corresponding storage location and completion status through image block metadata.
[0158] The stitching and reconstruction module is used to decode the previous row of the whole image block and the current row of the transition bar as needed based on the multi-object dependency relationship when the dependency conditions are met. It combines the inter-layer offset data and the transition bar backfill cache to perform Y-direction cross-row stitching and save the stitched transition bar result as an intermediate state cache for subsequent cross-processing cycle backfilling. It also performs X-direction cross-column stitching after the horizontal transition dependency between the current column and the adjacent column is satisfied.
[0159] The final compression module is used to perform final compression and save the visual field image blocks that meet the stitching conditions.
[0160] The resource release module is used to release the corresponding row-level cache slots after all focal layers and all columns of the current scan row have been finally compressed and saved.
[0161] Example 3 This embodiment also provides an electronic device, see reference. Figure 3 It includes a memory 402 and a processor 401, the memory 402 storing a computer program and the processor 401 being configured to run the computer program to perform the steps in any of the above method embodiments.
[0162] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.
[0163] The memory 402 may include a mass storage device for data or instructions. For example, and not limitingly, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 402 may include removable or non-removable (or fixed) media. Where appropriate, the memory 402 may be internal or external to a data processing device. In a particular embodiment, the memory 402 is non-volatile memory. In a particular embodiment, the memory 402 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0164] The memory 402 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 401.
[0165] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the multi-object dependency constraint streaming splicing compression methods in the above embodiments.
[0166] Optionally, the electronic device may further include a transmission device 403 and an input / output device 404, wherein the transmission device 403 is connected to the processor 401 and the input / output device 404 is connected to the processor 401.
[0167] The transmission device 403 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 403 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0168] Input / output device 404 is used for inputting or outputting information. It can be a speaker, microphone, monitor, or keyboard.
[0169] Example 4 This embodiment also provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the multi-object dependency constraint streaming splicing compression method according to Embodiment 1.
[0170] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0171] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0172] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0173] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0174] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.
Claims
1. A multi-object dependency-constrained streaming splicing compression method, characterized in that, Includes the following steps: Construct multi-object dependencies, which include at least cross-row dependencies, cross-column dependencies, and cross-focal layer dependencies, to constrain the execution order among the previous row whole image block, the current row transition bar, the transition bar backfill cache, the adjacent column decoding status, the non-base focal layer inter-layer offset data, and the row-level cache slot release status; Assign a row-level buffer slot to the current scan line. Multiple focal layers of the same physical scan line share the same row-level buffer slot. However, the corresponding whole block intermediate compressed data, transition bar intermediate compressed data, inter-layer offset data and completion status are registered in the row-level buffer slot according to the focal layer index. Get the field image blocks of each column under the current focal layer of the current scan row, encode each field image block into compressed data of the whole image block, and encode the transition area used for vertical stitching into compressed data of the transition strip. Record the corresponding storage location and write completion status through image block metadata. Based on the multi-object dependency relationship, when the dependency conditions are met, the previous row of whole image blocks and the current row of transition bars are decoded as needed. Combined with the inter-layer offset data and the transition bar backfill cache, cross-row splicing in the Y direction is performed, and the spliced transition bar result is saved as an intermediate state cache for subsequent cross-processing cycle backfilling. After the horizontal transition dependency between the current column and the adjacent column is satisfied, perform cross-column splicing in the X direction and then perform final compression and saving. Once all focal layers and all columns of the current scan row have been finally compressed and saved, the corresponding row-level cache slots are released.
2. The method as described in claim 1, characterized in that, The spliced transition bar results are saved as intermediate state caches for subsequent backfilling across processing cycles. This includes: after the current row participates in the Y-direction splicing of the previous row, the generated transition bar results are temporarily stored in the transition bar backfilling cache of the current row, and the corresponding transition bar backfilling area is recorded; when the current row is the previous row to be finally compressed in the next processing cycle, the transition bar results are backfilled to the corresponding area of the current row's whole image block according to the transition bar backfilling area.
3. The method as described in claim 1, characterized in that, Assigning row-level cache slots to the current scan line also includes: when the current focal layer is a reference focal layer, selecting a writable cache slot from the row-level cache slots and marking it as non-reusable; when the current focal layer is a non-reference focal layer, using the row-level cache slot associated with the corresponding current scan line; the decoding, backfilling, or splicing steps for non-reference focal layers are configured to wait for the corresponding inter-layer offset data to be generated before execution.
4. The method as described in claim 1, characterized in that, The conditions for releasing the corresponding row-level cache slot are: all column fields of view of the scan row have been finally compressed and saved, all focal layers have been finally compressed and saved, the backfill status of the transition strips related to the scan row has been completed, and the interlayer offset status of the non-reference focal layers has been completed. After the above conditions are met, the write offset and status flag of the row-level cache slot are reset, and the row-level cache slot is marked as reusable. When the scan row number is greater than the number of row-level cache slots, the row-level cache slots are reused in a cyclic manner according to the row number modulo. Before reuse, it is checked whether the scan row carried by the cache slot in the previous round has been finally compressed and saved.
5. The method as described in claim 1, characterized in that, The image block metadata includes at least column number, row number, focal layer number, total image block compressed size, total image block storage offset, transition bar compressed size, transition bar storage offset, total image block write completion flag, transition bar write completion flag, and total image block decoding completion flag. The intermediate compressed data of the total image block and the intermediate compressed data of the transition bar are stored in an intermediate compressed state dispatch medium, which includes a memory buffer or a disk temporary file. The image block metadata uniformly describes the storage location and completion status in both media.
6. The method as described in claim 1, characterized in that, Decoding the previous row of full image blocks and the current row of transition bars on demand includes: obtaining full image block decoding cache and transition bar decoding cache in pairs from the single image block decoding cache pool; decoding the corresponding full image block intermediate compressed data and transition bar intermediate compressed data respectively according to the image block metadata writing completion flag; releasing the transition bar decoding cache after Y-direction stitching is completed; and releasing the full image block decoding cache after final compression is completed. The multi-object dependency relationship is controlled by dependency status flags, which include at least the full image block writing completion flag, the transition bar writing completion flag, the full image block decoding completion flag, the inter-layer offset completion flag, and the adjacent column decoding completion flag. Each processing step determines whether the execution conditions are met by checking the corresponding dependency status flags.
7. The method as described in claim 1, characterized in that, It also includes special handling for the first and last lines: if the current line is the first line, the transition bar is written to the completion flag and the completion is set directly, without performing Y-direction cross-line splicing; if the current line is the last line, without waiting for the transition bar of the next line, the last line of the entire image block is directly decoded, its existing transition bar is backfilled into the cache, and horizontal splicing and final compression and saving are performed.
8. A multi-object dependency-constrained streaming splicing compression device, characterized in that, include: A dependency building module is used to build multi-object dependencies, which include at least cross-row dependencies, cross-column dependencies, and cross-focus layer dependencies. The cache management module is used to allocate row-level cache slots for the current scan line. Multiple focal layers of the same physical scan line share the same row-level cache slot, and register the corresponding whole block intermediate compressed data, transition bar intermediate compressed data, inter-layer offset data and completion status according to the focal layer index. The intermediate compression module is used to encode each view image block into intermediate compressed data of the whole image block and intermediate compressed data of the transition bar, and to record the corresponding storage location and completion status through image block metadata; The stitching and reconstruction module is used to decode the previous row of whole image blocks and the current row of transition bars as needed based on the multi-object dependency relationship when the dependency conditions are met. It combines the inter-layer offset data and the transition bar backfill cache to perform Y-direction cross-row stitching and save the stitched transition bar result as an intermediate state cache for subsequent cross-processing cycle backfilling. It also performs X-direction cross-column stitching after the horizontal transition dependency between the current column and the adjacent column is met. The final compression module is used to perform final compression and save the visual field image blocks that meet the stitching conditions; The resource release module is used to release the corresponding row-level cache slots after all focal layers and all columns of the current scan row have been finally compressed and saved.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.