A Clarity Evaluation Method for Wool and Cashmere Fiber Images
Through the definition algorithm based on the binary edge histogram of the Z-axis image sequence, the wool cashmere fiber image is evaluated, which solves the problem of low manual focus efficiency in the prior art, and realizes the accurate clarity evaluation of the wool cashmere fiber image, which meets national standards.
Patent Information
- Application Number
- CN202210147943.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-02-17
AI Technical Summary
In the prior art, the artificial focusing method has problems such as time-consuming, inefficient, and high labor costs in the evaluation of image clarity of wool cashmere fibers, and the definition evaluation method based on image gradient information is not suitable for microscopic imaged wool cashmere fiber images.
Using a sharpness algorithm based on the binary edge histogram of Z-axis image sequence, we correct and calculate the image clarity by setting thresholds, stating and normalizing the number of edge white and black dots, and find the image corresponding to the maximum sharpness as the sharpest image.
The accurate clarity evaluation of wool cashmere fiber images was achieved. The sharpest image found complies with national standards, with thin lines on the edges without black and white edges, improving efficiency and accuracy.
Smart Images

Figure CN114511549B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image clarity evaluation, and in particular to a clarity evaluation method for wool and cashmere fiber images. Background Art
[0002] As a major importer and exporter of wool and cashmere textile industry in the world, China has advanced wool and cashmere production technology and a huge consumer market. The natural fibers contained in wool and cashmere are composed of protein, which is soft and elastic. Wool comes from sheep and cashmere comes from goats, but the output of cashmere is extremely rare, and it is more skin-friendly, cold-resistant and hygroscopic. Because of this, it is necessary to identify and distinguish wool and cashmere, and then rate such textile products. Wool and cashmere are generally identified under a microscope, and professionals observe the small differences in the morphology of the two fibers to classify them. Before identification, it is necessary to focus on the two fibers and select the clearest image.
[0003] The focusing process is generally done manually. First, adjust the position of the glass slide containing the fiber to a preset XY position, and then repeatedly adjust the Z-axis position to achieve the required clarity, and then identify it. However, this manual focusing method has the disadvantages of being cumbersome and time-consuming, inefficient, high labor cost, and not suitable for large-scale fiber focusing. With the rapid development of computer technology, computer vision technology has brought unlimited possibilities to the automation industry. Using computer vision technology to evaluate the clarity of wool and cashmere fiber images has the advantages of being simple and convenient, high efficiency, low labor cost, and high degree of automation.
[0004] At present, some patents have proposed to evaluate the clarity of images based on the gradient information of the image. It is believed that the larger the gradient of the image, the clearer and sharper the texture and edges of the image, and the higher the clarity of the image. This method is suitable for evaluating the clarity of photos taken by ordinary cameras. However, wool and cashmere fiber images are microscopic images, and their clarity does not show the above rules. Therefore, their clarity evaluation cannot be carried out according to the above evaluation criteria. Summary of the invention
[0005] In order to solve the above-mentioned technical problems existing in the prior art, the purpose of the present invention is to provide a method for evaluating the clarity of wool and cashmere fiber images. The method first performs preliminary image preprocessing and target segmentation operations on the Z-axis image sequence shot at the same XY position to extract the fiber target area as the ROI (region of interest), and then completes the image clarity calculation through a clarity algorithm based on the binary edge histogram of the Z-axis image sequence. The image corresponding to the maximum clarity is the clearest image shot at the current XY position found.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A method for evaluating the clarity of wool and cashmere fiber images comprises the following steps:
[0008] For each fiber ROI image in the Z-axis image sequence at the same XY position fiber_roi Do the following:
[0009] S1 sets 4 thresholds, namely: thVal black_low , thVal black_high , thVal white_low , thVal white_high , thVal black_low thVal is the low threshold for filtering edge black spots. black_high thVal is the high threshold for filtering edge black spots. white_low thVal is the low threshold for filtering edge white points. white_high A high threshold for filtering out white spots on the edge;
[0010] S2 counts the number of edge white dots and edge black dots;
[0011] S3 normalizes the number of white and black dots on the edge;
[0012] S4 corrects the normalized results;
[0013] S5 calculates the clarity, and obtains the clarity variation curves of different Z positions corresponding to the same XY position. The image corresponding to the maximum clarity value is the clearest image to be found.
[0014] Furthermore, S1 is specifically as follows: 4 thresholds are set, namely: thVal black_low , thVal black_high , thVal white_low , thVal white_high , according to fiber ROI Figure I fiber_roi The gray value distribution interval of the non-zero pixel (x, y) in is used to classify it, specifically:
[0015]
[0016] Among them, label_I fiber_roi (x,y) represents fiber ROI image I fiber_roi The flag of the non-zero pixel in the image is 1, which indicates that the fiber ROI image I fiber_roi The non-zero pixel points (x, y) in the image are edge black dots, and the value of 2 indicates fiber ROI image I fiber_roi The non-zero pixel point (x, y) in is the edge white point. If Ifiber_roi (x, y) does not fall within the above two intervals, and the non-zero pixel point (x, y) is a normal point.
[0017] Further, S2 is as follows: for fiber ROI image I fiber_roi The number of edge white dots and edge black dots in the image is counted as follows:
[0018]
[0019] Among them, N black is the number of black dots on the edge, N white is the number of white dots on the edge, for each fiber ROI image in the Z-axis image sequence at the same XY position fiber_roi By performing the operation of counting the number of edge white dots and edge black dots, a statistical graph of the number of edge white and black dots of fibers at different Z positions can be obtained.
[0020] Furthermore, S3 is specifically as follows: normalizing the number of white and black dots on the edge and compressing the data to the range of [0,1], specifically:
[0021]
[0022] Among them, x norm and x represent the data of the number of white and black dots on the edge after and before normalization, respectively. max and x min They respectively represent the maximum and minimum values of the number of white and black spots on the edge before normalization. After the above normalization operation, the statistical graph of the number of white and black spots on the fiber edge at different Z positions after normalization and the statistical graph of the sum of the number of white and black spots can be obtained.
[0023] Furthermore, S4 is specifically as follows: two thresholds are set, and the normalized number of white and black points on the edge is subtracted from the respective thresholds, specifically:
[0024]
[0025]
[0026] Among them, N white_revise Indicates the number of white spots on the edge after correction, N white_norm Indicates the number of normalized edge white points, T white_norm Indicates the threshold value minus the number of normalized edge white points, N black_revise Indicates the number of edge black spots after correction, N black_norm Indicates the number of normalized edge black points, T white_normIt represents the threshold value subtracted from the normalized number of black dots on the edge. After the above operation, a statistical graph of the number of white and black dots on the fiber edge at different Z positions after correction can be obtained.
[0027] Further, S5 specifically includes: completing the calculation of image clarity through a clarity algorithm based on a binary edge histogram of a Z-axis image sequence, specifically:
[0028] S=2-N total
[0029] N total =N white_revise +N black_revise
[0030] Among them, N total It represents the sum of the number of edge white spots and edge black spots after correction, S represents the clarity of the image,
[0031] First, N white_revise and N black_revise The images are superimposed and the clarity of the image is calculated using a clarity algorithm based on the binary edge histogram of the Z-axis image sequence. The statistical graph of the sum of the number of corrected edge white spots and edge black spots and the image clarity change curve are obtained. The fiber image corresponding to the maximum clarity value is the clearest image to be found.
[0032] The beneficial effects of the present invention are as follows: the present invention adopts a clarity algorithm based on a binary edge histogram of a Z-axis image sequence to evaluate the clarity of a wool and cashmere fiber image. Compared with a method of evaluating the clarity of an image using image gradient information, the clarity of the wool and cashmere fiber is accurately evaluated. The clearest image found has a thin line at the edge without black or white edges, which meets the national standard for focusing of wool and cashmere fibers (GBT106852007). BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is the overall flow chart of the clarity evaluation method for wool and cashmere fiber images;
[0034] Figure 2 Flow chart for image clarity calculation;
[0035] Figure 3a-3d The original image (×20) of cashmere fiber at different Z positions (Z=-9, Z=-3, Z=3, Z=9) in the first XY position in the example of the present invention;
[0036] Figure 4 This is a cashmere fiber ROI image of the first Z position (Z=-9) in the first XY position in the example of the present invention;
[0037] Figure 5 Draw a diagram for the edge white spots and edge black spots of the fiber;
[0038] Figure 6 It is a statistical diagram of the number of white spots and black spots on the edge of the fiber;
[0039] Figure 7 It is a statistical diagram of the number of white spots and black spots on the edge of the normalized fiber;
[0040] Figure 8 It is a statistical diagram of the number of white spots and black spots on the edges of the corrected fibers;
[0041] Fig. 9 It is a statistical diagram of the number of edge white spots and edge black spots of the superimposed fibers;
[0042] Fig.10 It is the fiber image clarity change curve at the first XY position;
[0043] Fig.11 This is the clearest fiber image in the first XY position (Z=-3). DETAILED DESCRIPTION
[0044] The present invention will be further explained below with reference to the accompanying drawings and embodiments.
[0045] like Figure 1 As shown, a method for evaluating the clarity of wool and cashmere fiber images of the present invention comprises the following steps:
[0046] First, move the microscope to the roughly pre-set focal center, and under the premise of keeping the same XY position unchanged, continuously shoot 9 images every other unit along the negative direction of the Z axis (respectively recorded as: -1, -2, -3, -4, -5, -6, -7, -8, -9), and then continuously shoot 9 images every other unit along the positive direction of the Z axis (respectively recorded as: 1, 2, 3, 4, 5, 6, 7, 8, 9). The embodiment of the present invention selects the cashmere fiber image with Z=-9 in the first XY position as the input original image for explanation, and obtains the cashmere fiber target ROI image through the previous image preprocessing and target segmentation operations, as shown in FIG. Figure 4 shown.
[0047] Image clarity calculation, for each fiber ROI image in the Z-axis image sequence at the same XY position fiber_roi Perform the following operations, set 4 thresholds, count the number of edge white spots and edge black spots, normalize them respectively, set 2 thresholds, correct the normalized results, and calculate the clarity. You can get the clarity change curve of different Z positions corresponding to the same XY position. The image corresponding to the maximum clarity value is the clearest image to be found.
[0048] Execute step S1: set 4 thresholds, namely: thVal black_low (set to: 30), thVal black_high (Set to: 80), thVal white_low (set to: 220), thVal white_high (Set to: 255), according to the fiber ROI image I fiber_roi The gray value distribution interval of the non-zero pixel (x, y) in is used to classify it (edge white point, edge black point, ordinary point), specifically:
[0049]
[0050] Among them, label_I fiber_roi (x,y) represents fiber ROI image I fiber_roi The flag of the non-zero pixel in the image is 1, which indicates that the fiber ROI image I fiber_roi The non-zero pixel points (x, y) in the image are edge black dots, and the value of 2 indicates fiber ROI image I fiber_roi The non-zero pixel point (x, y) in is the edge white point. If I fiber_roi If (x, y) does not fall within the above two intervals, it means that the non-zero pixel point (x, y) is an ordinary point and is not considered. black_low thVal is the low threshold for filtering edge black spots. black_high thVal is the high threshold for filtering edge black spots. white_low thVal is the low threshold for filtering edge white points. white_high The cashmere fiber ROI diagram I of the first Z position (Z=-9) in the first XY position in the example of the present invention is fiber_roi After the above operation, the edge white point and edge black point drawing of the fiber are obtained, see Figure 5 shown.
[0051] Execute step S2: According to step S1, the fiber ROI image I fiber_roi The number of edge white dots and edge black dots in the image is counted as follows:
[0052]
[0053] Among them, N black is the number of black dots on the edge, N white is the number of white dots on the edge, for each fiber ROI image in the Z-axis image sequence at the same XY position fiber_roiThe operation of counting the number of edge white dots and edge black dots is performed to obtain a statistical diagram of the number of edge white dots and edge black dots of a fiber (the horizontal axis is different Z positions, and the vertical axis is the number of edge white (black) dots), see Figure 6 shown.
[0054] Execute step S3: In order to unify the numerical range of the number of white and black dots on the fiber edges at different Z positions, it is necessary to normalize the number of white (black) dots on the edges and compress the data to the range of [0,1], specifically:
[0055]
[0056] Among them, x norm and x represent the data of the number of white (black) points on the edge after and before normalization, respectively. max and x min and respectively represent the maximum and minimum values of the number of edge white (black) points before normalization. After the operation of step S33, a statistical diagram of the number of edge white points and edge black points of the normalized fiber is obtained (the horizontal axis is the different Z positions, and the vertical axis is the value of the edge white (black) points after normalization). Figure 7 shown.
[0057] Execute step S4: Since the average width of the white edge is always larger than that of the black edge in the fiber Z-axis image sequence, the normalized result is corrected as follows: two thresholds are set, and the number of white (black) edge points after normalization is subtracted from the respective thresholds to eliminate the influence of the inconsistency of the average width of the white edge and the black edge, specifically:
[0058]
[0059]
[0060] Among them, N white_revise Indicates the number of white spots on the edge after correction, N white_norm Indicates the number of normalized edge white points, T white_norm Indicates the threshold value minus the number of normalized edge white points, N black_revise Indicates the number of edge black spots after correction, N black_norm Indicates the number of normalized edge black points, T white_norm The threshold value is subtracted from the normalized number of edge black dots. After step S34, a statistical diagram of the number of edge white dots and edge black dots of the corrected fiber is obtained. Figure 8 shown.
[0061] Execute step S5: calculate the image clarity by using a clarity algorithm based on the binary edge histogram of the Z-axis image sequence, specifically:
[0062] S=2-N total
[0063] N total =N white_revise +N black_revise
[0064] Among them, N total It represents the sum of the number of edge white spots and edge black spots after correction, S represents the clarity of the image,
[0065] First, N white_revise and N black_revise The image clarity is calculated by using a clarity algorithm based on the binary edge histogram of the Z-axis image sequence, and the number of white spots and black spots on the edge of the superimposed fiber is obtained (see Fig. 9 ) and the fiber image clarity change curve at the first XY position (see Fig.10 As shown in FIG. 1 , the fiber image corresponding to the maximum clarity is the clearest, and then the clearest fiber image at the first XY position in the example of the present invention (Z=-3) is found. Fig.11 shown.
[0066] Finally, it should be noted that the above-mentioned embodiments are only used to better describe the present invention rather than to limit the present invention. Any technical solutions that can be obtained by those skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art without creative work should be within the scope of protection determined by the claims.
Claims
1. A method for evaluating the clarity of wool and cashmere fiber images, characterized in that, specifically includes the following steps: For each fiber ROI map I in the Z-axis image sequence at the same XY position fiber_roi perform the following operations: S1 sets 4 thresholds, which are respectively: thVal black_low , thVal black_high , thVal white_low , thVal white_high , thVal black_low is the low threshold for screening black dots on the edge, thVal black_high is the high threshold for screening black dots on the edge, thVal white_low is the low threshold for screening white dots on the edge, thVal white_high is the high threshold for screening white dots on the edge; S1 is specifically as follows: Set 4 thresholds, which are respectively: thVal black_low , thVal black_high , thVal white_low , thVal white_high , classify them according to the interval of the gray value distribution of the non-zero pixel points (x, y) in the fiber ROI map I fiber_roi . Specifically, it is as follows: Among them, label_I fiber_roi (x, y) represents the flag bit of non-zero pixel points in the fiber ROI map I fiber_roi The value of 1 indicates that the non-zero pixel point (x, y) in the fiber ROI map I fiber_roi is a black edge point, and the value of 2 indicates that the non-zero pixel point (x, y) in the fiber ROI map I fiber_roi is a white edge point. If I fiber_roi (x, y) does not fall within the above two intervals, the non-zero pixel point (x, y) is an ordinary point; S2 Count the number of edge white points and edge black points; S3 Normalize the number of edge white and black points; S4 Correct the normalization result; S5 Calculate the clarity, and the clarity change curve corresponding to different Z positions at the same XY position can be obtained. The image corresponding to the maximum clarity value is the clearest image to be searched. S5 is specifically: Calculate the image clarity through a clarity algorithm based on the binary edge histogram of the Z-axis image sequence. Specifically: S = 2 - N total N total = N white_revise + N black_revise Among them, N total represents the sum of the number of white edge points and the number of black edge points after correction, and S represents the clarity of the image. First, superimpose N white_revise and N black_revise Then, calculate the clarity of the image through a clarity algorithm based on the binary edge histogram of the Z-axis image sequence, and respectively obtain a statistical chart of the sum of the corrected edge white points and edge black points and a curve of the change in image clarity. The fiber image corresponding to the maximum clarity value is the clearest image to be searched for.
2. The method for evaluating the clarity of wool and cashmere fiber images according to claim 1, characterized in that, S2 is as follows: For the fiber ROI map I fiber_roi count the number of white edge points and black edge points, specifically: where N black is the number of black edge points, and N white is the number of white edge points. For each fiber ROI image I in the Z-axis image sequence at the same XY position, fiber_roi perform the operation of counting the number of white and black edge points, and a statistical graph of the number of white and black edge points of fibers at different Z positions can be obtained.
3. The method for evaluating the clarity of wool and cashmere fiber images according to claim 2, characterized in that, S3 is specifically: Normalize the number of edge white and black points, and compress the data to the range of [0,1]. Specifically: Among them, x norm and x respectively represent the data of the number of white and black dots at the edge after and before normalization. x max and x min respectively represent the maximum and minimum values of the number of white and black dots at the edge before normalization. After the above normalization operation, the statistical charts of the number of white and black dots and the sum of the number of white and black dots at the fiber edge at different Z positions after normalization can be obtained.
4. The method for evaluating the clarity of wool and cashmere fiber images according to claim 3, characterized in that, S4 is specifically: Set two thresholds, and subtract the respective thresholds from the normalized number of edge white and black points. Specifically: Among them, N white_revise represents the number of white edge dots after correction, and N white_norm represents the number of normalized white edge dots, T white_norm represents the threshold value subtracted from the number of normalized white edge dots, N black_revise represents the number of black edge dots after correction, and N black_norm represents the number of normalized black edge dots, T white_norm represents the threshold value subtracted from the number of normalized black edge dots. After the above operations, the statistical charts of the numbers of white and black dots on the fiber edges at different Z positions after correction can be obtained.
Citation Information
Patent Citations
Image definition evaluating method and device
CN106127775A
An image definition evaluation method based on strong edge detection
CN109767449A