A fiber core matching method and related device

CN118429671BActive Publication Date: 2026-09-18BIOPSEE (SUZHOU) MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410519848.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2026-09-18
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

成像过程中,每一幅图像都依据预先确定的纤芯位置提取每根光纤的亮度信息,振镜特性的变化导致成像过程中纤芯位置变化,进而导致不能提取到光纤的准确亮度信息,致使图像质量劣化

Benefits of technology

[0052]In summary, the fiber core matching method of this application includes: generating a current fiber core position map based on the current fiber core matching point set; generating a historical fiber core position map based on the historical fiber core matching point set; determining the fiber core position overlap degree based on the current fiber core position map and the historical fiber core position map; sorting the fiber core positions in descending order based on the fiber core position overlap degree to select the top K positions as candidate column positions; performing matching operations and matching result evaluation operations based on each candidate column position, the current fiber core matching point set, and the historical fiber core matching point set, and selecting the matching result with the lowest matching cost for fiber core matching. The fiber core matching method proposed in this application optimizes the matching process by sorting in descending order and selecting the top K positions with the highest overlap degree as candidate column positions, and then selecting the matching result with the lowest matching cost for fiber core matching. This method reduces computational complexity and time consumption, making the fiber core matching process more efficient and accurate. Since it can effectively compensate for the fiber core position offset caused by changes in galvanometer performance, this application enhances the stability and reliability of the system. Even when the galvanometer's performance fluctuates due to temperature variations, it ensures the continuous provision of accurate fiber core position information, avoiding imaging errors caused by positional inaccuracies. The method proposed in this application not only improves the fiber core matching accuracy and image quality during the imaging process but also reduces operational complexity by optimizing the matching procedure, thereby enhancing the stability and efficiency of the entire system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429671B_ABST
    Figure CN118429671B_ABST
Patent Text Reader

Abstract

The application discloses a kind of core matching method and related equipment, it is related to medical equipment field, the method includes: according to current time fiber core matching point set generation current fiber core position chart;According to historical time fiber core matching point set generation historical fiber core position chart;According to the above current fiber core position chart and the above historical fiber core position chart determine fiber core position coincidence degree;According to the above fiber core position coincidence degree is sorted in descending order, to filter out the first K position as candidate column position;According to each above-mentioned candidate column position, the above-mentioned current time fiber core matching point set and the above-mentioned historical time fiber core matching point set carry out matching operation and matching result evaluation operation, and select the matching result of minimum matching cost carries out fiber core matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of medical devices, and more specifically, this application relates to a fiber core matching method and related equipment. Background Technology

[0002] A microendoscopy is a medical device that, through channels such as gastroscopes and colonoscopes, can be inserted into the human body to obtain local histological images, enabling precise diagnosis of minute lesions, gastrointestinal diseases, and early gastrointestinal cancers. The scanning control module of a microendoscopy has two important components: a resonant mirror and a galvanometer mirror. The resonant mirror's function is to rapidly scan light in the horizontal direction, hence it is also called an X-ray mirror. The galvanometer mirror's function is to scan light in the vertical direction, hence it is also called a Y-ray mirror. Together, they obtain a two-dimensional planar image.

[0003] The resonant mirror and galvanometer mirror contain sophisticated electronic components whose characteristics change with the ambient temperature. During imaging, each image extracts the brightness information of each fiber based on a predetermined fiber core position. Changes in the mirror characteristics cause changes in the fiber core position during imaging, leading to the inability to extract accurate brightness information and resulting in image quality degradation. Furthermore, the fiber core matching accuracy directly affects the mirror's position tracking performance. Summary of the Invention

[0004] The summary section introduces a series of simplified concepts, which will be further explained in detail in the detailed description section. This summary section is not intended to limit the key and essential technical features of the claimed technical solution, nor is it intended to determine the scope of protection of the claimed technical solution.

[0005] Firstly, this application proposes a fiber core matching method, the method comprising:

[0006] Generate the current fiber core position map based on the current fiber core matching point set;

[0007] Generate a historical fiber core location map based on the set of fiber core matching points at historical moments;

[0008] The overlap of fiber core positions is determined based on the current fiber core position diagram and the historical fiber core position diagram.

[0009] Based on the overlap of the fiber core positions, sort them in descending order to select the top K positions as candidate column positions;

[0010] Based on each of the above candidate column positions, the above current core matching point set, and the above historical core matching point set, a matching operation and a matching result evaluation operation are performed, and the matching result with the minimum matching cost is selected for core matching.

[0011] In one feasible implementation, determining the fiber core position overlap based on the current fiber core position map and the historical fiber core position map includes:

[0012] Calculate the offset for each row based on the current fiber core position map and the historical fiber core position map above;

[0013] Generate a column position sequence based on the current fiber core position map and the historical fiber core position map;

[0014] The fiber core position overlap is determined based on the offset of each row, the column position sequence, the current fiber core position map, and the historical fiber core position map.

[0015] In one feasible implementation, the calculation of the offset for each row based on the current fiber core position map and the historical fiber core position map includes:

[0016] Obtain the first top position and the first bottom position of the current fiber core position diagram above;

[0017] Obtain the second top position and the second bottom position of the above historical fiber core position map;

[0018] Calculate the top offset based on the first top position and the second top position mentioned above;

[0019] Calculate the bottom offset based on the first bottom position and the second bottom position mentioned above;

[0020] The offset of each row is calculated based on the first top position, the first bottom position, the top offset, and the bottom offset.

[0021] In one feasible implementation, determining the fiber core position overlap based on the row offset, column position sequence, current fiber core position map, and historical fiber core position map includes:

[0022] Initialize the overlap point counter, which is used to record the number of first overlap points in the current fiber core position map and the number of second overlap points in the historical fiber core position map;

[0023] The column statistical range is determined based on the specified column and the number of extended columns in the above column position sequence;

[0024] The first search range is determined based on the statistical range of all rows and the above columns;

[0025] The second search range is determined based on all rows, the statistical range of the above columns, and the offset of each row mentioned above.

[0026] Within the first search range, count the number of the first overlapping points corresponding to the current fiber core location map.

[0027] Within the second search range, count the number of the second overlapping points corresponding to the historical fiber core location map.

[0028] The overlap of the fiber core positions is determined based on the number of the first overlap points and the number of the second overlap points.

[0029] In one feasible implementation, the above-mentioned matching operation and matching result evaluation operation based on each of the above-mentioned candidate column positions, the above-mentioned current time fiber core matching point set and the above-mentioned historical time fiber core matching point set, and selecting the matching result with the minimum matching cost for fiber core matching, includes:

[0030] A matching operation is performed based on each of the above candidate column positions, the above current fiber core matching point set, and the above historical fiber core matching point set to obtain the matching result;

[0031] The matching results are evaluated, and the matching result with the lowest matching cost is selected for fiber core matching.

[0032] In one feasible implementation, the matching operation based on each of the candidate column positions, the current fiber core matching point set, and the historical fiber core matching point set to obtain a matching result includes:

[0033] The current fiber core position map is generated based on the current fiber core matching point set.

[0034] Obtain the first top position and the first bottom position corresponding to the above fiber core position diagram;

[0035] The matching order of the current fiber core matching point set is determined based on each of the above candidate column positions, the above first top position, and the above first bottom position;

[0036] Based on the above matching order, for each point to be matched, search for matched core position points in the target neighborhood of the point to be matched in the current core position map, and calculate the average row offset and average column offset of the matched core position points relative to them in the historical core position map.

[0037] Add the average row offset and the average column offset to the points to be matched to obtain the predicted coordinates;

[0038] Search for point information within the target neighborhood centered on the predicted coordinates of the aforementioned historical fiber core location map;

[0039] If the above point information is empty, the matching fails; and / or, if multiple points of the above point information exist, the point with the smallest offset will be used as the matching point.

[0040] The matching process continues until all the fiber core matching points at the current moment are matched or the point information is empty, and the matching result is obtained.

[0041] In one feasible implementation, the above-mentioned matching result evaluation operation, and the selection of the matching result with the lowest matching cost for fiber core matching, includes:

[0042] Based on the matching results, the percentage of unmatched points and the average displacement gradient of the fiber core matching points at the current moment are statistically analyzed.

[0043] The matching cost is calculated based on the first weighting coefficient, the second weighting coefficient, the proportion of unmatched points, and the average displacement gradient.

[0044] Select the matching result with the lowest matching cost from the above list for core matching.

[0045] In one feasible implementation, the above method further includes:

[0046] At the current moment, determine the matching point within the target neighborhood of the fiber core matching point set;

[0047] Calculate the row and column displacements of the above matching points in the fiber core matching point set at historical moments;

[0048] Calculate the distance between the matching point and the specified point within the target neighborhood, and use the inverse value of the distance as the weighting weight.

[0049] The average gradient in the four reference directions is calculated based on the weighted weights, row displacements, and column displacements mentioned above, and is used as the displacement gradient in the neighborhood. The reference directions include the up-down direction, the left-right direction, the upper-left-lower-right direction, and the lower-left-upper-right direction.

[0050] In a second aspect, an electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the core matching method of any of the first aspects described above.

[0051] Thirdly, this application also proposes a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the core matching method of any of the first aspects.

[0052] In summary, the fiber core matching method of this application includes: generating a current fiber core position map based on the current fiber core matching point set; generating a historical fiber core position map based on the historical fiber core matching point set; determining the fiber core position overlap degree based on the current fiber core position map and the historical fiber core position map; sorting the fiber core positions in descending order based on the fiber core position overlap degree to select the top K positions as candidate column positions; performing matching operations and matching result evaluation operations based on each candidate column position, the current fiber core matching point set, and the historical fiber core matching point set, and selecting the matching result with the lowest matching cost for fiber core matching. The fiber core matching method proposed in this application optimizes the matching process by sorting in descending order and selecting the top K positions with the highest overlap degree as candidate column positions, and then selecting the matching result with the lowest matching cost for fiber core matching. This method reduces computational complexity and time consumption, making the fiber core matching process more efficient and accurate. Since it can effectively compensate for the fiber core position offset caused by changes in galvanometer performance, this application enhances the stability and reliability of the system. Even when the galvanometer's performance fluctuates due to temperature variations, it ensures the continuous provision of accurate fiber core position information, avoiding imaging errors caused by positional inaccuracies. The method proposed in this application not only improves the fiber core matching accuracy and image quality during the imaging process but also reduces operational complexity by optimizing the matching procedure, thereby enhancing the stability and efficiency of the entire system.

[0053] The fiber core matching method proposed in this application, other advantages, objectives and features of this application will be partly apparent from the following description, and partly understood by those skilled in the art through study and practice of this application. Attached Figure Description

[0054] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit this specification. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0055] Figure 1 This is a schematic flowchart of a fiber core matching method provided in an embodiment of this application;

[0056] Figure 2 This is a schematic diagram of a fiber core matching electronic device structure provided in an embodiment of this application. Detailed Implementation

[0057] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The technical solutions of the embodiments of this application will now be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.

[0058] Please see Figure 1 This is a schematic diagram of a fiber core matching method provided in an embodiment of this application, which may specifically include:

[0059] S110. Generate the current fiber core position map based on the current fiber core matching point set;

[0060] For example, the current set of fiber core matching points is collected using a micro-endoscope, and a current fiber core position map is generated based on this data. In other words, the specific position map of each fiber core in the current optical fiber is drawn based on the data points collected in real time.

[0061] S120. Generate a historical fiber core location map based on the set of fiber core matching points at historical moments.

[0062] For example, the historical moment is the previous sampling moment corresponding to the current moment, and a historical fiber core location map is generated based on the historical data.

[0063] S130. Determine the fiber core position overlap based on the current fiber core position diagram and the historical fiber core position diagram.

[0064] For example, the current core position map is compared with a historical core position map to determine the degree of overlap between the two. This degree of overlap can be used to identify which cores remain unchanged and which have moved or changed.

[0065] S140. Sort the fiber core positions in descending order according to the overlap of the above positions, and select the top K positions as candidate column positions.

[0066] For example, based on the overlap determined in the above steps, all matching fiber core positions are sorted in descending order. Then, the top K positions with the highest overlap are selected as candidate column positions, and the fiber core positions most likely to match are selected for further analysis.

[0067] S150. Perform matching operations and matching result evaluation operations based on each of the above candidate column positions, the above current fiber core matching point set and the above historical fiber core matching point set, and select the matching result with the minimum matching cost for fiber core matching.

[0068] For example, for each candidate column position, a matching operation is performed using the current and historical core matching point sets, and the matching results are evaluated. The evaluation operation includes calculating the matching cost, i.e., assessing the accuracy or feasibility of a matching operation. Finally, the result with the minimum matching cost is selected as the final core matching result.

[0069] In summary, the fiber core matching method proposed in this application sorts and selects the top K positions with the highest overlap as candidate column positions in descending order, and then selects the matching result with the lowest matching cost for fiber core matching. This method optimizes the matching process, reduces computational complexity and time consumption, and makes the fiber core matching process more efficient and accurate. Because it can effectively compensate for fiber core position shifts caused by changes in galvanometer performance, this application enhances the stability and reliability of the system. Even when the galvanometer performance fluctuates due to temperature changes, it can ensure the continuous provision of accurate fiber core position information, avoiding imaging errors caused by positional errors. The method proposed in this application not only improves the fiber core matching accuracy and image quality during the imaging process, but also reduces operational complexity by optimizing the matching process, thereby improving the stability and efficiency of the entire system.

[0070] In one feasible implementation, determining the fiber core position overlap based on the current fiber core position map and the historical fiber core position map includes:

[0071] Calculate the offset for each row based on the current fiber core position map and the historical fiber core position map above;

[0072] Generate a column position sequence based on the current fiber core position map and the historical fiber core position map;

[0073] The fiber core position overlap is determined based on the offset of each row, the column position sequence, the current fiber core position map, and the historical fiber core position map.

[0074] For example, first, the offset of each row is calculated based on the current and historical fiber core position maps. For each row in the image, its positional offset between the current and historical times is calculated. Then, a column position sequence is generated based on the current and historical fiber core position maps. This sequence represents the position of each column of fiber cores and involves numbering the fiber cores. The column position sequence helps to organize and reference data by column when performing fiber core position comparisons and overlap calculations. Finally, the overlap of fiber core positions is determined by comprehensively utilizing the offset of each row, the column position sequence, the current fiber core position map, and the historical fiber core position map. This includes comparing each fiber core position to determine their relative positional changes at different time points. By analyzing the row offsets and column positions, the relative movement or positional changes between fiber cores can be accurately assessed, thereby calculating the overlap. The degree of overlap reflects the degree of matching between fiber core positions at different time points; a high degree of overlap means that the fiber core position has remained essentially unchanged, while a low degree of overlap indicates a significant change in position.

[0075] It should be noted that the specific process of generating the column position sequence may include finding the leftmost position (left1) and the rightmost position (right1) of the fiber core in the current fiber core position diagram. The leftmost position refers to the minimum value of all fiber core column coordinates in the diagram, and the rightmost position refers to the maximum value of all fiber core column coordinates in the diagram. The column position sequence is generated as left1:10:right1, where the 10 between the two colons indicates an interval of 10.

[0076] In one feasible implementation, the calculation of the offset for each row based on the current fiber core position map and the historical fiber core position map includes:

[0077] Obtain the first top position and the first bottom position of the current fiber core position diagram above;

[0078] Obtain the second top position and the second bottom position of the above historical fiber core position map;

[0079] Calculate the top offset based on the first top position and the second top position mentioned above;

[0080] Calculate the bottom offset based on the first bottom position and the second bottom position mentioned above;

[0081] The offset of each row is calculated based on the first top position, the first bottom position, the top offset, and the bottom offset.

[0082] For example, specifically, in the current fiber core position map and the historical fiber core position map, find the first top position top1, the second top position top2, the first bottom position bottom1, and the second bottom position bottom2, respectively;

[0083] Calculate the top and bottom offsets. Top offset shiftTop = top2 - top1, bottom offset shiftBottom = bottom2 - bottom1;

[0084] Calculate the offset shift(r) for each row based on top1, shiftTop, bottom1, and shiftBottom, with the row coordinates denoted as r:

[0085]

[0086] In one feasible implementation, determining the fiber core position overlap based on the row offset, column position sequence, current fiber core position map, and historical fiber core position map includes:

[0087] Initialize the overlap point counter, which is used to record the number of first overlap points in the current fiber core position map and the number of second overlap points in the historical fiber core position map;

[0088] The column statistical range is determined based on the specified column and the number of extended columns in the above column position sequence;

[0089] The first search range is determined based on the statistical range of all rows and the above columns;

[0090] The second search range is determined based on all rows, the statistical range of the above columns, and the offset of each row mentioned above.

[0091] Within the first search range, count the number of the first overlapping points corresponding to the current fiber core location map.

[0092] Within the second search range, count the number of the second overlapping points corresponding to the historical fiber core location map.

[0093] The overlap of the fiber core positions is determined based on the number of the first overlap points and the number of the second overlap points.

[0094] For example, an overlap point counter needs to be initialized to record the number of first overlap points (cntCenter1) in the current core position map and the number of second overlap points (cntCenter2) in the historical core position map. These overlap points refer to points where the core positions match, that is, core points identified as having the same or similar positions in the current and historical position maps.

[0095] Next, the column statistical range is determined based on the specified column and the number of extended columns in the column position sequence. A certain column and its surrounding extended columns are selected as the range for the overlap analysis. This is done to take into account the possible small displacements of the fiber core, thereby increasing the flexibility and accuracy of the matching. For example, the column statistical range c can be: [specified column - 10, specified column + 10].

[0096] The first search range is determined based on the statistical range of all rows and the above columns. This range is for the current fiber core location map. For example, the first search range can be (r, c), which includes all row and column regions that may contain the first coincidence point.

[0097] The second search range is determined based on all rows, the statistical range of the above columns, and the offset shift(r) of each row. This range is for the historical fiber core position map. For example, the second search range can be: (r+shift(r)-1:r+shift(r)+1,c-1:c+1). This setting takes into account that the offset of each row is to adjust the search range of the historical position map to match the changes in the current fiber core position.

[0098] Within the first search range, count the number of first coincidence points corresponding to the current fiber core location map (cntCenter1), representing the number of fiber core points in the current location map that match or are similar to those in the historical location map. Within the second search range, count the number of second coincidence points corresponding to the historical fiber core location map (cntCenter2), representing the number of fiber core points in the historical location map that match or are similar to those in the current location map.

[0099] Finally, the overlap of the fiber core position is determined based on the number of the first and second overlapping points. The formula for calculating the overlap is: overlap = cntCenter2 / cntCenter1.

[0100] This can be achieved using the following pseudocode:

[0101] For column position c in [column-10, column+10]:

[0102] for line position r in [all line positions]:

[0103] if position Figure 1 (r,c) is true:

[0104] cntCenter1 = cntCenter1 + 1

[0105] if position Figure 2 (r+shift(r)-1:r+shift(r)+1,c-1:c+1) contains true:

[0106] cntCenter2 = cntCenter2 + 1

[0107] shift(r) is the offset of the r-th row calculated in the previous steps.

[0108] Coincidence=cntCenter2 / cntCenter1

[0109] In one feasible implementation, the above-mentioned matching operation and matching result evaluation operation based on each of the above-mentioned candidate column positions, the above-mentioned current time fiber core matching point set and the above-mentioned historical time fiber core matching point set, and selecting the matching result with the minimum matching cost for fiber core matching, includes:

[0110] A matching operation is performed based on each of the above candidate column positions, the above current fiber core matching point set, and the above historical fiber core matching point set to obtain the matching result;

[0111] The matching results are evaluated, and the matching result with the lowest matching cost is selected for fiber core matching.

[0112] For example, firstly, based on the overlap determined in the previous steps, the top K candidate column positions with the highest probability of matching have been selected. These candidate positions are the result of filtering based on the overlap of the fiber core positions at different time points. For each candidate column position, a detailed matching operation is performed using the fiber core matching point sets at the current and historical times. After the matching operation is completed, each matching result needs to be evaluated. This evaluation operation includes calculating the matching cost of each matching result. The matching cost can be based on multiple factors, such as the number of matching points, the spatial distance between matching points, and the consistency of the matching. The purpose of the evaluation is to quantify the merits of each matching result in order to make a selection. Finally, the result with the minimum matching cost is selected from all evaluated matching results as the final fiber core matching result. The minimum matching cost means that this matching result is closest to the ideal matching state among all candidates, that is, the correspondence between the fiber core points at the current and historical times is the closest.

[0113] The method proposed in this embodiment ensures that the final selected matching result has the lowest matching cost through a detailed comparison and evaluation process, thereby improving the matching accuracy. Although this process may seem cumbersome at first glance, by first filtering the candidate column positions and then performing matching and evaluation, unnecessary calculations are reduced and the efficiency of the matching process is optimized.

[0114] In one feasible implementation, the matching operation based on each of the candidate column positions, the current fiber core matching point set, and the historical fiber core matching point set to obtain a matching result includes:

[0115] The current fiber core position map is generated based on the current fiber core matching point set.

[0116] Obtain the first top position and the first bottom position corresponding to the above fiber core position diagram;

[0117] The matching order of the current fiber core matching point set is determined based on each of the above candidate column positions, the above first top position, and the above first bottom position;

[0118] Based on the above matching order, for each point to be matched, search for matched core position points in the target neighborhood of the point to be matched in the current core position map, and calculate the average row offset and average column offset of the matched core position points relative to them in the historical core position map.

[0119] Add the average row offset and the average column offset to the points to be matched to obtain the predicted coordinates;

[0120] Search for point information within the target neighborhood centered on the predicted coordinates of the aforementioned historical fiber core location map;

[0121] If the above point information is empty, the matching fails; and / or, if multiple points of the above point information exist, the point with the smallest offset will be used as the matching point.

[0122] The matching process continues until all the fiber core matching points at the current moment are matched or the point information is empty, and the matching result is obtained.

[0123] For example, firstly, a current fiber core location map is generated based on the current set of matching fiber core points. The first top and bottom positions are obtained from the current fiber core location map. The vertical range of the fiber core location map is determined to provide a reference for determining the subsequent matching order. Based on each candidate column position and its top and bottom positions, the matching order of the current set of matching fiber core points is determined, ensuring that the matching operation can be performed in a certain order, thereby improving the efficiency and accuracy of the matching. For each point to be matched, the average row offset and column offset relative to the historical fiber core location map are calculated based on the fiber core location points already matched in the target neighborhood of the current fiber core location map. By calculating the average offset, the approximate position of each point to be matched in the historical fiber core location map can be predicted, which helps improve the accuracy and efficiency of subsequent searches. The average row offset and column offset are added to the point to be matched to obtain the predicted coordinates. The predicted coordinates provide a clear starting point for the next step of searching for matching points in the historical fiber core location map. Point location information is searched within the target neighborhood of the historical fiber core location map using the predicted coordinates as the center. If the point location information is empty, it indicates that the matching has failed. If multiple point information exists, select the point with the smallest offset from the prediction as the matching point. Repeat the above steps until all fiber core matching points in the current time frame have been matched, or stop when the point information is empty, and finally obtain the matching result.

[0124] Specifically, this can be achieved through the following steps and pseudocode:

[0125] Generate the current fiber core position map based on the current fiber core matching point set. Find the first top position (top1) and the first bottom position (bottom1) in the current fiber core position map. The matching order of the current fiber core matching point set is: starting column number = specified column, starting row number = (top1 + bottom1) / 2. Divide the image into left and right parts based on the starting column, and search upwards and downwards for points in the current fiber core matching point set starting from the starting row. H represents the image height, and W represents the image width.

[0126]

[0127]

[0128] In the above pseudocode Figure 1 This is the current fiber core location map. The index of each matching point in the current fiber core matching point set within the historical fiber core matching point set is initialized to -1.

[0129] The points to be matched are retrieved sequentially from the list of matching points. The fiber core position points in the target neighborhood that have been matched are searched on the fiber core position map at the previous time step. The average row offset and average column offset of the neighborhood points are calculated. The target neighborhood can be 5x5.

[0130] The coordinates of the point to be matched are added to the average row offset and average column offset. Then, a 5x5 search is conducted to find unmatched points within the 5x5 neighborhood of the coordinates. If no matching points are found, the point to be matched on the fiber core position map at the current moment fails to match. If more than one matching point is found, the matching point whose displacement is closest to the average displacement is selected.

[0131] Repeat this process multiple times until all fiber core position points on the current fiber core position map have a matching point on the current fiber core position map or there is no point on the historical fiber core position map that can be matched with it.

[0132] In one feasible implementation, the above-mentioned matching result evaluation operation, and the selection of the matching result with the lowest matching cost for fiber core matching, includes:

[0133] Based on the matching results, the percentage of unmatched points and the average displacement gradient of the fiber core matching points at the current moment are statistically analyzed.

[0134] The matching cost is calculated based on the first weighting coefficient, the second weighting coefficient, the proportion of unmatched points, and the average displacement gradient.

[0135] Select the matching result with the lowest matching cost from the above list for core matching.

[0136] For example, firstly, for each matching result, calculate the proportion of unmatched points in the current core matching point set, where the proportion of unmatched points = cntUnmatched / (cntUnmatched+cntMatched), where cntUnmatched is the number of unmatched points, and cntUnmatched+cntMatched is the sum of the number of matched and unmatched points. The average displacement gradient = sumGrad / cntMatched, where sumGrad is the sum of the displacement gradients of the points, and cntMatched is the number of matched points. The first weighting coefficient can be...

[0137] The displacement gradient and sumGrad are the sum of the gradient of the displacement point itself and the displacement gradient grad in the neighborhood of that point.

[0138] The first weighting coefficient can be set to 0.25, the second weighting coefficient can be set to 0.75, and the matching cost can be calculated using the following formula:

[0139] Matching cost = 0.25 * cntUnmatched / (cntUnmatched + cntMatched) + 0.75 * sumGrad / cntMatched

[0140] The matching cost is calculated based on the proportion of unmatched points and the average displacement gradient, combined with corresponding weighting coefficients. A lower cost indicates a higher quality matching result, meaning fewer unmatched points and less average positional variation among matched points. Finally, the result with the lowest matching cost is selected as the final core matching result. This process ensures that the selected matching result is optimal in terms of both the proportion of unmatched points and the consistency of the average position of matched points.

[0141] In one feasible implementation, the above method further includes:

[0142] At the current moment, determine the matching point within the target neighborhood of the fiber core matching point set;

[0143] Calculate the row and column displacements of the above matching points in the fiber core matching point set at historical moments;

[0144] Calculate the distance between the matching point and the specified point within the target neighborhood, and use the inverse value of the distance as the weighting weight.

[0145] The average gradient in the four reference directions is calculated based on the weighted weights, row displacements, and column displacements mentioned above, and is used as the displacement gradient in the neighborhood. The reference directions include the up-down direction, the left-right direction, the upper-left-lower-right direction, and the lower-left-upper-right direction.

[0146] For example, find all matching points within a 5x5 neighborhood of the target point. For each matching point within this neighborhood, calculate the row and column displacements between each matching point and the matching points in the historical fiber core matching point set. Let the coordinates of a point in the current fiber core matching point set be denoted as... The coordinates of the matching points in the fiber core matching point set at historical moments are: The line displacement is column displacement is For all matched points within the aforementioned neighborhood, calculate the distances between these points and the specified point, normalize and invert the distances to obtain the weights; calculate the gradients in the up and down directions:

[0147] Calculate the weighted average row displacement Δr of the neighboring points located above and below the specified point. w,1 ,Δr w,2 and weighted average column displacement Δc w,1 ,Δc w,2 If the number of points on one side is 0, then the gradient is 0; otherwise, the gradient is the magnitude of the vector difference between the two displacements. Based on the above calculation of the vertical gradient, calculate the horizontal gradient, the upper left and lower right gradient, and the lower left and upper right gradient.

[0148] And calculate the displacement gradient in the neighborhood according to the following formula:

[0149] Displacement gradient within the neighborhood = (vertical gradient + horizontal gradient + top-left / bottom-right gradient + bottom-left / top-right gradient) / 4

[0150] like Figure 2 As shown, this application embodiment also provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, it implements the steps of any of the above-described fiber core matching methods.

[0151] Since the electronic device described in this embodiment is the device used to implement a fiber core matching device in the embodiments of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in the embodiments of this application. Therefore, how the electronic device implements the method in the embodiments of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiments of this application is within the scope of protection of this application.

[0152] In practical implementation, when the computer program 311 is executed by the processor, it can achieve the following: Figure 1 Any of the corresponding implementation methods in the embodiments.

[0153] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0154] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0156] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0157] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0158] This application also provides a computer program product, which includes computer software instructions that, when executed on a processing device, cause the processing device to perform the core matching process in the corresponding embodiment.

[0159] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0161] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0163] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0164] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0165] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A fiber core matching method, characterized in that, include: Generate the current fiber core position map based on the current fiber core matching point set; Generate a historical fiber core location map based on the set of fiber core matching points at historical moments; The overlap of fiber core positions is determined based on the current fiber core position diagram and the historical fiber core position diagram. Based on the overlap of the fiber core positions, sort them in descending order to select the top K positions as candidate column positions; Based on each of the above candidate column positions, the above current core matching point set, and the above historical core matching point set, a matching operation and a matching result evaluation operation are performed, and the matching result with the minimum matching cost is selected for core matching. The process of determining the fiber core position overlap based on the current fiber core position map and the historical fiber core position map includes: calculating the offset of each row based on the current fiber core position map and the historical fiber core position map; generating a column position sequence based on the current fiber core position map and the historical fiber core position map; and determining the fiber core position overlap based on the offset of each row, the column position sequence, the current fiber core position map, and the historical fiber core position map.

2. The fiber core matching method according to claim 1, characterized in that, The above calculation of the offset for each row based on the current fiber core position map and the historical fiber core position map includes: Obtain the first top position and the first bottom position of the current fiber core position diagram above; Obtain the second top position and the second bottom position of the above historical fiber core position map; Calculate the top offset based on the first top position and the second top position mentioned above; Calculate the bottom offset based on the first bottom position and the second bottom position mentioned above; The offset of each row is calculated based on the first top position, the first bottom position, the top offset, and the bottom offset.

3. The fiber core matching method according to claim 1, characterized in that, The determination of fiber core position overlap based on the above-mentioned row offset, column position sequence, current fiber core position map, and historical fiber core position map includes: Initialize the overlap point counter, which is used to record the number of first overlap points in the current fiber core position map and the number of second overlap points in the historical fiber core position map; The column statistical range is determined based on the specified column and the number of extended columns in the above column position sequence; The first search range is determined based on the statistical range of all rows and the above columns; The second search range is determined based on all rows, the statistical range of the above columns, and the offset of each row mentioned above. Within the first search range, count the number of the first overlapping points corresponding to the current fiber core location map. Within the second search range, count the number of the second overlapping points corresponding to the historical fiber core location map. The overlap of the fiber core positions is determined based on the number of the first overlap points and the number of the second overlap points.

4. The fiber core matching method according to claim 1, characterized in that, The above-mentioned matching operation and matching result evaluation operation are performed based on each candidate column position, the current fiber core matching point set, and the historical fiber core matching point set, and the matching result with the minimum matching cost is selected for fiber core matching, including: A matching operation is performed based on each of the above candidate column positions, the above current fiber core matching point set, and the above historical fiber core matching point set to obtain the matching result; The matching results are evaluated, and the matching result with the lowest matching cost is selected for fiber core matching.

5. The fiber core matching method according to claim 4, characterized in that, The above-mentioned matching operation is performed based on the position of each candidate column, the current fiber core matching point set, and the historical fiber core matching point set to obtain the matching result, including: The current fiber core position map is generated based on the current fiber core matching point set. Obtain the first top position and the first bottom position corresponding to the above fiber core position diagram; The matching order of the current fiber core matching point set is determined based on each of the above candidate column positions, the above first top position, and the above first bottom position; Based on the above matching order, for each point to be matched, search for matched core position points in the target neighborhood of the point to be matched in the current core position map, and calculate the average row offset and average column offset of the matched core position points relative to them in the historical core position map. Add the average row offset and the average column offset to the points to be matched to obtain the predicted coordinates; Search for point information within the target neighborhood centered on the predicted coordinates of the aforementioned historical fiber core location map; If the above point information is empty, the matching fails; and / or, if multiple points of the above point information exist, the point with the smallest offset will be used as the matching point. The matching process continues until all the fiber core matching points at the current moment are matched or the point information is empty, and the matching result is obtained.

6. The fiber core matching method according to claim 4, characterized in that, The above-mentioned matching result evaluation operation, which selects the matching result with the lowest matching cost for fiber core matching, includes: Based on the matching results, the percentage of unmatched points and the average displacement gradient of the fiber core matching points at the current moment are statistically analyzed. The matching cost is calculated based on the first weighting coefficient, the second weighting coefficient, the proportion of unmatched points, and the average displacement gradient. Select the matching result with the lowest matching cost from the above list for core matching.

7. The fiber core matching method according to claim 6, characterized in that, Also includes: At the current moment, determine the matching point within the target neighborhood of the fiber core matching point set; Calculate the row and column displacements of the above matching points in the fiber core matching point set at historical moments; Calculate the distance between the matching point in the target neighborhood and the specified point, and use the inverse value of the distance as the weighting weight. The average gradient in the four reference directions is calculated based on the weighted weights, row displacements, and column displacements mentioned above, and is used as the displacement gradient in the neighborhood. The reference directions include the up-down direction, the left-right direction, the upper-left-lower-right direction, and the lower-left-upper-right direction.

8. An electronic device, comprising: The memory and processor are characterized in that the processor, when executing a computer program stored in the memory, implements the steps of the fiber core matching method as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the above-described computer program is executed by a processor, it implements the steps of the fiber core matching method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Tissue cavity positioning method, device, readable medium and electronic equipment

    CN113487609A

  • Optical fiber image correction method and device and computer readable storage medium

    CN113570520A