Control method, device and storage medium for pathological section imaging
By associating and binding the frame data and context information of pathological slides, and combining the double buffering mechanism to verify parameter configuration, the problem of poor imaging quality of pathological slides was solved, the parameter adaptation accuracy and switching stability were improved, and the imaging quality and scanning efficiency were enhanced.
Patent Information
- Application Number
- CN202611124584.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-08-25
AI Technical Summary
In existing technologies, the imaging quality of pathological slides is poor, making it difficult to adapt to multi-stage differentiated imaging scenarios. This leads to conflicts between imaging parameter switching and imaging acquisition timing, insufficient accuracy in parameter adaptation, and a lack of effective verification and traceability mechanisms.
By associating and binding frame data with frame context information based on the raw photosensitive data of the target pathological slice, scene determination is performed and target parameter sequences are retrieved. The parameter configuration is verified during the idle period between frames using a double buffering mechanism, realizing full-link image processing and ensuring that the imaging results are output after the parameter configuration is stable.
It improves the timing security and stage adaptation accuracy of switching imaging parameters for pathological sections, ensures the continuity and consistency of imaging quality and the traceability of parameter adjustments, and improves the overall quality and efficiency of the scanning process.
Smart Images

Figure CN122636801A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a control method, device and storage medium for imaging pathological sections. Background Technology
[0002] In digital pathological slide imaging scanning scenarios, the ability to adapt imaging parameters at different stages and process them in real time directly affects the slide imaging quality and overall scanning efficiency.
[0003] In related technologies, pathological slides are imaged by using a small number of fixed image signal processor parameters built into the camera and uploading raw data to a host computer to complete image signal processing. This method relies on fixed parameters and the host computer post-processing link, which is difficult to adapt to application scenarios with different imaging stages such as focusing, positioning, barcode recognition, and formal scanning, resulting in poor imaging quality of pathological slides.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this application is to provide a control method, device, and storage medium for imaging pathological sections, aiming to solve the technical problem of poor imaging quality of pathological sections.
[0006] To achieve the above objectives, this application proposes a method for controlling imaging of pathological sections, the method comprising: Based on the original photosensitive data corresponding to the target pathological slice, the frame data in the original photosensitive data is associated and bound with the corresponding frame context information to obtain the processing stage information corresponding to the frame data. Based on the processing stage information and image statistical features, scene determination is performed, and the target parameter sequence is determined by combining indexing rules for retrieval. During the inter-frame idle period, the target parameter sequence is verified, and the effective parameter configuration is atomically switched through a double buffering mechanism to obtain the target parameter configuration; Perform full-link image processing according to the target parameter configuration, and output the target imaging result after verifying and confirming that the parameter configuration is stable.
[0007] In one embodiment, the frame start and end identifiers, pixel row data and embedded statistical rows of the original photosensitive data corresponding to the target pathological slice are analyzed frame by frame to obtain independent frame pixel acquisition information. Based on the frame pixel acquisition information, the frame context information, including frame attribute information and the current working stage identifier, is constructed; Based on the pre-calibrated dark level parameters and bad pixel mapping table in the frame context information, the original photosensitive data is sequentially subjected to black level correction, bad pixel neighborhood median replacement and bit depth normalization mapping to obtain the original pixel data. The original pixel data is associated and bound with the corresponding frame context information by the frame sequence number, and the correspondence between pixel data and working stage identifier is constructed to obtain the processing stage information corresponding to the frame data.
[0008] In one embodiment, frame-by-frame statistical operations are performed on the original pixel data associated with the processing stage information to obtain an image statistical feature set including brightness statistical features and tissue texture parameters; The working stage identifier of the processing stage information is used as a priority judgment dimension, and the hierarchical scene matching judgment is performed in combination with the image statistical feature set to determine the image scene identifier corresponding to the frame data. Based on the work stage identifier and the image scene identifier, and according to the three-level index mapping rules of work stage, image scene, and parameter configuration, candidate parameters corresponding to the processing stage information are retrieved and matched in the image processing parameter set. Arrange the candidate parameters that have passed the verification according to the temporal order in the processing stage information to obtain the target parameter sequence.
[0009] In one embodiment, based on the imaging target of the processing stage in the processing stage information, the candidate parameters corresponding to the processing stage are subjected to adaptation verification and correction to obtain the candidate parameters that pass the verification. The candidate parameters that have passed the verification are arranged sequentially according to the processing time of the target pathological slides, and the stage activation nodes and switching boundary positions corresponding to the candidate parameters are marked to obtain the initial parameter sequence. The initial parameter sequence is verified for sensor model matching, parameter version unification, and data integrity. After confirming the closed loop of the full sequence switching logic, the target parameter sequence is generated in an ordered manner according to the processing time sequence.
[0010] In one embodiment, a subset of candidate parameters corresponding to the processing stage is decomposed, and the imaging target threshold of each processing stage is matched to obtain a set of verification units; The set of verification units is traversed. During the focusing stage, the sharpness discrimination adaptability of sharpening intensity and contrast gain is verified. During the positioning and recognition stage, the fine line recognizability adaptability of edge enhancement parameters is verified. During the formal scanning stage, the linkage adaptability of color reproduction parameters and flat field correction is verified, and all defective parameter items that fail to meet the adaptability standards are marked. Based on the defect parameter items, targeted corrections are performed with the imaging target threshold corresponding to the processing stage as constraints to obtain the corrected parameter subsets for each stage. The modified subset of parameters for each stage is subjected to intra-stage parameter consistency verification. After confirming that the parameters within the same stage are logically compatible, the candidate parameters that have passed the verification are integrated.
[0011] In one embodiment, the parameter group to be activated corresponding to the current stage switching node is extracted from the target parameter sequence, and the frame transmission status of the original photosensitive data is detected. The parameter loading process is started during the inter-frame idle period between the frame end identifier of the current frame and the start identifier of the next frame. After the parameter loading process is started, the parameter group to be effective is written into the target active buffer in the double buffer architecture, and the target active buffer is locked after the verification is passed. Before the end of the inter-frame idle period, the currently active buffer pointer is pointed to the target active buffer, and the first frame image after the switch is marked as a protection frame and associated with the parameter switching identifier; After confirming that the parameter switching process is entirely within the inter-frame period and there is no risk of misuse, the parameter content of the target activity buffer is used as the currently effective target parameter configuration, and the switching frame number, parameter version, and switching result are written to the switching traceability log.
[0012] In one embodiment, the average brightness, saturated pixel ratio, and color deviation index are extracted frame by frame from a series of consecutive images after parameter switching, and compared with the effective stability threshold to obtain the parameter effective status determination result. If the parameter effectiveness status determination result is that the parameter effectiveness is abnormal, a rollback operation is triggered during the current inter-frame idle period to switch the target active buffer pointer back to the active buffer corresponding to the stable parameter group and restore the stable imaging parameter configuration before the switch. Write the parameter information, the cause of the exception, and the rollback execution result of this switchover into the switchover traceability log, and update the cumulative number of consecutive rollbacks and exception type statistics. When the number of consecutive rollbacks reaches the preset rollback threshold, the system locks to the safe default parameter group and terminates the automatic parameter switching process, and outputs a parameter recalibration prompt to ensure stable operation of the imaging process.
[0013] In one embodiment, the target parameter configuration is used as a processing benchmark to remove invalid frame data marked as protection frames, and color calibration and flat field correction are sequentially performed on the valid original image frames to obtain valid corrected image frames. The average brightness, color deviation, and texture consistency of the effectively corrected image frame are compared with the stable threshold range of the indicators one by one to obtain the verification result of the parameter configuration taking effect. When the verification result indicates that the parameter configuration is stable and effective, the effective corrected image frame is associated and bound with the corresponding parameter configuration identifier and the frame context information to generate an effective imaging frame; The effective imaging frames are arranged and spatially aligned in an orderly manner according to the scanning sequence of the pathological sections. After removing discrete abnormal frames, they are integrated to generate the target imaging result.
[0014] In addition, to achieve the above objectives, this application also proposes a control device for pathological slide imaging, the control device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method for pathological slide imaging as described above.
[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the control method for pathological slide imaging as described above.
[0016] This application provides a control method for pathological slide imaging, which includes associating and binding frame data with corresponding frame context information of the original photosensitive data corresponding to the target pathological slide to obtain the processing stage information corresponding to the frame data; combining the processing stage information with image statistical features to determine the scene and using index rules to retrieve and determine the target parameter sequence; completing parameter verification during the inter-frame idle period and atomically switching the effective parameter configuration through a double buffer mechanism to obtain the target parameter configuration; finally, performing full-link image processing according to the target parameter configuration and verifying that the parameter configuration is stable before outputting the target imaging result. This method solves the technical problems in existing pathological slide imaging processes, such as parameter switching easily conflicting with the imaging acquisition timing, causing inter-frame image quality jumps, insufficient accuracy of imaging parameters and each processing stage adaptation, and poor imaging stability due to the lack of effective verification and traceability mechanisms for dynamic parameter adjustment. It improves the temporal security and stage adaptation accuracy of pathological slide imaging parameter switching, ensures the continuous consistency of imaging quality and the traceability of parameter adjustment, and realizes dynamic adaptive matching of parameters throughout the scanning process, effectively improving the overall quality of pathological slide imaging and scanning efficiency.
[0017] In summary, this application solves the technical problem of poor imaging quality of pathological slides by binding frame context matching parameter sequences and relying on inter-frame double buffering to switch imaging parameters, improves parameter adaptation accuracy and switching stability, and ensures continuous and consistent image quality throughout the entire process. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the first embodiment of the control method for pathological slide imaging according to this application; Figure 2 This is a flowchart illustrating the dynamic parameter switching process in this application. Figure 3 This application outputs a flowchart of the data path. Figure 4 This is a diagram of the parameter group index architecture for this application; Figure 5 This is a flowchart illustrating the fourth embodiment of the control method for pathological slide imaging in this application; Figure 6 This is a flowchart illustrating the fifth embodiment of the control method for pathological section imaging in this application; Figure 7 This is a dynamic switching state diagram of the parameters in this application; Figure 8 This is a flowchart illustrating the seventh embodiment of the control method for pathological slide imaging in this application; Figure 9 This is a schematic diagram of the control device for imaging pathological sections in this application.
[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0023] In related technologies, pathological slides are imaged by using a small number of fixed image signal processor parameters built into the camera and uploading raw data to a host computer to complete image signal processing. This method relies on fixed parameters and the host computer post-processing link, which is difficult to adapt to application scenarios with different imaging stages such as focusing, positioning, barcode recognition, and formal scanning, resulting in poor imaging quality of pathological slides.
[0024] This application provides a solution: First, based on the original photosensitive data corresponding to the target pathological slice, the frame data in the original photosensitive data is associated and bound with the corresponding frame context information to obtain the processing stage information corresponding to the frame data. Then, scene determination is performed based on the processing stage information and image statistical features, and the target parameter sequence is determined by combining index rules. The target parameter sequence is then verified during the inter-frame idle period. The effective parameter configuration is atomically switched through a double buffering mechanism to obtain the target parameter configuration. Finally, full-link image processing is performed according to the target parameter configuration. After verifying and confirming that the parameter configuration is stable, the target imaging result is output.
[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or pathological slide imaging control device capable of the above functions. The following description uses a pathological slide imaging control device as an example to illustrate this embodiment and the subsequent embodiments.
[0026] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0027] This application provides a method for controlling imaging of pathological sections, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the control method for pathological slide imaging in this application.
[0028] In this embodiment, the control method for pathological slide imaging includes steps S10 to S40: Step S10: Based on the original photosensitive data corresponding to the target pathological slice, associate and bind the frame data in the original photosensitive data with the corresponding frame context information to obtain the processing stage information corresponding to the frame data.
[0029] Raw photosensitive data is the native photosensitive array data directly output by the image sensor, without color interpolation or built-in image signal processing. It includes frame-by-frame pixel information and embedded acquisition statistics. Frame context information is a set of associated metadata describing the acquisition configuration, working status, and stage attributes of a single frame image. Processing stage information is stage determination data that identifies the imaging process node to which the current frame belongs and carries complete acquisition attributes. For example, frame context information includes frame number, photosensitive mode, pixel layout format, bit depth, exposure gain, and current working stage identifier; processing stage information corresponds to imaging process nodes such as focusing, positioning and recognition, formal scanning, and quality verification.
[0030] In this embodiment, frame-level parsing and splitting of raw photosensitive data can be achieved in two ways. The first is synchronous parsing with the entire frame buffer. After all the complete data of a single frame is written to the receive buffer, the frame start identifier, pixel row data packets, embedded statistical rows, and frame end identifier are uniformly identified, and the raw pixel data and embedded acquisition statistics of a single frame are split off in one go. This method has stable parsing logic, clear data boundaries, and is less prone to row misalignment or missing statistical information, making it suitable for low frame rate, high-resolution formal scanning scenarios. The second is streaming, line-by-line incremental parsing. During the photosensitive data transmission process, parsing is performed while receiving data, identifying the data packet type line by line, accumulating pixel row data and statistical row data in real time, and immediately completing the splitting of single-frame data when the frame end identifier is detected. This method executes in parallel with the data transmission process, without waiting for the entire frame buffer to complete, which can shorten the frame processing pre-latency and is suitable for high frame rate, low-latency focusing and positioning scenarios.
[0031] After the frame-level splitting of the raw photosensitive data is completed, the frame context information of the corresponding frame is constructed and the association binding is performed.
[0032] For example, there are two methods for constructing and binding frame context information. The first is synchronous construction and binding of all fields. After the single frame data is split, all acquisition configuration fields in the embedded acquisition statistics information are extracted synchronously, and the current system's working stage identifier is injected to generate a complete frame context structure. At the same time, the frame context structure is strongly associated with the corresponding original pixel data through the frame sequence number, and the processing stage information carrying the processing stage identifier is directly output. This method has a simple and direct construction logic, high field completeness, and can provide a comprehensive judgment basis for subsequent parameter matching. The second method is incremental construction and binding of hierarchical fields. First, a basic frame context is constructed based on the basic information of the frame header, and the initial binding of frame sequence number, bit depth, and light sensitivity mode is completed. Then, as the pixel data is parsed, deeper fields such as exposure gain and statistical features are gradually added. After the entire frame is parsed, the working stage identifier is completed, and finally, complete processing stage information is generated. This method can start the subsequent preprocessing process in advance, and complete the filling of some fields during the idle period of pixel transmission, improving pipeline parallelism.
[0033] In an exemplary scheme for determining processing stage information, the system first receives the raw photosensitive data stream corresponding to the target pathological slide, initializes the frame receiving buffer and parsing state machine, and sets the parsing state to the waiting frame start state. Then, frame boundary recognition is performed. When a frame start marker is detected, single-frame data reception is initiated, distinguishing between pixel row data packets and embedded statistical rows line by line, and writing them to the pixel buffer and statistical information buffer respectively. Single-frame reception is terminated when a frame end marker is detected. Next, frame context construction is performed, extracting the frame sequence number, photosensitive mode, pixel arrangement format, bit depth, and exposure gain fields from the statistical information buffer, reading the current working stage marker from the system status register, and integrating them to generate a frame context structure. Then, data association and binding are performed, using the frame sequence number as the unique association key to map and bind the frame context structure to the raw pixel data in the corresponding pixel buffer, marking the corresponding working stage attributes. Finally, binding integrity verification is performed to confirm that the frame data and context correspond one-to-one and the stage marker is valid, outputting the final processing stage information for subsequent scene determination and parameter retrieval.
[0034] Step S20: Based on the processing stage information and image statistical features, the scene is determined, and the target parameter sequence is determined by combining the index rules.
[0035] Image statistical features are a set of quantified features extracted from single-frame raw pixel data, reflecting the image content and light intensity distribution. Scene determination is a classification process based on matching the processing stage with image features to the current imaging scene type. Indexing rules are pre-constructed retrieval mapping rules that hierarchically map processing stages, scene types, and parameter configurations. The target parameter sequence is an ordered set of image processing parameters arranged according to the imaging processing timeline, adapting to each stage of the entire workflow. For example, image statistical features include brightness distribution, tissue proportion, texture intensity, and saturated pixel ratio; scene determination corresponds to imaging scenes such as blank slides, low-magnification tissues, high-magnification cells, and edge transitions; the indexing rules adopt a three-level mapping structure of processing stage, image scene, and parameter configuration.
[0036] In this embodiment, scene determination can be performed in two ways. The first is threshold-based hierarchical determination, which prioritizes the work stage identifier in the processing stage information. First, the candidate scene range corresponding to that stage is defined. Then, the image statistical features are compared item by item with the preset feature thresholds of each candidate scene. The scene with the highest matching degree is the determination result. This method has low computational cost, fast determination speed, clear and controllable logic, and is suitable for focusing and positioning stages with high real-time requirements. The second is feature vector matching determination, which combines multi-dimensional image statistical features into a feature vector, combines it with the processing stage identifier to generate a composite determination vector, and performs similarity calculation with the pre-stored standard feature vectors of each scene. The scene with the highest similarity exceeding the confidence threshold is selected as the determination result. This method integrates multi-dimensional features, has higher determination accuracy, can identify transitional scenes and complex organizational scenes, and is suitable for refined scene matching in the formal scanning stage.
[0037] After the scene determination is completed and the image scene identifier is obtained, parameter retrieval is performed based on the index rules to generate the target parameter sequence.
[0038] For example, there are two methods for generating target parameter sequences. The first is a fixed-index hierarchical matching retrieval, which retrieves a pre-built three-level index mapping table. First, it uses the work stage identifier as the first-level index to match the parameter subset of the corresponding stage. Then, it uses the image scene identifier as the second-level index to match the parameter group of the corresponding scene. Finally, it uses the parameter version number as the third-level index to filter out the latest valid parameters, obtaining single-stage candidate parameters. Then, it integrates the parameters of each stage according to the time sequence of the entire process to generate the target parameter sequence. This method relies on the pre-built index table, resulting in fast retrieval speed, stable results, and compatibility with conventional standardized scanning workflows. The second method is a dynamic combination generation retrieval. First, it extracts core parameter constraints based on the work stage and scene identifier, dynamically adjusts the parameter amplitude based on the statistical characteristics of the current frame, generates customized single-stage candidate parameters, and then configures parameter switching rules according to the connection requirements of each stage to dynamically combine and generate a target parameter sequence adapted to this scan. This method can flexibly adapt to the imaging needs of special pathological sections, has higher parameter adaptation accuracy, and can specifically improve the imaging quality of specific tissues.
[0039] In an exemplary scheme for determining the target parameter sequence, the pre-stored full set of image processing parameters and three-level index mapping rules are first loaded to initialize the parameter retrieval engine. Then, first-level index matching is performed to extract the identifiers of each work stage in the current workflow from the processing stage information, and sequentially match them to obtain the first-level parameter subsets corresponding to each stage. Next, second-level index matching is performed; for each work stage, combined with the image scene identifier obtained from the corresponding scene determination, candidate parameter groups for the corresponding scene are matched within the first-level parameter subsets. Then, third-level verification and filtering are performed; for each candidate parameter group, sensor model verification, version validity verification, and data integrity verification are performed sequentially, eliminating invalid parameter groups and retaining the optimal candidate parameters for each stage. Next, temporal arrangement is performed; according to the standard processing sequence of pathological slide focusing, positioning recognition, formal scanning, and quality review, the candidate parameters that have passed the verification at each stage are arranged sequentially, and the effective nodes and switching boundaries of each parameter are marked. Finally, full sequence continuity verification is performed to confirm that the parameter switching logic of adjacent stages is compatible and conflict-free, generating the final target parameter sequence for subsequent parameter switching and imaging processing.
[0040] Step S30: Verify the target parameter sequence during the inter-frame idle period, and obtain the target parameter configuration by atomically switching the effective parameter configuration through a double buffering mechanism.
[0041] The inter-frame idle period is the time interval between two adjacent frames of image data transmission during which no valid pixel data is transmitted. The double-buffering mechanism sets up two parameter buffers, active and inactive, to achieve a buffer scheduling mechanism that physically separates parameter loading and activation. Atomic switching is a single-time operation within a single time slot, switching the buffer pointer without intermediate transition states. The target parameter configuration is the complete set of parameters effective in the current frame, used to drive the entire image processing chain. For example, the double-buffering mechanism includes independent active and inactive buffers; atomic switching completes the pointer jump in a single step within the inter-frame idle window, without any half-frame parameter mixing.
[0042] In this embodiment, the parameter loading and switching process can be triggered in two ways. The first is frame end triggering: when the end of the current frame is detected, the parameter verification and loading process is immediately initiated, utilizing the inter-frame idle time of the entire frame to complete parameter writing and verification, and completing the switching before the start of the next frame. This method has a clear triggering timing and sufficient idle time, making it suitable for stage switching scenarios with significant parameter changes. The second is pre-scheduling triggering: based on the target parameter sequence, the next stage switching node is predicted, and parameter preloading and verification are initiated one frame cycle in advance. When the inter-frame idle time of the switching node arrives, the switching action is executed directly. This method can distribute the parameter loading time, avoiding switching failure due to insufficient inter-frame time, and is suitable for fast scanning scenarios with high frame rates and short frame intervals.
[0043] Once the parameter switching process is triggered, parameter verification and atomic switching are performed through a double buffering mechanism to obtain the currently effective target parameter configuration.
[0044] For example, there are two implementation methods for dual-buffered parameter switching. The first is a single-step atomic switching, where the parameters to be applied are fully written into the inactive buffer and a full verification is performed. Before the inter-frame idle window closes, a single buffer pointer jump is performed to directly switch the active buffer to the verified inactive buffer, while simultaneously marking the next frame as a protection frame. The switching takes effect immediately after completion. This method has extremely short switching time, no intermediate transition state, and completely avoids the mixing of intra-frame parameters. The second is a step-by-step pre-ready switching, where the parameters to be applied are first written into the inactive buffer and verified. The parameter configuration is written into the preparatory group of hardware registers in advance. During the inter-frame idle period, only the register group is quickly switched, and the buffer pointer is updated and the protection frame is marked simultaneously. This method further reduces the switching time and is suitable for high frame rate imaging scenarios with extremely short frame intervals.
[0045] In an exemplary scheme for determining target parameter configuration, the parameter group to be activated corresponding to the current switching node is first extracted from the target parameter sequence. The transmission status of the raw photosensitive data stream is monitored in real time, and the inter-frame idle window is awaited. Then, parameter writing and verification are performed. The parameter group to be activated is completely written into the inactive buffer of the dual-buffer architecture. Parameter integrity verification, version consistency verification, and sensor compatibility verification are performed sequentially. After all verifications pass, the contents of the inactive buffer are locked. Next, an atomic switching operation is performed. At a fixed moment before the inter-frame idle window closes, a single jump of the buffer pointer is performed, pointing the active buffer pointer to the verified inactive buffer. Simultaneously, the next frame is marked as a protection frame and associated with a parameter switching identifier. Then, a switching validity confirmation is performed to check whether the switching operation is entirely within the inter-frame time period, confirming no risk of half-frame parameter mixing. Finally, the complete parameter content of the active buffer is read as the currently activated target parameter configuration. The switching frame number, parameter version, and switching result are simultaneously written to the switching traceability log for subsequent imaging quality traceability and anomaly investigation.
[0046] Step S40: Perform full-link image processing according to the target parameter configuration, and output the target imaging result after verifying and confirming that the parameter configuration is stable.
[0047] End-to-end image processing is a complete process from raw photosensitive data to the final visible image, encompassing all imaging processing stages such as color restoration, noise suppression, and flattening correction. Parameter configuration stability verification is a process of confirming the stability of parameter effectiveness through comparison of image quality indicators across consecutive frames. The target imaging result is fully processed, image-quality-stable full-field imaging data of pathological slides. For example, end-to-end image processing includes black level correction, bad pixel repair, color interpolation, noise suppression, color mapping, and flattening correction; stability verification indicators include mean brightness, color deviation, and texture consistency.
[0048] In this embodiment, end-to-end image processing can be performed in two ways. The first is fixed-sequence processing, which follows a preset standard processing pipeline, sequentially performing black level correction, bad pixel repair, color interpolation, noise suppression, color mapping, and flat-field correction on the raw pixel data. Each step is executed serially in a strictly fixed order. This method offers stable processing flow, high result consistency, and is compatible with the standardized imaging output of the formal scanning stage. The second is stage-adaptive dynamic processing, which dynamically adjusts the activation status and parameter intensity of processing steps based on the imaging target of the current processing stage. For example, it strengthens edge enhancement and contrast improvement during the focusing stage, enhances color restoration and detail preservation during the formal scanning stage, and strengthens artifact detection and correction during the quality review stage. This method can specifically match the imaging needs of each stage, prioritizing corresponding core image quality indicators at different stages, thus improving the overall processing efficiency and imaging adaptability.
[0049] After completing the processing of a single frame image, a parameter configuration stability check is performed. Once stability is confirmed, the target imaging results are integrated and output.
[0050] For example, parameter stability verification and result output methods include two types. The first is multi-frame continuous comparison verification, which extracts the average brightness, color deviation, and texture consistency indicators of multiple consecutive corrected images after parameter switching, and compares them item by item with a preset stability threshold range. If all indicators fall within the threshold range for multiple consecutive frames, the parameters are determined to be stable. After removing protection frames and abnormal frames, all valid frames are integrated according to the scanning sequence to generate the target imaging result. This method is rigorous and can effectively eliminate unstable frames in the early stage of parameter switching, ensuring the continuous consistency of output image quality. The second is single-frame deviation weighted verification, which calculates the image quality deviation value between each frame image after switching and the reference frame, and calculates the stability confidence score by combining the deviation amplitude and the number of consecutive frames. When the confidence score exceeds a preset threshold, the parameters are determined to be stable, and the valid frames are simultaneously stitched and aligned according to their spatial positions to generate the target imaging result. This method can determine the parameter stability state more quickly, reduce the number of invalid frames discarded, and improve the effective frame rate of scanning imaging.
[0051] In an exemplary scheme for outputting target imaging results, the currently effective target parameter configuration is first loaded, invalid frame data marked as protection frames are removed, and valid original image frames to be processed are obtained. Then, end-to-end image processing is performed, sequentially completing black level correction, bad pixel repair, color interpolation, noise suppression, color mapping, and flat field correction according to the target parameter configuration, resulting in initial corrected image frames. Next, parameter stability verification is performed, extracting the average brightness, color deviation, texture consistency, and saturated pixel ratio indicators of multiple consecutive initial corrected images, comparing them item by item with a preset stability threshold range, and generating a parameter effectiveness stability judgment result. Then, valid frame integration is performed. When the parameters are determined to be stable and effective, each valid corrected image frame is associated and bound with its corresponding parameter configuration identifier and frame context information, generating a valid imaging frame with complete traceability information. Finally, all valid imaging frames are arranged and spatially aligned according to the scanning sequence of the pathological slides, discrete abnormal frames are removed, and then seamlessly stitched together to generate a complete target pathological slide imaging result.
[0052] Further, please refer to Figure 2 , Figure 2This is a flowchart of the dynamic parameter switching process for this application. The main process of dynamic parameter switching for multi-scene image signal processors executes steps S201 to S210 sequentially: After the process starts, step S201 is executed first, outputting the raw Bayer image (Raw / Bayer Pattern) data stream via the Mobile Industry Processor Interface (MIPI), parsing the Frame Start (FS) identifier, pixel packet data, and Frame End (FE) identifier to complete the single-frame data splitting; then step S202 is executed, constructing the corresponding frame context (frame_context) for the single-frame data. Subsequently, step S203 is executed, performing black level correction, bad pixel repair, and bit depth normalization preprocessing on the raw pixel data. Then step S204 is executed, performing scene determination based on the preprocessed data to generate the corresponding scene identifier (scene_id, scene identifier). Finally, step S205 is executed, retrieving and querying the matching target parameter configuration identifier (profile_id, profile identifier) based on the current scene identifier. The next step, S206, involves switching the active profile during the inter-frame idle period and marking the first frame after the parameter switch as a guard frame. Then, in S207, the Image Signal Processor (ISP) sequentially performs the entire image processing chain: de-Bayering, white balance (WB), color correction matrix (CCM), gamma correction, noise reduction, and sharpening. After processing, a parameter activation confirmation check is performed. If the confirmation passes, step S208 outputs the final image; otherwise, step S209 rolls back to the stable profile and retryes the corresponding steps from S205 to S208. Finally, step S210 associates and stores the parameter configuration identifier (profile_id) with the switch log (switch_log), completing the closed-loop operation of the entire process.
[0053] Second Embodiment This embodiment provides an exemplary scheme for frame context association binding. In this example, the frame pixel acquisition information is first extracted by parsing the frame boundaries and embedded statistical information of the original photosensitive data of the target pathological slide frame by frame. Then, frame context information containing frame attribute information and working stage identifier is constructed. After completing pixel data standardization correction, strong association binding is performed to accurately obtain processing stage information carrying complete stage attributes. Step S10 includes steps A11 to A14: Step A11: Analyze the frame start and end identifiers, pixel row data and embedded statistical rows of the original photosensitive data corresponding to the target pathological slice frame by frame to obtain independent frame pixel acquisition information.
[0054] Step A12: Construct the frame context information, which includes frame attribute information and the current working stage identifier, based on the frame pixel acquisition information.
[0055] Step A13: Based on the pre-calibrated dark level parameters and bad pixel mapping table in the frame context information, perform black level correction, bad pixel neighborhood median replacement, and bit depth normalization mapping on the original photosensitive data in sequence to obtain the original pixel data.
[0056] Step A14: Associate and bind the original pixel data with the corresponding frame context information through the frame sequence number, construct the correspondence between pixel data and working stage identifier, and obtain the processing stage information corresponding to the frame data.
[0057] Frame pixel acquisition information is a frame-level native acquisition set extracted from the raw photosensitive data stream. It contains all pixel content of a single frame and embedded acquisition statistics, and serves as the fundamental data source for constructing the frame context. Examples include pixel row grayscale data, embedded statistical row data, frame header and tail identifier information, and row synchronization marker information. Pre-calibrated dark level parameters are pixel reference output values calibrated before the sensor leaves the factory under no-light conditions; they are the reference parameters for black level correction. The bad pixel mapping table is a pre-stored mapping data table that marks the locations of sensor-failed pixels, serving as the basis for bad pixel repair.
[0058] In this example, when parsing the raw photosensitive data to obtain frame pixel acquisition information, it can be done using a synchronous parsing method with the entire frame buffer. After all the complete data of a single frame is written to the receive buffer, the frame start and end markers are uniformly identified, pixel rows and embedded statistical rows are distinguished, and the complete frame pixel acquisition information is obtained in one go. Alternatively, a streaming, line-by-line incremental parsing method can be used, where the data packet type is identified line by line while receiving the raw photosensitive data stream, and the pixel row and statistical row data are accumulated in real time. When the frame end marker is detected, the frame pixel acquisition information is split, thus completing the frame-level data acquisition and splitting.
[0059] After the frame pixel acquisition information is split, the frame context information construction process is initiated. Frame attribute information is extracted based on the embedded statistical fields in the frame pixel acquisition information, and the current working stage identifier of the system is injected synchronously. Complete frame context information is then generated. Next, the pre-calibration parameters and mapping table in the frame context are called to sequentially perform black level correction, bad pixel repair, and bit depth normalization to obtain standardized raw pixel data. Finally, a strong association binding between pixel data and frame context is completed through the frame sequence number, constructing the correspondence between pixel data and working stage to obtain processing stage information. In this way, through layered parsing and step-by-step binding, the association accuracy between frame data and stage information is improved, avoiding frame sequence misalignment and stage mismatch problems.
[0060] For example, there are two ways to obtain processing stage information through frame-by-frame parsing and association binding. The first is full-frame serial binding. Based on the transmission sequence of the original photosensitive data, starting from the beginning of the data stream, the frame start identifier of each frame is identified sequentially, pixel row data and embedded statistical rows are read line by line, and the complete split of the single frame data is completed after the frame end identifier is detected. After the single frame is split, the frame context information of the corresponding frame is constructed synchronously, the pixel data is standardized and corrected, and then the full binding of pixel data and context is completed through the frame sequence number. After the binding process of each frame is completed, the parsing and binding of the next frame begins. After all frames are processed, the processing stage information is output uniformly. This method adopts a time-locked frame-by-frame serial parsing and full binding processing logic. By processing the entire frame, clear data boundaries are ensured, the problems of inter-frame data misalignment and field missing are avoided, and the one-to-one correspondence between frame context and pixel data is guaranteed.
[0061] The second method is a hierarchical incremental pipeline binding, which performs row-level hierarchical parsing on the raw photosensitive data stream. Frame structure recognition, pixel data transmission, context construction, and normalization correction are separated into independent pipeline stages. The first stage identifies frame boundaries and row types in real time and outputs pixel rows and statistical rows. The second stage incrementally constructs frame context fields while receiving statistical rows. The third stage synchronously calls pre-calibrated parameters to perform row-level correction processing on the output pixel rows. The fourth stage performs final binding and stage identifier injection after the entire frame is parsed. Each stage is executed in parallel pipeline. This method uses row-level hierarchical decomposition and multi-stage pipeline parallel processing logic. Through the pre-processing of row-level parallelism, the overall processing latency of a single frame is compressed, improving the real-time performance of frame association binding in high frame rate scenarios.
[0062] Further, please refer to Figure 3 , Figure 3This is a flowchart of the data path output for this application. The raw data is received by the image signal processor (ISP) and the corrected output data path is implemented in a software pipeline on the edge computing platform. The image signal processor (ISP) is processed and accelerated by a graphics processing unit (GPU). After receiving the raw Bayer image (Raw / Bayer pattern) data output from the Mobile Industry Processor Interface (MIPI), the platform performs correction and color processing on the platform side, instead of relying on the ISP built into the camera module or uploading the raw data to a host computer for processing. The entire process starts with data output from the MIPI sensor, which is then processed in a frame-level pipeline via the Camera Serial Interface 2 (CSI-2) receiver module. The sensor outputs Frame Start (FS), line data packets, embedded statistical lines, and Frame End (FE) through the MIPI CSI-2. The receiver driver establishes a frame context for each frame, recording the frame number (frame_id), sensor mode (sensor_mode), Bayer pattern, bit depth (bit_depth), width, height, exposure value, gain, stage identifier (stage_id), scene identifier (scene_id), and ISP profile identifier (isp_profile_id). Before the raw data enters the ISP pipeline, it first undergoes black level correction (BLC), bad pixel correction (BPC), and bit depth format normalization. Black level correction is performed based on the sensor's dark level or pre-calibrated dark level parameter. Bad pixel correction replaces failed pixels with the median of the neighborhood based on the bad pixel table. Format normalization maps raw data with different bit depths such as Raw8, Raw10, and Raw12 to an internally unified processing bit depth. This step is simultaneously connected to the scan control and macro statistics modules to provide global statistical support, and the processing results retain frame context information throughout, so that subsequent parameter switching can be accurately bound to the specific frame number.The preprocessed data enters the scene determination module to generate a corresponding scene identifier. Combined with the stage identifier, the identifier is configured according to the rule of mapping parameters based on the stage identifier plus the scene identifier. The parameter management double buffer module completes parameter matching and inter-frame switching scheduling. Subsequently, the data enters the ISP pipeline, where it sequentially completes the entire chain of color and image quality processing, including white balance (WB), color correction matrix (CCM), and gamma correction (Gamma). Finally, it outputs the imaging results in standard red-green-blue (RGB) or luminance-chrominance (YUV) format, forming a complete closed-loop data path from raw photosensitive data reception to corrected output.
[0063] Third Embodiment This embodiment provides an exemplary scheme for scene determination and parameter sequence retrieval. In this example, firstly, a frame-by-frame statistical operation is performed on the associated and bound raw pixel data to obtain an image statistical feature set. Then, a hierarchical scene matching determination is performed based on the work stage identifier as a priority dimension combined with the statistical features. Subsequently, candidate parameters for each stage are retrieved and matched according to the three-level index mapping rule. Finally, the target parameter sequence is obtained by chronological arrangement and verification, thereby accurately determining the target parameter sequence suitable for the entire current pathological slide imaging process. Step S20 includes steps B11 to B14: Step B11: Perform frame-by-frame statistical operations on the original pixel data associated with the information in the processing stage to obtain an image statistical feature set including brightness statistical features and tissue texture parameters.
[0064] Step B12: Using the working stage identifier of the processing stage information as a priority judgment dimension, and combining it with the image statistical feature set to perform hierarchical scene matching judgment, the image scene identifier corresponding to the frame data is determined.
[0065] Step B13: Based on the working stage identifier and the image scene identifier, and according to the three-level index mapping rules of working stage, image scene, and parameter configuration, retrieve and match the candidate parameters corresponding to the processing stage information in the image processing parameter set.
[0066] Step B14: Arrange the candidate parameters that have passed the verification according to the time sequence in the processing stage information to obtain the target parameter sequence.
[0067] Image statistical feature sets are multi-dimensional quantitative feature sets extracted from single-frame raw pixel data, reflecting the distribution of light intensity and the attributes of organizational content in an image. They are the core basis for scene determination. Examples include brightness statistical features, tissue texture parameters, saturated pixel ratio, and grayscale distribution uniformity. Brightness statistical features are a set of quantitative indicators characterizing the overall light intensity level and distribution pattern of a single-frame image, reflecting the exposure state and brightness distribution characteristics of the image. Examples include mean brightness, brightness variance, brightness histogram distribution, highlight ratio, and shadow ratio. Tissue texture parameters are a set of quantitative indicators characterizing the texture coarseness, edge density, and structural complexity of pathological tissue areas, reflecting the detailed features and distribution of tissue content in the image. Examples include texture intensity, edge density, tissue ratio, and detail richness.
[0068] Work phase identifiers mark the stage status of the imaging process node to which the current frame belongs, serving as a priority constraint dimension for scene determination. Examples include focusing phase identifiers, positioning and recognition phase identifiers, formal scanning phase identifiers, and quality review phase identifiers. Layered scene matching determination is a classification method that converges the determination range layer by layer according to priority and matches scene features level by level, improving the accuracy of scene recognition through multi-dimensional layered matching. Image scene identifiers mark the classification type of the imaging scene corresponding to the current frame, serving as a secondary index dimension for parameter retrieval. Examples include blank slide scenes, low-magnification tissue scenes, high-magnification cell scenes, edge transition scenes, and staining abnormality scenes.
[0069] The three-level index mapping rule is a retrieval rule system that maps sequentially through three levels: working stage, image scene, and parameter configuration. It is an indexing mechanism for quickly locating target parameters from a parameter set. Candidate parameters are image processing parameter sets adapted to the corresponding stage and scene, obtained through preliminary matching using the index rules. They are the basic parameter units for generating the target parameter sequence.
[0070] In this example, when performing frame-by-frame statistical operations on the raw pixel data to obtain the image statistical feature set, it can be done by performing full-frame synchronous statistics. Once all the complete pixel data for a single frame is ready, the entire frame of pixels is traversed at once to perform brightness distribution statistics and texture calculations, and a complete image statistical feature set is output uniformly. Alternatively, a row-level incremental streaming statistical method can be used, where row-level statistical accumulation is performed while receiving each row of the raw pixel data, accumulating the total brightness, texture gradient, and pixel count of the organized region row by row. Once the entire frame is received, the data is summarized to obtain the image statistical feature set, thus completing the acquisition of frame-level statistical features.
[0071] After completing the acquisition of the image statistical feature set, the hierarchical scene matching and judgment process is initiated. The working stage identifier is used as the priority judgment dimension to define the scene candidate range. Then, layer-by-layer feature matching is performed in combination with the image statistical feature set to determine the image scene identifier corresponding to the current frame. Next, based on the working stage identifier and the image scene identifier, the matching is retrieved in the full set of image processing parameters according to the three-level index mapping rule to obtain the candidate parameters corresponding to each processing stage. Finally, the candidate parameters that have passed the verification are arranged in order according to the temporal order in the processing stage information to generate the target parameter sequence. In this way, the matching accuracy and retrieval efficiency of the parameter sequence are improved through the progressive method of hierarchical judgment and three-level index retrieval, avoiding parameter adaptation deviation caused by insufficient single-dimensional judgment.
[0072] For example, there are two ways to obtain the target parameter sequence through hierarchical judgment and index retrieval. The first is a time-series serial matching retrieval. Based on the full-process stage time sequence in the processing stage information, the working stage identifiers of each stage are extracted sequentially starting from the first stage. Each extracted stage identifier defines the scene candidate range corresponding to that stage. Then, scene matching is performed in combination with the image statistical feature set of the corresponding frame to obtain the image scene identifier. Subsequently, the working stage identifier and the image scene identifier are used as index keys to retrieve the candidate parameters of that stage from the parameter set. After completing the single-stage parameter retrieval, the judgment and retrieval of the next stage are performed. After all stages are processed, all candidate parameters are summarized in time sequence, and the target parameter sequence is generated after performing full sequence verification. This method adopts a time-locked, stage-series serial judgment and hierarchical retrieval processing logic. By processing the imaging process time sequence step by step, it ensures the accurate adaptation of parameters of each stage to the corresponding scene, avoids cross-stage parameter confusion and scene mismatch problems, and ensures the temporal consistency between the parameter sequence and the imaging process.
[0073] The second method is multi-stage parallel clustering retrieval. This involves batch reading and global stage distribution parsing of the work stage identifiers for each processing stage in the entire process. Based on stage attributes, clustering is performed, grouping stages with similar imaging targets and parameter requirements into the same stage group and marking the stage boundaries within each group, generating multiple stage groups with no retrieval dependencies between them. Then, parallel scene determination and parameter retrieval processing are simultaneously initiated for all the divided stage groups. Within each stage group, scene matching is performed stage by stage, combining the corresponding image statistical feature set to obtain image scene identifiers. Candidate parameters for each stage within the group are retrieved according to a three-level indexing rule. After all parallel determination and retrieval for all stage groups are completed, the candidate parameters for all stages are summarized according to the overall process time sequence, and cross-group connection verification and full sequence consistency verification are performed to generate the final target parameter sequence. This method employs global stage clustering and multi-group parallel retrieval processing logic. By pre-clustering based on stage attributes, it pre-locks the set of stages with similar parameter requirements, reducing the number of repeated index matching and parameter verifications, and improving the overall generation efficiency of the entire process parameter sequence.
[0074] Further, please refer to Figure 4 , Figure 4 This is a diagram of the parameter group index architecture for this application. When the stage identifier plus scene identifier parameter group index mapping mechanism runs, according to the parameter group index architecture, the parameter configuration identifier (profile_id, profileidentifier) is used as the output of the mapping function between the stage identifier (stage_id, stage identifier) and the scene identifier (scene_id, sceneidentifier). That is, profile_id equals the result of the function operation between stage_id and scene_id (within parentheses f). The stage identifier layer includes four imaging processing stages: Auto Focus (AF), Localization / Barcode (LOC), Scan (SCAN), and Quality Check (QC). The scene identifier layer includes four image scene types: weak staining, deep staining, thick tissue, and edge blanking. Each stage identifier establishes a corresponding mapping relationship with all scene identifiers. Through the combination of these two levels of identifiers, the target parameter configuration identifier suitable for the current stage and scene can be uniquely determined, achieving accurate indexing and rapid matching of parameter groups across multiple stages and scenes.
[0075] For example, the ISP parameter group uses a three-level index of profile_id + scene_id + stage_id. stage_id represents the working stage such as focusing (AF), macro positioning / barcode (LOC), formal scanning (SCAN), and quality control (QC). scene_id represents the image scene such as weak staining, deep staining, thick tissue, tissue edges, and blank areas. The main parameter groups and application stages are shown in Table 1 below.
[0076] Table 1 Main parameter sets and application stages
[0077] Each parameter group includes at least: black level bias, white balance gain, CCM, Gamma / LUT, noise reduction intensity, sharpening radius and intensity, flat / dark field table reference, saturation protection threshold, and output color space. The parameter groups are stored in a local configuration file, loaded into memory at startup along with a version number, CRC, and applicable sensor model. Scene recognition is triggered directly during the working phase or by image statistics: AF / LOC / SCAN is switched by scan control. The SCAN sub-scene selects its scene_id based on the preview frame histogram, tissue proportion, RGB mean, saturated pixel ratio, and texture intensity.
[0078] Fourth embodiment This embodiment provides an exemplary scheme for parameter sequence arrangement and verification generation. In this example, candidate parameters are first modified for adaptability based on the imaging targets of each processing stage. Then, the verified candidate parameters are arranged according to the pathological slide processing sequence, and the effective nodes and switching boundaries of each stage are marked. Finally, a multi-dimensional verification of the entire sequence is performed to confirm the closed loop of the switching logic, thereby generating the target parameter sequence. This accurately obtains a target parameter sequence that adapts to each stage of the entire process and has reliable temporal connections. Please refer to... Figure 5 , Figure 5 This is a flowchart illustrating the fourth embodiment of the control method for pathological section imaging in this application. Step B14 includes steps C11-C13: Step C11: Based on the imaging target of the processing stage in the processing stage information, perform adaptation verification and correction on the candidate parameters corresponding to the processing stage to obtain the candidate parameters that pass the verification.
[0079] Step C12: Arrange the verified candidate parameters sequentially according to the processing time of the target pathological slide, and mark the stage activation node and switching boundary position corresponding to the candidate parameters to obtain the initial parameter sequence.
[0080] Step C13: Verify sensor model matching, parameter version unification, and data integrity of the initial parameter sequence. After confirming the closed loop of the full sequence switching logic, generate the target parameter sequence arranged in order of processing time.
[0081] Imaging targets are the core imaging quality indicators and functional goals preset for each processing stage, serving as the criterion for verifying the suitability of candidate parameters. Examples include the sharpness discrimination target in the focusing stage, the fine line recognition target in the positioning and identification stage, the color reproduction and detail preservation target in the formal scanning stage, and the artifact detection and correction target in the quality review stage. Suitability verification and correction is a process of performing specific verification and targeted correction on candidate parameters based on the stage imaging targets, ensuring the matching accuracy between parameters at each stage and their corresponding imaging targets. The stage activation node is the temporal position marker where a parameter begins to take effect in the corresponding stage, used to define the initial effective time of the parameter. The switching boundary position is the temporal boundary marker for parameter switching between adjacent stages, used to define the execution range of parameter switching.
[0082] The initial parameter sequence is an ordered set of parameters arranged in the processing sequence, carrying stage nodes and boundary markers; it is an intermediate product for generating the target parameter sequence. Sensor model matching is a verification process that checks the compatibility of the parameter configuration with the current imaging sensor model, ensuring that the parameters can be correctly recognized and executed by the hardware. Parameter version unification is a verification process that checks the consistency of parameter versions across all stages of the entire sequence, avoiding processing logic conflicts caused by mixing different versions of parameters. Data integrity is a verification process that checks the completeness and configuration of the parameter set fields, ensuring that the parameters can fully drive the entire image processing chain. Switching logic closed-loop verification checks the continuous, uninterrupted, and conflict-free state of parameter switching throughout the entire sequence, ensuring the reliability of the parameter switching sequence.
[0083] In this example, when performing adaptability verification and correction on candidate parameters based on the imaging target, it can be done in a stage-by-stage serial special-purpose verification manner. Candidate parameters and corresponding imaging targets for each stage are extracted sequentially according to the processing time order, special-purpose adaptability verification is performed item by item, and directional correction is completed simultaneously. Candidate parameters that pass verification are output stage by stage. Alternatively, a stage-by-stage parallel group verification method can be used. Stages with similar imaging targets are divided into the same verification group, and multiple groups of parallel verification and correction processes are started simultaneously. Each group independently completes the parameter verification and correction for its corresponding stage. After all groups have been processed, all candidate parameters that pass verification are summarized, thus completing the adaptability verification and correction of the candidate parameters.
[0084] After completing the adaptation verification and correction of candidate parameters, the initial parameter sequence construction process is initiated. All verified candidate parameters are arranged sequentially according to the processing time of the target pathological slides, and the corresponding stage activation nodes and switching boundary positions of each parameter are simultaneously marked, generating an initial parameter sequence with complete time-series markings. Next, sensor model matching verification, parameter version unification verification, and data integrity verification are performed on the initial parameter sequence in sequence. After confirming the closed loop of the full sequence switching logic, the target parameter sequence is generated. Through the progressive processing of hierarchical verification and time-series marking, the stage adaptation accuracy and time-series connection reliability of the target parameter sequence are improved, avoiding imaging anomalies caused by insufficient parameter adaptation or time-series misalignment.
[0085] For example, there are two ways to generate the target parameter sequence through adaptability verification and temporal arrangement. The first is a temporal serial stage-by-stage verification and arrangement. Based on the full-process stage time sequence in the processing stage information, candidate parameters and imaging targets corresponding to each stage are extracted sequentially from the initial stage. For each stage of candidate parameter extraction, a specific adaptability verification for the corresponding imaging target is performed. In the focusing stage, the sharpness discrimination adaptability of sharpening intensity and contrast gain is verified. In the positioning and recognition stage, the fine line recognizability adaptability of edge enhancement parameters is verified. In the formal scanning stage, the linkage adaptability of color reproduction parameters and flat field correction is verified. If the verification fails, directional correction is performed with the imaging target threshold as a constraint. After the single-stage verification and correction is completed, the parameters of that stage are added to the parameter sequence in sequence and the effective node and switching boundary are marked. Then, the verification and arrangement of the next stage are entered. After all stages are processed, the full sequence of sensor model matching, version unification and data integrity verification are performed. After confirming the switching logic closed loop, the target parameter sequence is generated. This method employs a time-locked, step-by-step serial verification and progressive arrangement processing logic. By processing the imaging process time step by step, it ensures the depth adaptation of parameters at each stage to the corresponding imaging target, avoids cross-stage parameter logic conflicts and boundary misalignment problems, and guarantees the temporal consistency of the parameter sequence and the imaging process.
[0086] The second method is staged clustering and parallel verification and arrangement. Global attribute parsing and clustering are performed on each processing stage of the entire process. Based on the imaging target type, parameter requirement characteristics, and switching features of each stage, clustering is performed to group stages with similar imaging targets and parameter logic into the same stage verification group. The relative temporal position of each stage within the group and the switching boundaries between groups are marked, generating multiple stage verification groups that are independent of each other. Then, verification correction and arrangement processing are simultaneously initiated for all the divided stage verification groups. Within each stage verification group, the adaptability verification and orientation correction for the corresponding imaging target are performed stage by stage. After the parameter verification of all stages within the group is completed, the parameters are arranged according to the temporal sequence within the group, and nodes and boundaries are marked. After the parallel verification and arrangement of all stage verification groups are completed, the parameter sequences of each group are spliced and integrated according to the temporal sequence of the entire process. Cross-group connection correction and full-sequence sensor model matching, version unification, and data integrity verification are performed. After confirming the closed loop of the full-sequence switching logic, the final target parameter sequence is generated. This method employs a processing logic of global stage clustering and multiple parallel verification arrangements. By clustering stage attributes in advance, it can lock in the stage set with similar imaging targets and parameter requirements in advance, reducing the loading of repeated verification rules and parameter adaptation calculations, and improving the overall generation efficiency of parameter sequences throughout the process.
[0087] Fifth embodiment This embodiment provides an exemplary scheme for phased parameter adaptability verification and correction. In this example, the candidate parameter subsets of each processing stage are first decomposed and matched with the imaging target threshold to generate a set of verification units. Then, the set of verification units is traversed to perform phased specific adaptability verification and mark defective parameter items. Subsequently, the defective parameters are corrected in a targeted manner with the imaging target threshold as a constraint. Finally, after completing the parameter consistency verification within the stage, the verified candidate parameters are integrated to obtain the candidate parameters that have passed the verification, thereby accurately completing the adaptability verification and targeted correction of candidate parameters at each stage. Please refer to... Figure 6 , Figure 6 This is a flowchart illustrating the fifth embodiment of the control method for pathological section imaging in this application. Step C11 includes steps D11-D14: Step D11: Decompose the candidate parameter subset corresponding to the processing stage, match the imaging target threshold of each processing stage, and obtain the verification unit set.
[0088] Step D12: Traverse the set of verification units, verify the sharpness discrimination adaptability of sharpening intensity and contrast gain during the focusing stage, verify the fine line recognizability adaptability of edge enhancement parameters during the positioning and recognition stage, verify the linkage adaptability of color reproduction parameters and flat field correction during the formal scanning stage, and mark all defective parameter items that fail to meet the adaptability standards.
[0089] Step D13: Based on the defect parameter item, perform directional correction with the imaging target threshold corresponding to the processing stage as a constraint to obtain the corrected parameter subsets for each stage.
[0090] Step D14: Perform intra-stage parameter consistency verification on the modified subset of parameters for each stage. After confirming that the parameters within the same stage are logically compatible, integrate them to obtain the candidate parameters that have passed the verification.
[0091] The candidate parameter subset is the set of all image processing parameters corresponding to a single processing stage, and it serves as the basic processing unit for adaptability verification. The imaging target threshold is the preset acceptable threshold for imaging quality indicators at each processing stage, and it serves as the quantitative benchmark for judging parameter adaptability. The verification unit set is a collection of verification units that correspond one-to-one with stages, parameters, and verification indicators; it is the overall processing object for performing phased, specialized verifications. Examples include verification units for the focusing stage, positioning and recognition stage, formal scanning stage, and quality review stage.
[0092] Sharpening intensity is a parameter that controls the degree of edge sharpening in an image, affecting the clarity and edge sharpness of the image. Contrast gain is a parameter that controls the extent of contrast enhancement in an image, affecting the tonal gradation and detail resolution of the image. Sharpness discrimination adaptability is the degree to which parameter configurations meet the sharpness discrimination requirements during the focusing stage; it is a core criterion for parameter verification during the focusing stage. Edge enhancement parameters are a set of parameters that control the intensity and range of edge enhancement in an image, affecting the recognizability of fine lines and edges. Fine line recognizability adaptability is the degree to which parameter configurations meet the fine line recognition requirements during the positioning stage; it is a core criterion for parameter verification during the positioning and recognition stage. Color reproduction parameters are a set of parameters that control the accuracy of color reproduction in an image, affecting the realism and consistency of the image's colors. Flat field correction is a process that corrects sensor response inhomogeneity, affecting the overall brightness and color uniformity of the image. Coordination adaptability is the degree to which color reproduction parameters and flat field correction parameters work together; it is a core criterion for parameter verification during the formal scanning stage. Defective parameters are parameters that fail the adaptability verification and are the targets for targeted correction.
[0093] Targeted correction is a process of adjusting defective parameters based on the imaging target threshold, ensuring that the parameters meet the imaging target requirements of the corresponding stage. Intra-stage parameter consistency verification verifies the logical compatibility and lack of conflict between parameters within the same stage, ensuring the reliability of parameter collaboration within the same stage. Parameter logical compatibility ensures that the value ranges, processing directions, and superposition of effects of parameters within the same stage are consistent, guaranteeing stable image processing operation within the stage.
[0094] In this example, when disassembling the candidate parameter subset and matching it with the imaging target threshold to obtain the verification unit set, a full synchronous disassembly and matching method can be used. This involves reading the candidate parameter subsets and corresponding imaging target thresholds from all processing stages at once, uniformly completing parameter disassembly and threshold matching, and generating complete verification unit sets in batches. Alternatively, a streaming, stage-by-stage incremental disassembly and matching method can be used. This involves sequentially reading the candidate parameter subsets and imaging target thresholds of each stage according to the processing sequence, completing parameter disassembly and threshold matching stage by stage, generating verification units stage by stage, and accumulating them to obtain the verification unit set, thereby completing the construction of the verification unit set.
[0095] After constructing the set of verification units, a phased, specialized adaptability verification process is initiated. The verification unit set is traversed, and specialized adaptability verification for each phase is performed sequentially. In the focusing phase, the sharpness discrimination adaptability of sharpening intensity and contrast gain is verified. In the positioning and recognition phase, the adaptability of fine line recognizability of edge enhancement parameters is verified. In the formal scanning phase, the linkage adaptability of color reproduction parameters and flat field correction is verified, and all defective parameter items that fail to meet the adaptability standards are simultaneously marked. Next, targeted corrections are performed on the defective parameter items using the imaging target threshold of the corresponding phase as constraints, resulting in corrected parameter subsets for each phase. Finally, intra-phase parameter consistency verification is performed on the corrected parameter subsets for each phase. After confirming logical compatibility of parameters within the same phase, they are integrated to obtain candidate parameters that pass verification. Through this progressive processing of layered verification and targeted correction, the phase adaptation accuracy and internal consistency of candidate parameters are improved, avoiding image quality degradation caused by insufficient parameter adaptation or logical conflicts.
[0096] For example, there are two ways to obtain the candidate parameters that pass verification through phased verification and targeted correction. The first is serial unit-by-unit verification and correction. According to the phase processing sequence bound to the set of verification units, starting from the beginning of the set, individual verification units are extracted sequentially to perform the corresponding phase-specific adaptability verification. After the adaptability verification of each verification unit is completed, it is simultaneously determined whether each parameter item in the unit meets the preset imaging target threshold requirements. If it meets the requirements, the corresponding parameter item is added to the qualified parameter set, and the number of qualified parameters in the phase is continuously accumulated. If it does not meet the requirements, it is marked as a defective parameter item, and targeted correction is performed simultaneously with the imaging target threshold as a constraint. In the focusing phase, the sharpening radius and contrast gain amplitude are adjusted; in the positioning phase, the edge enhancement weight and filtering coefficient are adjusted; and in the formal scanning phase, the linkage ratio of the color matrix and the flat field correction coefficient is calibrated. After the single-phase verification and correction is completed, the parameter consistency verification within the phase is performed. After confirming that the parameters in the same phase are logically compatible, the next phase of verification unit processing begins. After all verification units are processed, the results are summarized and integrated to obtain the candidate parameters that pass verification. This method employs a time-locked, unit-by-unit serial verification and real-time correction processing logic. By verifying and correcting the processing timing of each stage, it ensures the depth adaptation of parameters at each stage to the corresponding imaging target, avoids cross-stage parameter confusion and over-correction issues, and guarantees the stage adaptation accuracy and internal consistency of candidate parameters.
[0097] The second method is stage-based clustering parallel verification and correction. It performs a global read and stage attribute distribution analysis on the set of verification units. Based on the stage type, verification index characteristics, and parameter correlations of each verification unit, it performs clustering processing, dividing verification units with similar imaging targets and closely related parameters into the same verification cluster. The relative positions of units within each cluster and the boundaries between clusters are marked, generating multiple verification clusters that are independent of each other. Then, parallel verification and correction processing is simultaneously initiated for all the partitioned verification clusters. Within each verification cluster, the specific adaptability verification for the corresponding stage is performed one by one. All defective parameter items within the cluster are marked and targeted corrections are performed. After the verification and correction of all units within the cluster are completed, intra-cluster parameter consistency verification is performed. After all parallel verification and correction of all verification clusters are completed, the corrected parameter subsets of each cluster are aggregated, and cross-cluster parameter logic verification and full parameter integration are performed to generate candidate parameters that pass verification. This method employs a global stage clustering and multi-cluster parallel verification and correction processing logic. By performing stage attribute clustering in advance, it locks in the set of verification units with similar correlation between the imaging target and parameters, reducing the repeated loading of verification rules and parameter correlation calculations, and improving the overall processing efficiency of full-stage parameter adaptability verification and correction.
[0098] Furthermore, in the specific implementation of the multi-stage, multi-scene parameter group indexing and dynamic switching mechanism, one aspect is the switching to the AF parameter group scene during the focusing stage. When the scan control enters the coarse focusing stage and the stage identifier is AF, and the current parameter configuration identifier is SCAN, the system issues a switching request (switch_request). The AF parameter group is written to buffer B (buffer_B, buffer B) between frames and the active parameter configuration (active_profile) is switched. The next frame is marked as a guard frame (guard_frame) and does not participate in the sharpness calculation. After the sharpness peak-to-valley difference of three consecutive frames meets the threshold, it is confirmed to take effect. In the end, the focusing success rate is significantly improved and only one guard frame is discarded, which takes about sixteen milliseconds at a frame rate of sixty frames per second (fps). Secondly, in the formal scan, the SCAN sub-parameter group is switched according to tissue staining. When the preview frame with stage identifier SCAN and tile identifier (tile_id, tile identifier) of 56 displays dark stained tissue with a tissue ratio of 68% and low average brightness, the scene is identified as dark staining. The matching parameter configuration is queried and identified as SCAN dark staining mode. Switching is performed between tile boundary frames and the guard frame is discarded. The image signal processor (ISP) simultaneously increases the gamma correction amplitude and noise reduction intensity and reduces the sharpening intensity. Finally, the color deviation of the tile is significantly reduced compared to the fixed parameters, the color style inside the tile is consistent, and the switching occurs at the boundary. Thirdly, in the scenario of parameter switching failure and rollback, when the saturation pixel ratio exceeds the upper limit for multiple consecutive frames after switching to SCAN thick organization mode, the confirmation of effectiveness fails and the system rolls back to the stable parameter configuration (stable_profile) and records the switch log (switch_log). The result is marked as rollback and the reason for rollback is saturation exceeding the limit. If there are three consecutive rollbacks, the safe parameter configuration (SAFE, Safe profile) is locked and recalibration is prompted. In the end, no half-frame color mixing artifacts appear in the image output and the scanning can continue to run. The whole mechanism ensures the safety, accuracy and imaging continuity of dynamic parameter switching in multiple stages and multiple scenarios through a complete closed loop of two-level identification index, inter-frame double buffer atomic switching, protection frame isolation and confirmation of effectiveness rollback.
[0099] Sixth Embodiment This embodiment provides an exemplary scheme for atomic switching of inter-frame double-buffered parameters. In this example, the parameter group to be activated is first extracted from the target parameter sequence, and the parameter loading process is started during the inter-frame idle period. Then, the parameter group to be activated is written into the target active buffer of the double-buffered architecture and the lock is verified. Subsequently, before the end of the inter-frame idle period, the buffer pointer is atomically switched and the protected frame is marked. Finally, after confirming that there is no risk of misuse, the target parameter configuration is output and written to the switching traceability log, thereby safely and reliably completing the atomic switching and activation of inter-frame parameters. Step S30 includes steps E11 to E14: Step E11: Extract the parameter group to be activated corresponding to the current stage switching node from the target parameter sequence, detect the frame transmission status of the original photosensitive data, and start the parameter loading process during the inter-frame idle period between the frame end identifier of the current frame and the start identifier of the next frame.
[0100] Step E12: After starting the parameter loading process, the parameter group to be effective is written into the target active buffer in the double buffer architecture, and the target active buffer is locked after the verification is successful.
[0101] Step E13: Before the end of the inter-frame idle period, point the currently active buffer pointer to the target active buffer, mark the first frame image after the switch as a protection frame and associate it with the parameter switching identifier.
[0102] Step E14: After confirming that the parameter switching process is entirely within the inter-frame period and there is no risk of misuse, the parameter content of the target activity buffer is used as the currently effective target parameter configuration, and the switching frame number, parameter version and switching result are written to the switching traceability log.
[0103] The parameter set to be activated is the set of image processing parameters that the current switching node needs to load and take effect; it is the target loading object for parameter switching. The stage switching node is the timing position of parameter switching between adjacent processing stages in the imaging process; it is the time node that triggers parameter loading and switching. The frame transmission status is the real-time status of the raw photosensitive data transmitted frame by frame, used to identify the start and end times of the inter-frame idle period. The frame end identifier is a frame boundary identifier marking the end of single-frame data transmission; it is the start trigger signal for the inter-frame idle period. The frame start identifier is a frame boundary identifier marking the start of single-frame data transmission; it is the end trigger signal for the inter-frame idle period. The parameter loading process is the execution process that writes the parameters to be activated into the buffer and completes verification; it is used to complete the preparatory work before parameter switching.
[0104] The dual-buffer architecture is a cache scheduling architecture that sets up two independent parameter buffers to physically separate parameter loading and activation, ensuring the atomicity and safety of parameter switching. The target active buffer is the parameter buffer where the parameter group to be activated is written and awaits activation; it is the target storage area for parameter loading. The active buffer pointer is a pointer variable pointing to the currently active parameter buffer, used to control which set of parameters the image processing pipeline reads. The guard frame is the first image frame after the parameter switch, used to isolate potential instability caused by the switch and not included in the final imaging output. The parameter switch identifier is identification information that marks the parameter switch event associated with the image frame, used to trace the scope of the parameter switch's impact.
[0105] The risk of parameter misuse refers to the abnormal state during parameter switching where some pixels within the same frame use the old parameters while others use the new parameters. This is a core indicator for assessing parameter switching safety. The switching traceability log records detailed information about parameter switching events for post-event traceability and anomaly investigation. This includes information such as the switching frame number, parameter version, switching result, switching time, and cause of the anomaly.
[0106] In this example, when detecting the frame transmission status and initiating the parameter loading process during the inter-frame idle period, it can be done by triggering the start of the process at the end of the frame. When the end-of-frame marker of the current frame is detected, it is immediately determined that the inter-frame idle period has begun, and the parameter loading process is started synchronously, utilizing the entire inter-frame idle period to complete parameter writing and verification. Alternatively, it can be done by pre-scheduling and predictive start. Based on the target parameter sequence and the current frame transmission rate, the arrival time of the next inter-frame idle period is predicted, and the parameter group is pre-read and prepared in advance. When the end-of-frame marker is triggered, the loading process is started immediately, thereby fully compressing the effective loading time of the inter-frame period.
[0107] After initiating the parameter loading process, the parameter group to be applied is written to the target active buffer in the dual-buffer architecture. Parameter integrity, version consistency, and sensor compatibility checks are performed. Once all checks pass, the content of the target active buffer is locked. Next, before the end of the inter-frame idle period, an atomic switch of the buffer pointer is performed, setting the active buffer pointer to the target active buffer. Simultaneously, the first frame image after the switch is marked as a protection frame and associated with a parameter switch identifier. Finally, after confirming that the parameter switch occurs entirely within the inter-frame period and there is no risk of parameter misuse, the parameter content of the target active buffer is used as the currently effective target parameter configuration. The switch frame number, parameter version, and switch result are written to the switch traceability log. This progressive mechanism of dual-buffer physical separation and inter-frame atomic switching ensures the temporal security and atomicity of parameter switching, preventing imaging anomalies caused by intra-frame parameter misuse.
[0108] For example, there are two ways to obtain the target parameter configuration through inter-frame double-buffered atomic switching. The first is single-step atomic switching execution. According to the switching node timing in the target parameter sequence, the parameter group to be effective corresponding to the current switching node is extracted from the sequence. The frame transmission status of the original photosensitive data is monitored in real time, and the frame end marker is waited for the inter-frame idle period to be triggered. After the inter-frame idle period starts, the parameter group to be effective is completely written into the target active buffer in the double-buffered architecture. Parameter integrity verification, version consistency verification, and sensor compatibility verification are performed simultaneously. After all verifications pass, the content of the target active buffer is locked. At a fixed time before the end of the inter-frame idle period, a single buffer pointer jump operation is performed to point the active buffer pointer to the verified and locked target active buffer. At the same time, the next frame is marked as a protection frame and associated with the parameter switching marker. After the switching is completed, it is confirmed that the entire process is within the inter-frame period and there is no risk of misuse. The complete parameter content of the target active buffer is read as the currently effective target parameter configuration, and the switching frame number, parameter version, and switching result are simultaneously written to the switching traceability log. This method employs inter-frame locked single-step atomic jump and instantaneous switching logic. By switching pointers once during the idle period of the entire frame, it completely avoids the problems of mixed use of intra-frame parameters and half-frame transition, ensuring the absolute atomicity and timing safety of parameter switching.
[0109] The second approach is a step-by-step pre-ready fast handover. This involves global handover node parsing and pre-scheduling planning for the target parameter sequence. Based on the current frame transmission rate and the parameter size of each handover node, it predicts the available duration of the inter-frame idle period and the parameter loading time for each node. One frame cycle in advance, it initiates the pre-loading and pre-verification process for the parameter group to be effective, pre-writing the parameters into the target active buffer and completing full verification and locking. When the inter-frame idle period of the corresponding handover node arrives, only the register group fast handover and buffer pointer update operations are performed, simultaneously associating the protection frame marker with the parameter handover identifier, completing all handover actions in a very short time. After handover, a timing safety confirmation is performed, checking whether the handover operation is entirely within the inter-frame period. After confirming there is no risk of half-frame parameter mixing, the parameter content of the target active buffer is used as the currently effective target parameter configuration, and the handover frame number, parameter version, pre-loading status, and handover result are simultaneously written to the handover traceability log. This method employs a global pre-scheduling and prediction and step-by-step pre-ready fast switching processing logic. By pre-loading and pre-verifying parameters, the time-consuming parameter writing and verification operations are distributed to the preceding frame period, compressing the actual switching time in the inter-frame period and adapting to high frame rate imaging scenarios with extremely short frame intervals.
[0110] Further, please refer to Figure 7 , Figure 7 This is a state diagram showing the dynamic switching of parameters in this application. The dynamic switching state machine for Image Signal Processor (ISP) parameters is referenced below. Figure 7 The entire process consists of seven states: idle, requesting a switch, waiting for frame boundaries, loading parameters, guarding the guard frame, confirming the effect, and rolling back in case of an error. The state machine initially operates in the idle state. Upon receiving a switch request, it first compares the target parameter configuration identifier (profile_id) with the current value. If they match, the idle state is maintained without switching; otherwise, it enters the waiting for frame boundaries state. When the inter-frame idle period between the end of the first frame (FE) and the start of the next frame (FS) arrives, the system enters the loading parameters state. The target parameters are written to the double-buffered inactive buffer B, and a cyclic redundancy check (CRC) is performed. If the check passes, the active parameter configuration (active_profile) is atomically switched, and the parameter configuration identifier is written to the frame context of the next frame. After the switch is complete, the system enters the guard frame state. The first frame after the switch is marked as a guard frame, which can be discarded or used only for statistical calculations. The double-buffered AB architecture provides physical caching support for this state. Subsequently, the system enters the activation confirmation state, requiring multiple consecutive frames to confirm that the parameter configuration identifiers are consistent, and that the average brightness change rate, saturation pixel ratio, and color deviation are all within the preset tolerance range. For example, the brightness change is less than 10%, the saturation ratio is lower than the allowable upper limit, and the color deviation is less than the threshold. When the number of consecutive confirmation frames is three, if all conditions are met, the system is considered to have successfully activated and returns to the idle state. If any indicator exceeds the tolerance range during the activation confirmation process, the system enters the abnormal rollback state, rolls back to the stable parameter configuration (stable_profile), and records the switch log (switch_log). After the rollback is complete, the system returns to the idle state. The full-state machine achieves safe, reliable, and seamless dynamic switching of ISP parameters through a multi-level protection mechanism of double-buffered atomic switching, protective frame isolation, and multi-frame activation confirmation.
[0111] Seventh Embodiment This embodiment provides an exemplary scheme for abnormal rollback and fault fallback protection after parameter switching. In this example, multi-dimensional image quality indicators are first extracted from multiple consecutive frames of images after parameter switching, and the effective status is determined by comparing them with a stable threshold. After identifying the abnormality, the parameter buffer pointer is rolled back in the inter-frame window to restore the original imaging configuration. The switching log is stored simultaneously, and the rollback frequency is counted. When the number of rollbacks reaches a threshold, the safety parameters are locked, automatic switching is terminated, and a recalibration reminder is pushed, thereby constructing an abnormal fallback closed-loop mechanism for the entire parameter switching process. Please refer to Figure 8 , Figure 8 This is a flowchart illustrating the seventh embodiment of the control method for pathological slide imaging in this application. Following step E13, steps F11-F14 are also included: Step F11: Extract the average brightness, saturated pixel ratio, and color deviation index from each of the consecutive frames of images after parameter switching, and compare them with the effective and stable threshold to obtain the result of the parameter effective status determination.
[0112] Step F12: If the parameter effectiveness status determination result is that the parameter effectiveness is abnormal, a rollback operation is triggered during the current inter-frame idle period to switch the target active buffer pointer back to the active buffer corresponding to the stable parameter group and restore the stable imaging parameter configuration before the switch.
[0113] Step F13: Write the parameter information, the cause of the exception, and the rollback execution result of this switch into the switch traceability log, and update the cumulative number of consecutive rollbacks and exception type statistics.
[0114] Step F14: When the number of consecutive rollbacks reaches the preset rollback threshold, lock to the safe default parameter group and terminate the automatic parameter switching process, and output a parameter recalibration prompt to ensure stable operation of the imaging process.
[0115] The average brightness is a quantitative statistical indicator characterizing the overall exposure level of a single frame image, used to measure whether the overall brightness of the image conforms to the preset imaging specifications after parameter switching. The saturated pixel ratio is the proportion of pixels in the image whose brightness exceeds the sensor's dynamic response limit, used to identify overexposure distortion-type imaging faults. Color deviation is the color difference between the current frame's color rendering result and the standard reference color, used to verify the effectiveness of color reproduction parameter adaptation. The effective stability threshold is a pre-defined reasonable range of image quality indicators, serving as the quantitative judgment boundary for determining whether new parameters are functioning correctly. The parameter effectiveness status judgment result is the final conclusion, obtained after comparing multiple frames and multi-dimensional indicators, indicating whether the parameter adaptation is normal or abnormal.
[0116] The switchover traceability log is a structured record file that retains full information about each parameter switchover event, used for subsequent fault tracing, version rollback, and problem localization. The consecutive rollback count is the cumulative count of parameter rollback operations automatically triggered without manual intervention within a single scan process. The anomaly type statistics are a statistical ledger that categorizes rollback causes according to fault types such as saturation exceedance, brightness offset, and color distortion. The preset rollback threshold is a critical value that limits the maximum allowed number of consecutive automatic rollbacks, used to determine whether to enter the highest-level fault fallback strategy. The safety default parameter group consists of standardized basic parameters pre-calibrated at the factory and adapted to most slice scenarios, serving as a backup imaging configuration for extreme anomaly scenarios. The parameter recalibration prompt is an alarm interaction command pushed to the external control module and the host computer, reminding staff to recalibrate the scene index library and parameter configuration library.
[0117] In this example, when extracting multi-frame image metrics and determining the effective status of parameters, a frame-by-frame sequential comparison can be performed. Strictly following the image frame output sequence, the three image quality metrics are extracted frame by frame from the first frame after the switch to the Nth subsequent frame. Each extracted frame is immediately compared with the effective stability threshold. After a preset number of consecutive frames have been verified, all comparison results are aggregated to generate the final effectiveness determination result. Alternatively, a multi-frame parallel batch acquisition and comparison method can be used. This involves simultaneously reading multiple frames of image data cached in the buffer after the parameter switch, extracting the average brightness, saturated pixel ratio, and color deviation of all frames in parallel, performing threshold comparisons in batches, and then integrating the batch verification results to generate the parameter effectiveness determination result. This completes the stability verification and status determination after the parameter switch.
[0118] After determining the parameter effectiveness status, if the determination result indicates an abnormal parameter effectiveness, the current inter-frame idle time slot is immediately preempted to perform a buffer pointer rollback operation. This switches the pipeline parameter reading pointer back to the original buffer bound to the stable parameter group, restoring the parameter configuration to the stable imaging state before the handover. Subsequently, the parameter information carried by this handover, including the parameter number, scene identifier, stage identifier, and specific out-of-bounds indicators, along with the abnormal trigger cause and the rollback operation execution result, is written to the handover traceability log. Simultaneously, the continuous rollback counter is incremented, and the abnormal statistics entries under the corresponding fault category are updated. The system continuously monitors the continuous rollback count. When the count reaches the preset rollback threshold, the system forcibly locks the global parameters to the safe default parameter group, closes the program branches for automatic retrieval and matching and dynamic parameter switching, and sends parameter recalibration interaction prompts to the host computer and the scanning control terminal. In this way, through a layered anomaly handling logic, the system provides three levels of protection: single-round rollback, log recording, and extreme condition fallback locking. This avoids the problem of batch imaging scrapping caused by parameter mismatch, improves the fault tolerance and robustness of the entire dynamic parameter switching architecture, and prevents the failure of the entire pathology slide scan data due to parameter adaptation errors in a single scenario.
[0119] For example, the overall implementation of rollback fallback protection after parameter switching anomalies includes two methods. The first is a time-bound frame-by-frame serial verification rollback mechanism. The protection frame number marked when the parameter switching is completed is used as the starting frame marker. Starting from this frame, the processed imaging data of each subsequent frame is read sequentially according to the image output time sequence. The average brightness, saturated pixel ratio, and color deviation are calculated frame by frame. A single-frame verification marker is temporarily stored after each frame's threshold comparison is completed, until all verifications for the set number of consecutive frames are completed. If any frame's indicator exceeds the effective stable threshold range, the parameter effectiveness is directly determined to be abnormal. A rollback command is initiated by locking the idle time slot between the next frames. The active buffer pointer is atomically modified to point to the cache area corresponding to the stable parameters. The entire rollback operation is limited to the frame interval, preventing half-frame color mixing artifacts caused by simultaneously reading both old and new sets of parameters in a single frame. After the rollback is completed, the profile number, stage identifier, scene identifier, and out-of-bounds indicator items of this switch are disassembled as parameter information. These, along with the anomaly reason field and rollback success identifier, are written to the switching traceability log. The continuous rollback counter is incremented, and a new statistical record is added under the corresponding anomaly category. Once the continuous rollback counter accumulates to the preset threshold, the system writes a lock flag, forcibly binds the global ISP parameters to the safe default parameter group, blocks all subsequent automatic parameter retrieval and double-buffer switching commands, and sends a pop-up window and pushes a parameter recalibration prompt in the form of a message to the upper-layer business module. This method relies on frame-by-frame progressive verification based on the frame output timing. Each step of judgment and handling is aligned with the inherent timing of the imaging pipeline, without disrupting the original data stream processing order. Log recording and counter accumulation are executed step by step following the single-frame processing flow. The logical link is clear, facilitating subsequent fault tracing and perfectly matching the timing characteristics of pathological slide streaming scanning.
[0120] The second approach is a batch verification and clustering mechanism using a cache queue. After parameter switching, subsequent consecutive frames are stored in an on-chip high-speed cache queue. Instead of real-time frame-by-frame verification following the pipeline, an independent parallel verification thread is started to read all cached frames in the queue at once, extracting the three types of image quality metrics from all frames in parallel. After batch threshold comparisons, cluster analysis is performed on all verification results. If more than half of the frames in the queue exceed the limits, the parameter is deemed abnormal, and a buffer pointer rollback is executed uniformly in the next frame window. If only a few frames occasionally exceed the limits, it is determined to be transient noise interference, and no rollback is triggered, only a single abnormal record is recorded in the log. For switching events confirmed to require rollback, parameter information, abnormal causes, and rollback results are batch-written into the switching traceability log, and the continuous rollback count and multi-type abnormal statistics ledger are batch-updated. When the total number of continuous rollbacks reaches the threshold, a global parameter locking command is directly issued to load the safe default parameter group, the parameter index retrieval thread and the double-buffered switching scheduling thread are shut down, and multi-channel parameter recalibration reminders are synchronously output to the host computer, local display screen, and scanning control terminal. This method leverages a cache queue to separate the verification process from the main imaging pipeline, uses parallel threads to distribute the computational power of multi-frame index calculations, reduces the load on the main thread, and filters out erroneous rollback operations caused by occasional noise through clustering, reducing unnecessary parameter switching. This improves the overall efficiency of the scanning pipeline while ensuring the reliability of anomaly handling.
[0121] Furthermore, the entire process parameter scheduling is completed based on the dynamic switching state machine of the Image Signal Processor (ISP). A dual-buffering mechanism is employed: buffer A stores currently active parameters, and buffer B stores parameters to be loaded. After writing the parameters to be loaded into buffer B, the Cyclic Redundancy Check (CRC) must be verified to be completely consistent with the configuration file content before the active parameter configuration (active_profile, active profile) can be switched, preventing parameters from being tampered with or overwritten during ISP parameter reading. Parameter switching can be initiated by five conditions: work phase switching, changes in scan area type, image statistical results triggering, user manual recalibration, and quality verification failure. In formal scanning scenarios, parameter switching is prioritized at tile or frame boundaries. Higher frequency and faster switching are supported during the focusing phase. The guard frame generated after switching does not participate in the sharpness fitting curve calculation process. The system distinguishes between two independent calibration logics for focus white balance and scan white balance. It uses a blank slide to acquire single-frame image data, with the green channel (G, Green) as the reference channel. The white balance gain coefficient is calculated according to the pixel mean of each channel (R, Red), green channel, and blue channel (B, Blue). The calibrated gain parameters are persistently stored on disk. Flat field correction is performed in conjunction with the formal scan parameter group (SCAN profile group). The correction formula is: the corrected pixel value (pixel_corrected) equals the original pixel value (pixel_raw) minus the dark level value (dark), then divided by the flat field reference value (flat) minus the dark level value, and finally multiplied by the target brightness value (target_brightness). This correction operation can be accelerated by progressive parallel processing on the graphics processing unit (GPU) side.The system is configured with three levels of rollback strategies: when the parameter file is corrupted, it rolls back to the factory default parameter configuration (profile, profile identifier); when the image statistical quality indicators are abnormal, it rolls back to the stable parameter configuration (stable_profile); if the number of consecutive automatic rollbacks exceeds a preset threshold, it locks the safety backup parameter group (SAFE, Safeprofile) and sends a parameter recalibration prompt to the host computer. All parameter switching events generate a switch log (switch_log), and the log fields include timestamp, frame number (frame_id, frame identifier), parameter configuration identifiers before and after the switch (old / new_profile, old / new profile identifier), stage identifier (stage_id, stage identifier), scene identifier (scene_id, scene identifier), switch execution result (result), and rollback reason (rollback_reason). This fully realizes closed-loop control of parameter loading, inter-frame atomic switching, white balance linkage calibration, parallel flat field correction, and multi-level anomaly rollback tracing.
[0122] Eighth embodiment This embodiment provides an exemplary scheme for the integration and output of end-to-end image processing and imaging results. In this example, invalid data in the protection frame is first removed based on the target parameter configuration, and color calibration and flat field correction are performed to obtain a corrected image frame. Then, multi-dimensional image quality indicators are extracted and compared with a stable threshold to complete the parameter validity verification. After the verification is passed, the image frame is bound with the parameter identifier and frame context to generate a valid imaging frame. Finally, spatial alignment and abnormal frame removal are performed according to the scanning sequence, and the complete target imaging result is stitched and integrated to output, thereby obtaining pathological slide imaging data with stable parameter adaptation, traceability, and continuous and complete images. Step S40 includes steps G11~G14: Step G11: Using the target parameter configuration as the processing benchmark, invalid frame data marked as protection frames are removed, and color calibration and flat field correction are performed on the valid original image frames in sequence to obtain valid corrected image frames.
[0123] Step G12: Compare the average brightness, color deviation, and texture consistency index of the effective corrected image frame with the index stability threshold range item by item to obtain the verification result of the parameter configuration taking effect.
[0124] Step G13: When the verification result shows that the parameter configuration is stable and effective, the effective corrected image frame is associated and bound with the corresponding parameter configuration identifier and the frame context information to generate an effective imaging frame.
[0125] Step G14: Arrange and spatially align the effective imaging frames in an orderly manner according to the scanning sequence of the pathological sections, remove discrete abnormal frames, and integrate them to generate the target imaging result.
[0126] The guard frame is the transitional image frame marked as the first frame after parameter switching. It is considered invalid frame data with a risk of image quality fluctuation and needs to be directly discarded and not included in the final image output. The valid original image frame is the original photosensitive image data with complete pixel information and without image quality correction after removing the guard frame. Color calibration is an image processing step that uses white balance and color correction matrix parameters to restore color and correct color differences. Flat field correction is a process that addresses the problem of uneven sensor pixel response by using pre-calibrated flat field parameters to correct brightness uniformity. The valid calibrated image frame is a single frame image data after color calibration and flat field correction standardization processing.
[0127] Texture consistency index is a quantified value measuring the overlap of texture details and edge distribution between adjacent frames, used to determine if there are abrupt changes or discontinuities in the image. The index stability threshold range is a pre-defined reasonable upper and lower limit range for the allowable fluctuations of various image quality indices, serving as a quantitative basis for determining whether parameters are functioning normally and stably. The parameter configuration effectiveness verification result is a conclusion drawn from comparing multiple indices, determining whether the parameter adaptation is functioning normally or abnormally ineffective. The parameter configuration identifier is a unique identifier that identifies the complete set of parameters used in the current frame, used for end-to-end traceability of imaging data. Frame context information is a set of metadata such as the single-frame acquisition stage, frame number, exposure gain, and sensor mode, used to bind image and acquisition scene information.
[0128] A valid imaging frame is a standardized frame data unit that integrates image pixel data, parameter traceability identifiers, and acquisition metadata. Scanning sequence refers to the order in which the pathological slide stage moves row by row and tile by tile to acquire images. Spatial alignment is a stitching operation that maps discrete single-frame images to their corresponding positions on the global slide canvas based on the scan acquisition coordinates. Discrete abnormal frames are invalid single-frame images with large areas of overexposure, defects, or miscutting; these need to be filtered out to avoid final imaging flaws. The target imaging result is a global panoramic imaging file of the slide generated after stitching and aligning all valid frames and removing abnormal frames.
[0129] In this example, when removing guard frames based on the target parameter configuration and performing correction processing to obtain valid corrected image frames, the process can be performed sequentially frame by frame. Following the image acquisition and output sequence, frame marker information is identified frame by frame. Guard frames are discarded, skipping subsequent processing steps. Color calibration and flat-field correction are then performed sequentially on the remaining valid original frames, outputting the processed valid corrected image frames one by one. Alternatively, a pipelined parallel streaming processing approach can be used. Invalid frame filtering, color calibration, and flat-field correction are separated into three parallel pipelines. The output data from the previous stage is directly fed into the next stage module. Guard frames are removed while the two correction operations are performed simultaneously, eliminating the need to process each frame completely before moving to the next. This continuous batch generation of valid corrected image frames completes the batch generation of corrected frames.
[0130] After generating valid corrected image frames, a multi-dimensional indicator verification process is initiated. Three core indicators—average brightness, color deviation, and texture consistency—are extracted from each frame and compared item by item with preset stable threshold ranges. The results of multiple frame comparisons are then aggregated to generate a verification result confirming the parameter configuration is effective. If the parameter configuration is determined to be stable and effective, a unique key-value strong association is created between each corrected image frame and its corresponding parameter configuration identifier and frame context information, generating a traceable valid imaging frame. Finally, following the sequence of hardware scanning of pathological slides, global canvas space coordinate mapping and alignment are performed on all valid imaging frames. Discrete and abnormal frames with image distortion are screened and removed, and all remaining frames are seamlessly stitched together to generate the final target imaging result. This layered processing—including pre-processing invalid frame filtering, intermediate parameter stability verification, back-end traceability binding, and global stitching—avoids image jumps caused by parameter switching, while simultaneously providing complete traceability for each frame of imaging data, improving the reliability and standardization of the final output image.
[0131] For example, there are two ways to generate target imaging results through end-to-end processing integration. The first is a time-locked serial step-by-step processing scheme, which follows the acquisition sequence of the physical scanning of the pathological slide stage and receives the raw image data stream frame by frame. For each received frame, the frame header marker is read first. If it is determined to be a protected frame, the frame data is discarded directly and does not enter the subsequent ISP correction pipeline. If it is not a protected frame, the currently locked target parameter configuration is retrieved, and color calibration and flat field correction operations are performed sequentially to generate a single effective corrected image frame. Then, the three image quality indicators of each frame are extracted and compared with the threshold range item by item, and a single-frame verification mark is retained. When all indicators fall within the threshold range for a consecutive preset number of frames, the parameter configuration is officially deemed effective and the verification is passed. Then, using the frame sequence number as the associated primary key, the frame pixel image, parameter configuration identifier, and frame context metadata are written into the binding structure to generate a standardized effective imaging frame, which is stored in the global canvas cache according to the acquisition sequence. After single-tile or single-line scanning acquisition is completed, the acquisition coordinates of all valid imaging frames in the buffer are read, and frame-by-frame spatial alignment is completed. Frames with pixel defects, large-area saturation, or other discrete abnormalities are traversed and removed. After single-line / single-tile stitching is completed, the next batch of frame data is received and processed in a loop until the entire slice is scanned, at which point all slices are merged, and the complete target imaging result is output. This method perfectly matches the hardware acquisition timing sequence, performing sequential processing step by step. Each step of data flow is executed according to the acquisition timing sequence, preventing frame order errors and coordinate misalignment. Source tracing and binding are completed synchronously with single-frame processing, and the clear logical link facilitates segmented troubleshooting of imaging faults, making it suitable for conventional slice uniform-speed scanning scenarios.
[0132] The second approach is a segmented parallel batch integration processing scheme. The pathological slide scanning area is pre-divided into multiple independent tile-like regions with no coordinate overlap. Each tile corresponds to a batch of continuously acquired image frames. For the batch of raw frame data within a single tile, a multi-threaded parallel task is initiated to batch identify all protected frames and uniformly remove them. The remaining valid raw frames are allocated to multiple computing cores for parallel color calibration and flat field correction, generating all valid calibrated image frames within the tile. Three image quality indicators are extracted in batches for all calibrated frames within the tile, and threshold comparison and parameter validity determination are performed in batches. After the overall tile verification passes, the association and binding of all image frames, parameter identifiers, and frame contexts within the tile are completed in batches, generating a set of valid imaging frames at the tile level. A parallel spatial alignment thread is initiated for all tile imaging frame sets. Based on the preset global coordinates of the tile, canvas mapping and arrangement are completed in batches. Discrete abnormal frames within each tile are screened in batches and uniformly removed. After all tiles are stitched together in parallel, edge fusion and alignment between tiles are performed. Finally, all tile imaging data are merged to generate the overall target imaging result. This method relies on the splitting of tasks to achieve parallel computing across multiple links in the entire chain, which greatly reduces the latency of serial single-frame processing. At the same time, it uses the slice as the smallest unit for batch verification and binding, reducing the overhead of repeated judgments, and is suitable for high-throughput imaging scenarios of high-speed continuous scanning of large-size pathological slices.
[0133] This application provides a control device for pathological slide imaging, the control device for pathological slide imaging includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the pathological slide imaging control method in the first embodiment described above.
[0134] The following is for reference. Figure 9 The diagram illustrates a structural schematic of a control device suitable for implementing pathological slide imaging in the embodiments of this application. The control device for pathological slide imaging in the embodiments of this application may include, but is not limited to, mobile terminals such as industrial control motherboards and embedded core control boards, as well as fixed terminals such as image signal processing boards, image sensor driver boards, and image acquisition cards. Figure 9 The control device for imaging pathological slides shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0135] like Figure 9As shown, the control device for pathological slide imaging may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the control device for pathological slide imaging. The processing unit 1001, the read-only memory 1002, and the RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the pathology slide imaging control equipment to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows a pathology slide imaging control equipment with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0136] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0137] The pathological slide imaging control device provided in this application, employing the pathological slide imaging control method described in the above embodiments, can solve the technical problem of poor imaging quality of pathological slides. Compared with the prior art, the beneficial effects of the pathological slide imaging control device provided in this application are the same as those of the pathological slide imaging control method provided in the above embodiments, and other technical features in this pathological slide imaging control device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0138] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0139] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0140] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the control method for pathological slide imaging in the above embodiments.
[0141] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0142] The aforementioned computer-readable storage medium may be included in the control device for pathological slide imaging; or it may exist independently and not be assembled into the control device for pathological slide imaging.
[0143] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the pathological slide imaging control device, the pathological slide imaging control device: based on the original photosensitive data corresponding to the target pathological slide, associates and binds the frame data in the original photosensitive data with the corresponding frame context information to obtain the processing stage information corresponding to the frame data; performs scene determination based on the processing stage information and image statistical features, and determines the target parameter sequence by combining index rules; verifies the target parameter sequence during the inter-frame idle period, and atomically switches the effective parameter configuration through a double buffering mechanism to obtain the target parameter configuration; performs full-link image processing according to the target parameter configuration, and outputs the target imaging result after verifying and confirming that the parameter configuration is stable.
[0144] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation that may be implemented in systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0146] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0147] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described control method for imaging pathological sections, thereby solving the technical problem of poor imaging quality of pathological sections. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the control method for imaging pathological sections provided in the above embodiments, and will not be repeated here.
[0148] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for controlling imaging of pathological sections, characterized in that, The method includes: Based on the original photosensitive data corresponding to the target pathological slice, the frame data in the original photosensitive data is associated and bound with the corresponding frame context information to obtain the processing stage information corresponding to the frame data. This includes: parsing the frame start and end identifiers, pixel row data, and embedded statistical rows of the original photosensitive data corresponding to the target pathological slice frame by frame to obtain independent frame pixel acquisition information for each frame; constructing the frame context information including frame attribute information and the current working stage identifier based on the frame pixel acquisition information; performing black level correction, bad pixel neighborhood median replacement, and bit depth normalization mapping on the original photosensitive data sequentially based on the pre-calibrated dark level parameters and bad pixel mapping table in the frame context information to obtain the original pixel data; associating and binding the original pixel data with the corresponding frame context information through the frame sequence number to construct the correspondence between pixel data and working stage identifiers to obtain the processing stage information corresponding to the frame data. Based on the processing stage information and image statistical features, scene determination is performed, and the target parameter sequence is determined by combining indexing rules for retrieval. During the inter-frame idle period, the target parameter sequence is verified, and the effective parameter configuration is atomically switched through a double buffering mechanism to obtain the target parameter configuration; Perform full-link image processing according to the target parameter configuration, and output the target imaging result after verifying and confirming that the parameter configuration is stable.
2. The method for controlling pathological section imaging as described in claim 1, characterized in that, The step of determining the scene based on the processing stage information and image statistical features, and determining the target parameter sequence by combining indexing rules, includes: Frame-by-frame statistical operations are performed on the original pixel data associated with the information in the processing stage to obtain an image statistical feature set including brightness statistical features and tissue texture parameters; The working stage identifier of the processing stage information is used as a priority judgment dimension, and the hierarchical scene matching judgment is performed in combination with the image statistical feature set to determine the image scene identifier corresponding to the frame data. Based on the work stage identifier and the image scene identifier, and according to the three-level index mapping rules of work stage, image scene, and parameter configuration, candidate parameters corresponding to the processing stage information are retrieved and matched in the image processing parameter set. Arrange the candidate parameters that have passed the verification according to the temporal order in the processing stage information to obtain the target parameter sequence.
3. The method for controlling pathological section imaging as described in claim 2, characterized in that, The step of arranging the candidate parameters that have passed verification according to the temporal order in the processing stage information to obtain the target parameter sequence includes: Based on the imaging target of the processing stage in the processing stage information, the candidate parameters corresponding to the processing stage are subjected to adaptation verification and correction to obtain the candidate parameters that pass the verification. The candidate parameters that have passed the verification are arranged sequentially according to the processing time of the target pathological slides, and the stage activation nodes and switching boundary positions corresponding to the candidate parameters are marked to obtain the initial parameter sequence. The initial parameter sequence is verified for sensor model matching, parameter version unification, and data integrity. After confirming the closed loop of the full sequence switching logic, the target parameter sequence is generated in an ordered manner according to the processing time sequence.
4. The method for controlling pathological section imaging as described in claim 3, characterized in that, The step of performing adaptation verification and correction on the candidate parameters corresponding to the processing stage based on the imaging target in the processing stage information to obtain the verified candidate parameters includes: Decompose the candidate parameter subset corresponding to the processing stage, match the imaging target threshold of each processing stage, and obtain the verification unit set; The set of verification units is traversed. During the focusing stage, the sharpness discrimination adaptability of sharpening intensity and contrast gain is verified. During the positioning and recognition stage, the fine line recognizability adaptability of edge enhancement parameters is verified. During the formal scanning stage, the linkage adaptability of color reproduction parameters and flat field correction is verified, and all defective parameter items that fail to meet the adaptability standards are marked. Based on the defect parameter items, targeted corrections are performed with the imaging target threshold corresponding to the processing stage as constraints to obtain the corrected parameter subsets for each stage. The modified subset of parameters for each stage is subjected to intra-stage parameter consistency verification. After confirming that the parameters within the same stage are logically compatible, the candidate parameters that have passed the verification are integrated.
5. The method for controlling pathological section imaging as described in claim 1, characterized in that, The steps of verifying the target parameter sequence during the inter-frame idle period and atomically switching the effective parameter configuration through a double-buffering mechanism to obtain the target parameter configuration include: Extract the parameter group to be activated corresponding to the current stage switching node from the target parameter sequence, detect the frame transmission status of the original photosensitive data, and start the parameter loading process during the inter-frame idle period between the frame end identifier of the current frame and the start identifier of the next frame. After the parameter loading process is started, the parameter group to be effective is written into the target active buffer in the double buffer architecture, and the target active buffer is locked after the verification is passed. Before the end of the inter-frame idle period, the currently active buffer pointer is pointed to the target active buffer, and the first frame image after the switch is marked as a protection frame and associated with the parameter switching identifier; After confirming that the parameter switching process is entirely within the inter-frame period and there is no risk of misuse, the parameter content of the target activity buffer is used as the currently effective target parameter configuration, and the switching frame number, parameter version, and switching result are written to the switching traceability log.
6. The method for controlling pathological section imaging as described in claim 5, characterized in that, After the steps of pointing the currently active buffer pointer to the target active buffer before the end of the inter-frame idle period, marking the first frame image after the switch as a protection frame and associating it with the parameter switching identifier, the control method for pathological slide imaging further includes: The average brightness, saturated pixel ratio and color deviation index are extracted frame by frame from the continuous multi-frame images after parameter switching, and compared with the effective and stable threshold to obtain the result of parameter effective status determination. If the parameter effectiveness status determination result is that the parameter effectiveness is abnormal, a rollback operation is triggered during the current inter-frame idle period to switch the target active buffer pointer back to the active buffer corresponding to the stable parameter group and restore the stable imaging parameter configuration before the switch. Write the parameter information, the cause of the exception, and the rollback execution result of this switchover into the switchover traceability log, and update the cumulative number of consecutive rollbacks and exception type statistics. When the number of consecutive rollbacks reaches the preset rollback threshold, the system locks to the safe default parameter group and terminates the automatic parameter switching process, and outputs a parameter recalibration prompt to ensure stable operation of the imaging process.
7. The method for controlling pathological section imaging as described in claim 1, characterized in that, The step of performing end-to-end image processing according to the target parameter configuration, and outputting the target imaging result after verifying that the parameter configuration is stable includes: Using the target parameter configuration as the processing benchmark, invalid frame data marked as protected frames are removed, and color calibration and flat field correction are sequentially performed on the valid original image frames to obtain valid corrected image frames. The average brightness, color deviation, and texture consistency of the effectively corrected image frame are compared with the stable threshold range of the indicators one by one to obtain the verification result of the parameter configuration taking effect. When the verification result indicates that the parameter configuration is stable and effective, the effective corrected image frame is associated and bound with the corresponding parameter configuration identifier and the frame context information to generate an effective imaging frame; The effective imaging frames are arranged and spatially aligned in an orderly manner according to the scanning sequence of the pathological sections. After removing discrete abnormal frames, they are integrated to generate the target imaging result.
8. A control device for imaging pathological sections, characterized in that, The control device for pathological slide imaging includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method for pathological slide imaging as described in any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the control method for imaging pathological sections as described in any one of claims 1 to 7.