Slice scanner label recognition method, name recognition method and system for slices

By performing grayscale, edge detection, highlight removal and binary processing on the slice label image, the label image to be identified is formed, which solves the problem of low accuracy of slice label recognition in the prior art, and achieves a higher recognition accuracy.

CN115035076BActive Publication Date: 2025-04-25WINMEDIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210698552.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-04-25
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

The existing barcode or QR code recognition methods in the slice label area have low recognition accuracy due to different label printing methods, different color depths, and poor brightness uniformity.

Method used

By obtaining the sliced ​​label image, converting it into a grayscale image, edge detection and bright spot removal and black spot removal, binarization processing is performed and superimposed with the grayscale image to form the label image to be identified, and finally barcode or QR code recognition is performed.

Benefits of technology

The recognition accuracy of barcodes or QR codes in slice labels is improved, and the problem of low recognition accuracy caused by poor label printing method and brightness uniformity is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035076B_ABST
    Figure CN115035076B_ABST
Patent Text Reader

Abstract

The present invention discloses a slice scanner label recognition method, name recognition method and system for slices, including: obtaining a slice label image; converting the label image into a grayscale image; performing edge detection on the grayscale image to obtain an edge-detected image; removing bright spots and black spots in the edge-detected image to obtain a cleaned image; binarizing the cleaned image to obtain a binarized image; superimposing the binarized image with the grayscale image to obtain a label image to be recognized; and recognizing a barcode or a two-dimensional code in the label image to be recognized to obtain recognition information. Accurate recognition of the barcode or two-dimensional code information in the slice label is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a slice label recognition method, a slice name recognition method and a system for a slice scanner. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Digital slide scanner is a device for digitizing glass slides. Glass solid slides are composed of two parts: one is the tissue area, which is covered with a cover glass; the other is the label area, which is printed with relevant information about the slide. The tissue area is digitized into a full-information digital slide using the microscopic image part of the digital slide scanner; and the label area, as an important part of the slide information, is recorded in the digital slide file in the form of a picture; and the label information needs to be identified during the scanning process.

[0004] The label of a slice generally includes: name, gender, age, number, staining method, barcode or QR code, etc. Among these information, the label information may vary depending on the situation, but the barcode or QR code generally exists in the label area.

[0005] The existing barcode or QR code recognition method is: barcodes are generally first identified by performing gradient processing, binarization processing, morphological processing, contour detection and other operations; QR codes are first identified by performing binarization processing, contour processing, and corner mark positioning and other operations.

[0006] In the slice label area, the barcode or QR code type, size, and position are different due to various reasons; there are also differences in the printing methods of labels, some are printed on label paper, and some are printed on special numbering machines, resulting in different shades of barcode or QR code colors; at the same time, due to the influence of the label light source of the digital slice scanner, the brightness uniformity of the label area image is very poor, resulting in low recognition accuracy when the QR code or barcode in the label area is recognized by the existing barcode or QR code recognition method. Summary of the invention

[0007] In order to solve the above problems, the present invention proposes a slice label recognition method, a name recognition method and a system for a slice scanner, which can accurately recognize the barcode or QR code information in the slice label, and can obtain setting information from the recognition information to name the slice.

[0008] To achieve the above object, the present invention adopts the following technical solution:

[0009] In the first aspect, a method for identifying a label of a slice by a slice scanner is proposed, comprising:

[0010] Get the label image of the slice;

[0011] Convert the label image into a grayscale image;

[0012] Perform edge detection on the grayscale image to obtain an image after edge detection;

[0013] Remove bright spots and black spots from the image after edge detection to obtain a cleaned image;

[0014] Binarization is performed on the cleaned image to obtain a binarized image;

[0015] Superimpose the binarized image with the grayscale image to obtain the label image to be identified;

[0016] Identify the barcode or QR code in the label image to be identified and obtain identification information.

[0017] Secondly, a method for slice name recognition by a slice scanner is proposed, including:

[0018] Acquire identification information by using the label recognition method of the slice scanner proposed in the first aspect;

[0019] The setting information is extracted from the identification information as a slice name.

[0020] Thirdly, a slice name recognition system for a slice scanner is proposed, including:

[0021] The identification information acquisition module is used to obtain the label image of the slice; convert the label image into a grayscale image; perform edge detection on the grayscale image to obtain an image after edge detection; remove bright spots and black spots in the image after edge detection to obtain a cleaned image; perform binarization on the cleaned image to obtain a binarized image; superimpose the binarized image with the grayscale image to obtain a label image to be identified; identify the barcode or QR code in the label image to be identified to obtain identification information;

[0022] The slice naming module is used to extract setting information from the identification information as the slice name.

[0023] In a fourth aspect, an electronic device is proposed, comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps described in the method for identifying the name of a slice by a slice scanner are completed.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] 1. The present invention can accurately identify the barcode or QR code information in the slice label, and can obtain setting information from the identification information to name the slice.

[0026] 2. When identifying the barcode or two-dimensional code information in the slice label, the present invention converts the acquired label image into a grayscale image, performs edge detection on the grayscale image to obtain an image after edge detection, removes bright spots and black spots in the image after edge detection to obtain a cleaned image, binarizes the cleaned image to obtain a binarized image, superimposes the binarized image with the grayscale image to obtain a label image to be identified, and then identifies the label image to be identified, thereby improving the accuracy of barcode or two-dimensional code recognition in the slice label, and solving the problem of low accuracy of two-dimensional code or barcode recognition caused by different printing colors of the label, label brightness, and different positions of the barcode or two-dimensional code in the label.

[0027] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0029] Figure 1 is a flow chart of the method disclosed in Example 1;

[0030] Figure 2 The barcode or QR code recognition flow chart disclosed in Example 1;

[0031] Figure 3 The label image of the slice obtained in Example 1;

[0032] Figure 4 The pre-processed image obtained in Example 1;

[0033] Figure 5 The image after edge detection obtained in Example 1;

[0034] Figure 6 The label image to be identified obtained in Example 1;

[0035] Figure 7 The window area image obtained in Example 1;

[0036] Figure 8 This is a flow chart of the method disclosed in Example 2. DETAILED DESCRIPTION

[0037] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0038] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0039] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0040] Example 1

[0041] In order to accurately identify the barcode or QR code in the slice label, in this embodiment, a slice label identification method for a slice scanner is disclosed, including:

[0042] Get the label image of the slice;

[0043] Convert the label image into a grayscale image;

[0044] Perform edge detection on the grayscale image to obtain an image after edge detection;

[0045] Remove bright spots and black spots from the image after edge detection to obtain a cleaned image;

[0046] Binarization is performed on the cleaned image to obtain a binarized image;

[0047] Superimpose the binarized image with the grayscale image to obtain the label image to be identified;

[0048] Identify the barcode or QR code in the label image to be identified and obtain identification information.

[0049] The method for identifying slice labels by the slice scanner disclosed in this embodiment is described in detail.

[0050] like Figure 1 As shown, the method for identifying the label of a slice by a slice scanner includes:

[0051] S1: Get the label image of the slice.

[0052] Place the glass slice into the digital slice scanner and use the preview camera to acquire the slice label image ImageLabel, such as Figure 3 shown.

[0053] S2: Convert the label image into a grayscale image, including:

[0054] S21: Preprocess the label image to obtain a preprocessed image.

[0055] The preprocessing process is:

[0056] Perform white balance processing and brightness enhancement on the label image ImageLabel to obtain the enhanced image ImageEnhance;

[0057] The enhanced image ImageEnhance is processed for clarity enhancement to obtain the preprocessed image ImageClarity, such as Figure 4 shown.

[0058] S22: Convert the preprocessed image into a grayscale image.

[0059] Convert the preprocessed image ImageClarity obtained in S21 into a grayscale image ImageGray.

[0060] S3: Perform edge detection on the grayscale image to obtain an image after edge detection.

[0061] Specifically:

[0062] Perform edge detection on the grayscale image ImageGray in the X and Y directions respectively to obtain an edge image in the X direction and an edge image in the Y direction;

[0063] The edge image in the X direction and the edge image in the Y direction are superimposed to obtain the image ImageSobel after edge detection, as shown in Figure 5 shown.

[0064] In specific implementation, the Sobel operator is preferably used to perform edge detection on the grayscale image ImageGray.

[0065] S4: removing bright spots and black spots from the image after edge detection to obtain a cleaned image.

[0066] Specifically:

[0067] Perform an opening operation on the image ImageSobel after edge detection to remove the bright spots in the image ImageSobel after edge detection, and obtain an image after removing the bright spots;

[0068] The dilation operation is performed on the image after bright spot removal to remove black spots in the image after bright spot removal to obtain the cleaned image ImageRemove.

[0069] S5: Binarization is performed on the cleaned image ImageRemove to obtain a binarized image ImageBinary.

[0070] S6: Superimpose the binarized image ImageBinary and the grayscale image ImageGray to obtain the label image ImageFinal to be identified, such as Figure 6 shown.

[0071] S7: Identify the barcode or QR code in the label image ImageFinal to be identified, and obtain identification information, including:

[0072] A moving window method is used to obtain a window area image from the label image to be identified;

[0073] When the color value of the window area image is not greater than the set threshold, the window area image is identified to obtain identification information.

[0074] In specific implementation, it includes:

[0075] S71: setting the width LabelWidth, height LabelHeight and moving step MoveStep of the moving window according to the size of the barcode or QR code.

[0076] When the size of the barcode or QR code is 100x100, set the width of the moving window LabelWidth=100, the height LabelHeight=100, and the moving step MoveStep=10.

[0077] S72: In the label image to be identified, select a starting point of the moving window.

[0078] Set the point X=0, Y=0 in the label image to be identified as the initial starting point of the moving window.

[0079] S73: Taking the starting point as the end point of the window, selecting a window area with a width and a height, and obtaining a window area image.

[0080] The rectangular area Rect=(0, 0, 100, 100) in the label image ImageFinal to be identified is intercepted to obtain the window area image RectImage.

[0081] S74: When the color value of the window area image is less than or equal to the set threshold, the window area image is identified to obtain identification information.

[0082] The set threshold is 150. When the color value of the window area image RectImage is 137, the color value is less than the set threshold 150. The window area image RectImage is subjected to two-dimensional code or barcode recognition to obtain identification information strLabelResult, which is the information of the recognized two-dimensional code or barcode.

[0083] When the color value of the window area image is greater than the set threshold, the window area image recognition fails, or when the value of the recognition information strLabelResult is empty, go to S75.

[0084] S75: On the label image to be identified, the starting point is moved in the X direction by a set moving step. When the sum of the X coordinate of the starting point and the width of the window is less than the width of the label image, the point obtained by moving the starting point in the X direction by the set moving step is taken as the starting point, and S73 and S74 are repeated.

[0085] Assume that the initial starting point is moved in the X direction by the set moving step, and a new starting point X=X+MoveStep=10, Y=0 is obtained; if X+LabelWidth=100 is less than or equal to the width of the label image ImageLabel 250, then take the point obtained after moving the starting point in the X direction by the moving step as the starting point, repeat S73 and S74, at this time, the rectangular area Rect=(10, 0, 100, 100).

[0086] When the window area image is not recognized in the X direction, the process goes to S76.

[0087] S76: On the label image to be identified, move the starting point in the Y direction by the set moving step. When the sum of the Y coordinate of the starting point and the height of the window is less than the height of the label image, take the point obtained by moving the starting point in the Y direction by the set moving step as the starting point, and repeat S73 and S74.

[0088] Assume that the initial starting point is moved in the Y direction by the set moving step, and a new starting point X=0, Y=Y+MoveStep=10 is obtained; if Y+LabelHeight=10 is less than or equal to the height of the label image ImageLabel 187, then take the point obtained after moving the starting point in the Y direction by the set moving step as the starting point, and repeat S73 and S74. At this time, the rectangular area Rect=(0, 10, 100, 100).

[0089] Finally, the following is selected through the rectangular area (0, 20, 100, 100) Figure 7 The window area image shown is identified, and the identification information strLabelResult=barcode is obtained.

[0090] The slice scanner disclosed in the present embodiment has a label recognition method for slices, which can accurately recognize the barcode or two-dimensional code information in the slice label. When recognizing the barcode or two-dimensional code information in the slice label, the acquired label image is converted into a grayscale image, edge detection is performed on the grayscale image to obtain an image after edge detection, bright spots and black spots in the image after edge detection are removed to obtain a cleaned image, the cleaned image is binarized to obtain a binarized image, the binarized image is superimposed with the grayscale image to obtain a label image to be recognized, and then the label image to be recognized is recognized, thereby improving the accuracy of barcode or two-dimensional code recognition in slice labels, and solving the problem of low accuracy of two-dimensional code or barcode recognition caused by different printing colors of labels, label brightness, and different positions of barcodes or two-dimensional codes in labels.

[0091] Example 2

[0092] In this embodiment, a method for slice scanner to identify the name of slice is disclosed, such as Figure 8 As shown, including:

[0093] Acquire identification information by using the slice scanner disclosed in Example 1 to identify the slice label;

[0094] The setting information is extracted from the identification information as a slice name.

[0095] Specifically, the first line of information strInfo is intercepted from the identification information strLabelResult; and a character string with a specified starting position of 1 and a length of 7 is intercepted and assigned to strSlideName=barcode as the slice name.

[0096] When the identification information obtained by the label identification method of the slice scanner disclosed in Example 1 is empty, the slice is named in a set manner.

[0097] The setting method is a combination of year, month, day, hour, minute and second.

[0098] That is, when the color value of the window area image is greater than the set threshold, or the window area image is not found, the identification information is empty, and the slice name strSlideName is set to a fixed-length string of year, month, day, hour, minute, and second, and the slice file is named strSlideName.

[0099] Start scanning digital slices by naming the slice file with strSlideName.

[0100] The slice name recognition method of the slice scanner disclosed in this embodiment can name the slice by extracting setting information from the recognition information based on the accurate recognition of the barcode or QR code information in the slice label. Under the named slice file, the digital slice is scanned, which facilitates the storage and search of the slice information.

[0101] Example 3

[0102] In this embodiment, a system for identifying the name of a slice by a slice scanner is disclosed, comprising:

[0103] The identification information acquisition module is used to obtain the label image of the slice; convert the label image into a grayscale image; perform edge detection on the grayscale image to obtain an image after edge detection; remove bright spots and black spots in the image after edge detection to obtain a cleaned image; perform binarization on the cleaned image to obtain a binarized image; superimpose the binarized image with the grayscale image to obtain a label image to be identified; identify the barcode or QR code in the label image to be identified to obtain identification information;

[0104] The slice naming module is used to extract setting information from the identification information as the slice name.

[0105] Example 3

[0106] In this embodiment, an electronic device is disclosed, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps described in the method for identifying the name of a slice by a slice scanner disclosed in Example 2 are completed.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for identifying a label of a slice by a slice scanner, characterized in that: include: Get the label image of the slice; Convert the label image into a grayscale image; Perform edge detection on the grayscale image to obtain an image after edge detection; Remove bright spots and black spots from the image after edge detection to obtain a cleaned image; Binarization is performed on the cleaned image to obtain a binarized image; Superimpose the binarized image with the grayscale image to obtain the label image to be identified; Identify the barcode or QR code in the label image to be identified to obtain identification information; The process of obtaining identification information is: The moving window method is used to obtain the window area image from the label image to be identified, including: S71: Setting the width, height and moving step of the moving window according to the size of the barcode or QR code; S72: In the label image to be identified, selecting a starting point of the moving window; S73: Taking the starting point as the end point of the window, selecting a window area with a width and a height, and obtaining an image of the window area; S74: When the color value of the window area image is less than or equal to the set threshold, the window area image is identified to obtain identification information; When the color value of the window area image is greater than the set threshold, the window area image recognition fails, or when the value of the recognition information is empty, go to S75; S75: On the label image to be recognized, the starting point is moved in the X direction by a set moving step. When the sum of the X coordinate of the starting point and the width of the window is less than the width of the label image, the point obtained by moving the starting point in the X direction by the set moving step is taken as the starting point, and S73 and S74 are repeated. When the window area image is not recognized in the X direction, go to S76; S76: On the label image to be identified, move the starting point in the Y direction by the set moving step. When the sum of the Y coordinate of the starting point and the height of the window is less than the height of the label image, take the point obtained by moving the starting point in the Y direction by the set moving step as the starting point, and repeat S73 and S74.

2. The method for identifying a label of a slice by a slice scanner according to claim 1, characterized in that: Preprocess the label image to obtain a preprocessed image; Convert the preprocessed image into a grayscale image.

3. The method for identifying a label of a slice by a slice scanner as claimed in claim 2, characterized in that: The process of preprocessing the label image is: Perform white balance and brightness enhancement on the label image to obtain an enhanced image; The enhanced image is subjected to clarity enhancement processing to obtain a preprocessed image.

4. The method for identifying a label of a slice by a slice scanner according to claim 1, characterized in that: The process of obtaining the image after edge detection is: Perform edge detection on the grayscale image in the X and Y directions respectively to obtain an edge image in the X direction and an edge image in the Y direction; The edge image in the X direction and the edge image in the Y direction are superimposed to obtain the image after edge detection.

5. The method for identifying a label of a slice by a slice scanner according to claim 1, characterized in that: Performing an opening operation on the image after edge detection to remove bright spots in the image after edge detection, and obtaining an image after bright spots are removed; The dilation operation is performed on the image after bright spot removal to remove black spots in the image after bright spot removal to obtain a cleaned image.

6. A method for identifying the name of a slice by a slice scanner, characterized in that: include: Acquiring identification information by using the label recognition method of the slice scanner according to any one of claims 1 to 5; The setting information is extracted from the identification information as a slice name.

7. The method for identifying the name of a slice by a slice scanner according to claim 6, characterized in that: When the identification information is empty, the slice is named in the specified way.

8. A system for identifying the name of a slice by a slice scanner, characterized in that: include: The identification information acquisition module is used to obtain the label image of the slice; convert the label image into a grayscale image; perform edge detection on the grayscale image to obtain an image after edge detection; Remove bright spots and black spots from the image after edge detection to obtain a cleaned image; Binarize the cleaned image to obtain a binarized image; superimpose the binarized image with the grayscale image to obtain a label image to be identified; identify the barcode or QR code in the label image to be identified to obtain identification information; The process of obtaining identification information is: The moving window method is used to obtain the window area image from the label image to be identified, including: S71: Setting the width, height and moving step of the moving window according to the size of the barcode or QR code; S72: In the label image to be identified, selecting a starting point of the moving window; S73: Taking the starting point as the end point of the window, selecting a window area with a width and a height, and obtaining an image of the window area; S74: When the color value of the window area image is less than or equal to the set threshold, the window area image is identified to obtain identification information; When the color value of the window area image is greater than the set threshold, the window area image recognition fails, or when the value of the recognition information is empty, go to S75; S75: On the label image to be recognized, the starting point is moved in the X direction by a set moving step. When the sum of the X coordinate of the starting point and the width of the window is less than the width of the label image, the point obtained by moving the starting point in the X direction by the set moving step is taken as the starting point, and S73 and S74 are repeated. When the window area image is not recognized in the X direction, go to S76; S76: On the label image to be identified, the starting point is moved in the Y direction by a set moving step. When the sum of the Y coordinate of the starting point and the height of the window is less than the height of the label image, the point obtained by moving the starting point in the Y direction by the set moving step is taken as the starting point, and S73 and S74 are repeated. The slice naming module is used to extract setting information from the identification information as the slice name.

9. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein the steps of the method according to claim 6 are completed when the computer instructions are executed by the processor.

Citation Information

Patent Citations

  • Robust recognition method for AR code marked on cylinder

    CN106407973A

  • Bar code detection method and device, equipment and storage apparatus

    CN112699704A