A system and method for automatically and continuously collecting microscopic images of coal samples
By performing edge detection and clarity calculation on coal microscope images and adjusting the acquisition frame number, the problems of unclear acquisition of coal microscope images and inaccurate judgment results are solved, and clearer image acquisition and more accurate judgment are achieved.
Patent Information
- Application Number
- CN202411794581.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-09
AI Technical Summary
When using a digital camera to continuously collect coal microscope images, the image may be unclear, which increases the subsequent workload, and judging image clarity depends on human experience and is susceptible to subjective factors, resulting in inaccurate results.
By performing edge detection on the collected coal microscope images, the edge intensity and outlierness of each frame of edge images are obtained, the clarity of each frame of images is calculated, and the number of frames collected per second is adjusted according to the clarity to ensure the clarity of the acquired images is .
The collected coal microscope images are clearer, reducing the subsequent workload, and avoiding inaccurate judgment results under the influence of human subjective factors.
Smart Images

Figure CN119277002B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a system and method for automatically and continuously acquiring microscopic images of coal samples. Background Art
[0002] The microscopic components of coal are important reference indicators for coal classification and grading. They determine the physical and chemical properties and process characteristics of coal, and directly affect the combustion efficiency and subsequent industrial use of coal. In the actual production process, the microscopic components of coal can be analyzed to evaluate the quality and use of coal and achieve efficient use of coal. The traditional method of identifying the microscopic components of coal based on human eye observation under a microscope is highly professional and requires the operator to have rich knowledge and skilled microscope operation skills. This method is time-consuming and labor-intensive, with a low degree of automation. The analysis results are easily affected by the subjective cognition of the tester, and the comparability between laboratories is poor, so it cannot be widely used. In recent years, with the rapid development of machine learning and computer vision technology, the method of identifying the microscopic components of coal based on image analysis has gradually replaced the method of identifying the microscopic components of coal based on human eye observation. It has greatly improved the automation level and recognition accuracy. Therefore, it is necessary to collect coal microscopic images first.
[0003] Chen Zhifeng, China University of Mining and Technology, in 2023, proposed a paper on the research of coal rock microscopic component identification based on deep semantic segmentation technology. The paper pointed out that when observing the microscopic structure of coal, after a clearer microscopic structure can be observed in the eyepiece, a digital camera is used to take pictures, and the captured images are saved and analyzed.
[0004] In the process of continuously collecting coal microscopic images, the focal length of the optical microscope is continuously adjusted, and the digital camera is used to continuously collect coal microscopic images during the adjustment process, resulting in some of the collected coal microscopic images being unclear, which increases the subsequent workload. In the above-mentioned paper, the judgment of whether the coal microscopic image is clear is still based on human experience, which is easily affected by human subjective factors, resulting in inaccurate judgment results. Summary of the invention
[0005] In order to solve the technical problems that when using a digital camera to continuously collect coal microscopic images, some of the collected coal microscopic images are unclear, which increases the subsequent workload, and the judgment of whether the coal microscopic images are clear is still based on human experience, which is easily affected by human subjective factors, thus leading to inaccurate judgment results, the present invention provides a system and method for automatically and continuously collecting microscopic images of coal samples.
[0006] In a first aspect, the present invention provides a method for automatically and continuously collecting microscopic images of coal samples, which adopts the following technical solution:
[0007] A method for automatically and continuously collecting microscopic images of coal samples comprises the following steps:
[0008] Collect coal microscopic images and perform edge detection on them to obtain edge images; obtain the edge strength of each edge in each frame of edge images; obtain the degree of outliers of each edge in each frame of edge images; and use the ratio of the mean of the edge strength of all edges in each frame of edge images to the standard deviation of the degree of outliers of all edges as the clarity of each frame of coal microscopic images;
[0009] Get the frame rate adjustment factor ; represents the frame number of the coal microscopic image; Represents the clarity of the k-th frame of the coal microscopic image; Represents the clarity of the k-1th frame of the coal microscopic image; Represents the preset hyperparameter; tanh() represents the hyperbolic tangent function; the number of acquired frames per second is adjusted to obtain the adjusted number of acquired frames per second.
[0010] The innovation of the present invention lies in analyzing the collected coal microscopic images, obtaining the clarity of each frame of the coal microscopic image, obtaining a frame adjustment factor based on the clarity, and collecting the coal microscopic images of the next second after adjusting the number of frames collected per second, so that the collected coal microscopic images are clearer, reducing the subsequent workload, and avoiding the influence of human subjective factors when judging the clarity of the image based on human experience, resulting in inaccurate judgment results.
[0011] Preferably, the process of acquiring the edge image includes:
[0012] The Canny operator is used to perform edge detection on each frame of coal microscopic image to obtain edge images of each frame.
[0013] It is convenient to obtain the clarity of each frame of coal microscopic image by analyzing the edges in each frame of edge image.
[0014] Preferably, the step of obtaining the edge strength of each edge of each frame of edge image includes:
[0015] Get the gradient amplitude of each edge point in each frame of edge image;
[0016] ;
[0017] In the formula, Represents the edge strength of each edge of each frame of edge image; Represents the gradient amplitude of the vth edge point on the jth edge in the i-th frame edge image; Represents the number of edge points on the jth edge in the i-th frame edge image; norm() represents the normalization function.
[0018] The greater the edge strength of each edge of each frame of the edge image, the clearer the image is. It is then convenient to obtain the clarity of each frame of the coal microscopic image based on the edge strength of each edge of each frame of the edge image.
[0019] Preferably, obtaining the gradient amplitude of each edge point in each frame of edge image includes:
[0020] ;
[0021] In the formula, Represents the gradient amplitude of the mth edge point in the i-th frame edge image; Represents the grayscale difference between two pixels adjacent to the mth edge point in the i-th frame edge image; Represents the grayscale difference between the two pixels adjacent to each other in the vertical direction of the mth edge point in the i-th edge image.
[0022] Preferably, obtaining the outlier degree of each edge in each frame of edge image includes:
[0023] Get the center coordinates of each edge in each frame of edge image;
[0024] ;
[0025] In the formula, Represents the degree of outlier of the jth edge in the i-th frame edge image; Represents the number of edges in the edge image of the i-th frame; Represents the Euclidean distance between the center coordinates of the jth edge in the i-th frame edge image and the c-th edge other than it; Represents the mean Euclidean distance between the jth edge and the center coordinates of all other edges in the i-th frame edge image; norm() represents the normalization function.
[0026] This facilitates the subsequent acquisition of the clarity of each frame of the coal microscopic image according to the degree of outliers of each edge in each frame of the edge image.
[0027] Preferably, obtaining the center coordinates of each edge in each frame of edge image includes:
[0028] For any edge in the edge image of the i-th frame, the mean value of the coordinates of all edge points in the edge is taken as the center coordinate of the edge.
[0029] Preferably, adjusting the number of acquisition frames per second to obtain the adjusted number of acquisition frames per second includes:
[0030] ;
[0031] In the formula, Represents the adjusted number of captured frames per second; Represents the number of frames collected per second; Represents the frame rate adjustment factor; Represents the floor symbol.
[0032] The images acquired according to the adjusted frames per second are clearer.
[0033] In a second aspect, the present invention provides a system for automatically and continuously collecting microscopic images of coal samples, which adopts the following technical solution:
[0034] A system for automatically and continuously collecting microscopic images of coal samples comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for automatically and continuously collecting microscopic images of coal samples is implemented.
[0035] By adopting the above technical solution, the above-mentioned method for automatic continuous acquisition of microscopic images of coal samples is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made based on the memory and the processor for easy use.
[0036] The present invention has the following technical effects: the purpose of the present invention is to obtain the clarity of each frame of coal microscopic image, obtain a frame adjustment factor based on the clarity, adjust the number of frames collected per second, and then collect the accurate coal microscopic image of the next second, so that the collected coal microscopic image is clearer, reducing the subsequent workload, and avoiding the influence of human subjective factors when judging the clarity of the image based on human experience, resulting in inaccurate judgment results. Furthermore, the clarity of each frame of coal microscopic image is obtained based on the edge strength of each edge of each frame of edge image and the degree of outlier of each edge in each frame of edge image, so that the clarity of each frame of coal microscopic image is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0038] Figure 1 The present invention is a flowchart of a method for automatically and continuously collecting microscopic images of coal samples in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0040] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0041] The embodiment of the present invention discloses a method for automatically and continuously collecting microscopic images of coal samples, referring to Figure 1 , comprising steps S1 to S3:
[0042] S1: Collect each frame of coal microscopic image.
[0043] It should be noted that the composition, structure, properties and coalification degree of various microscopic components of coal can be qualitatively analyzed and quantitatively measured through optical microscopy. Through microscopic analysis, indicators such as the microscopic composition and coalification degree of coal can be obtained. These indicators are an important basis for evaluating the properties and uses of coal, and are also the basis for studying the origin of coal, coal accumulation rules and coal hydrocarbon-generating capacity. Therefore, it is necessary to collect microscopic images of coal.
[0044] In the embodiment of the present invention, the preset acquisition frame number per second is 10 frames, and the acquisition time is 1 second. The coal microscopic RGB image is acquired by using an optical microscope and a digital camera. For the convenience of subsequent processing, each frame of the coal microscopic RGB image is grayed to obtain a coal microscopic image.
[0045] S2: Perform edge detection on each frame of coal microscopic image to obtain each frame of edge image; obtain the edge strength of each edge in each frame of edge image according to the gradient amplitude of each edge point in each frame of edge image; obtain the center coordinates of each edge in each frame of edge image, obtain the degree of outlier of each edge in each frame of edge image according to the center coordinates of each edge in each frame of edge image, and obtain the clarity of each frame of coal microscopic image according to the edge strength and the degree of outlier.
[0046] It should be noted that in the process of continuously collecting coal microscopic images, the focal length of the optical microscope is continuously adjusted, and the coal microscopic images are continuously collected by a digital camera during the adjustment process, resulting in some of the collected coal microscopic images being unclear, which increases the subsequent workload. When judging whether the coal microscopic images are clear, it is still based on human experience, which is easily affected by human subjective factors, resulting in inaccurate judgment results. Therefore, it is necessary to analyze the clarity of the coal microscopic images during the collection process in order to obtain clear coal microscopic images.
[0047] Step S2 includes steps S20 and S21, which are specifically as follows:
[0048] S20: Perform edge detection on each frame of the coal microscopic image to obtain each frame of the edge image; and obtain the edge strength of each edge of each frame of the edge image according to the gradient amplitude of each edge point in each frame of the edge image.
[0049] It should be noted that a clear image means a clear and distinct edge without blur or distortion. Therefore, the present invention can perform edge detection on each frame of coal microscopic images to obtain edge images, and judge the clarity of each frame of coal microscopic images based on the edge images. For the edge images of coal microscopic images, which contain multiple edges, if there are more edges in the edge image, it means that there are more details detected in the coal microscopic image, that is, the coal microscopic image has a higher clarity. At the same time, if the gradient amplitude of the edge point on any edge in the edge image is larger, it means that the edge point is more obvious, that is, the edge strength of the edge is stronger. Therefore, the present invention obtains the edge strength of each edge in each frame of edge images through the gradient amplitude of each edge point in each frame of edge images and the number of edges in each frame of edge images.
[0050] In the embodiment of the present invention, the Canny operator is used to perform edge detection on each frame of the coal microscopic image to obtain each frame of the edge image, wherein the edge image contains multiple edges, and the pixel points on the edge are recorded as edge points.
[0051] Get the gradient magnitude of each edge point in each frame of edge image:
[0052] ;
[0053] In the formula, Represents the gradient amplitude of the mth edge point in the i-th frame edge image; Represents the grayscale difference between two pixels adjacent to the mth edge point in the i-th frame edge image; Represents the grayscale difference between the two pixels adjacent to each other in the vertical direction of the mth edge point in the i-th edge image.
[0054] Get the edge strength of each edge of each frame of the edge image:
[0055] ;
[0056] In the formula, Represents the edge strength of each edge of each frame of edge image; Represents the gradient amplitude of the vth edge point on the jth edge in the i-th frame edge image; Represents the number of edge points on the jth edge in the i-th frame edge image; norm() represents the normalization function; if there are more edge points on the edge and the gradient amplitude of the edge points on the edge is larger, the edge strength of the edge is higher.
[0057] S21: Obtain the center coordinates of each edge in each frame of edge image, obtain the degree of outlier of each edge in each frame of edge image based on the center coordinates of each edge in each frame of edge image, and obtain the clarity of each frame of coal microscopic image based on the edge strength and the degree of outlier.
[0058] It should be noted that, for any frame of coal microscopic image, the more uniform the edge distribution in the frame of coal microscopic image is, the more uniformly it means that the frame of coal microscopic image contains sufficient details, indicating that the frame of coal microscopic image has good clarity as a whole. Therefore, the present invention calculates the clarity of the frame of coal microscopic image based on the edge strength of all edges and the distribution of edges in the image.
[0059] In the embodiment of the present invention, for any edge in the i-th frame edge image, the mean value of the coordinates of all edge points in the edge is taken as the center coordinate of the edge to obtain the center coordinate of each edge in each frame edge image.
[0060] Get the outlier degree of each edge in each frame of the edge image:
[0061] ;
[0062] In the formula, Represents the degree of outlier of the jth edge in the i-th frame edge image; Represents the number of edges in the edge image of the i-th frame; Represents the Euclidean distance between the center coordinates of the jth edge in the i-th frame edge image and the c-th edge other than it; represents the mean Euclidean distance between the center coordinates of the jth edge and all other edges in the edge image of the i-th frame; norm() represents the normalization function; Represents the distance difference between the center coordinates of the jth edge and other edges in the edge image of the i-th frame. The higher its value, the higher the degree of outlier of the jth edge. The confidence level represents the degree of outlier of the j-th edge in the i-th edge image. The smaller the value, the smaller the difference in Euclidean distance between the j-th edge and other edges in the i-th edge image. At this time, the degree of outlier of the j-th edge in the i-th edge image is.
[0063] It should be noted that if the mean value of the edge strength of all edges in the i-th frame edge image is larger, the edges in the i-th frame edge image are clearer, and the standard deviation of the outlier degree of all edges in the i-th frame edge image is smaller, the distribution of all edges in the i-th frame edge image is more uniform, that is, the i-th frame edge image is clearer.
[0064] The mean of the edge strengths of all edges in the i-th frame edge image is recorded as the first mean; the ratio of the first mean to the standard deviation of the outlier degree of all edges in the i-th frame edge image is taken as the clarity of the i-th frame edge image, that is, the clarity of the i-th frame coal microscopic image. Similarly, the clarity of each frame edge image is obtained.
[0065] S3: Obtain a frame number adjustment factor according to each frame of the coal microscopic image; adjust the number of acquired frames per second according to the frame number adjustment factor to obtain the adjusted number of acquired frames per second.
[0066] Step S3 includes steps S30 and S31, which are specifically as follows:
[0067] S30: Obtain a frame number adjustment factor according to the clarity of each frame of the coal microscopic image.
[0068] It should be noted that if the clarity of the coal microscopic image gradually becomes clearer, the acquisition frequency needs to be increased in order to obtain more clearer images. If the clarity of the coal microscopic image gradually becomes less clear, the image acquisition frequency needs to be reduced to avoid lower-definition images occupying storage space. Therefore, the frame adjustment factor is obtained based on the difference in clarity between each frame of the coal microscopic image and the previous frame of the coal microscopic image.
[0069] In an embodiment of the present invention, the frame number adjustment factor is obtained:
[0070] ;
[0071] In the formula, Represents the frame rate adjustment factor; represents the frame number of the coal microscopic image; Represents the clarity of the k-th frame of the coal microscopic image; Represents the clarity of the k-1th frame of the coal microscopic image; represents a preset hyperparameter, and its value range is between 0 and 1. In the embodiment of the present invention, the preset In other embodiments, the implementer may preset The value of Represents the difference in clarity between the jth frame of coal microscopic image and its previous frame of coal microscopic image. The larger its value is, the clearer the image becomes. Represents the weight of the difference in clarity between the j-th frame of coal microscopic image and its previous frame of coal microscopic image. The larger the number of image frames, the closer the j-th frame of coal microscopic image is to the current moment, that is, the higher the reference degree of the frame image, the greater the weight; The purpose is to The value of is mapped to the range of (0.5,1.5).
[0072] S31: adjusting the number of acquired frames per second according to the frame number adjustment factor, and obtaining the adjusted number of acquired frames per second.
[0073] In an embodiment of the present invention, the adjusted number of captured frames per second is obtained:
[0074] ;
[0075] In the formula, Represents the adjusted number of captured frames per second; Represents the number of frames collected per second; Represents the frame rate adjustment factor; Represents the floor symbol.
[0076] The coal microscopic image of the next second is collected according to the adjusted collection frame number per second. It should be noted that the image collection frame number is adjusted once every second.
[0077] An embodiment of the present invention also discloses a system for automatically and continuously acquiring microscopic images of coal samples, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a method for automatically and continuously acquiring microscopic images of coal samples according to the present invention is implemented.
[0078] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0079] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.
[0080] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0081] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for automatically and continuously collecting microscopic images of coal samples, characterized in that: Includes steps: Collecting coal microscopic images and performing edge detection on them to obtain edge images; Obtaining the edge strength of each edge of each frame of edge image, including: obtaining the gradient amplitude of each edge point in each frame of edge image; ; In the formula, Represents the edge strength of each edge of each frame of edge image; Represents the gradient amplitude of the vth edge point on the jth edge in the i-th frame edge image; Represents the number of edge points on the jth edge in the edge image of the i-th frame; norm() represents the normalization function; Obtaining the degree of outlier of each edge in each frame of edge image, including: obtaining the center coordinates of each edge in each frame of edge image; ; In the formula, Represents the degree of outlier of the jth edge in the i-th frame edge image; Represents the number of edges in the edge image of the i-th frame; Represents the Euclidean distance between the center coordinates of the jth edge in the i-th frame edge image and the c-th edge other than it; Represents the mean Euclidean distance between the center coordinates of the jth edge and all other edges in the i-th frame edge image; The ratio of the mean value of the edge strength of all edges in each frame of edge image to the standard deviation of the outlier degree of all edges is taken as the clarity of each frame of coal microscopic image; Get the frame rate adjustment factor ; represents the frame number of the coal microscopic image; Represents the clarity of the k-th frame of the coal microscopic image; Represents the clarity of the k-1th frame of the coal microscopic image; Represents the preset hyperparameter; tanh() represents the hyperbolic tangent function; adjust the number of acquired frames per second to obtain the adjusted number of acquired frames per second, including: ; In the formula, Represents the adjusted number of captured frames per second; Represents the number of frames collected per second; Represents the frame rate adjustment factor; Represents the floor symbol.
2. The method for automatically and continuously collecting microscopic images of coal samples according to claim 1, characterized in that: The process of acquiring the edge image includes: The Canny operator is used to perform edge detection on each frame of coal microscopic image to obtain the edge image of each frame.
3. The method for automatically and continuously collecting microscopic images of coal samples according to claim 2, characterized in that: The step of obtaining the gradient magnitude of each edge point in each frame of edge image comprises: ; In the formula, Represents the gradient amplitude of the mth edge point in the i-th frame edge image; Represents the grayscale difference between two pixels adjacent to the mth edge point in the i-th frame edge image; Represents the grayscale difference between the two pixels adjacent to each other in the vertical direction of the mth edge point in the i-th edge image.
4. The method for automatically and continuously collecting microscopic images of coal samples according to claim 1, characterized in that: The step of obtaining the center coordinates of each edge in each frame of edge image includes: For any edge in the edge image of the i-th frame, the mean value of the coordinates of all edge points in the edge is taken as the center coordinate of the edge.
5. A system for automatically and continuously collecting microscopic images of coal samples, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for automatically and continuously collecting microscopic images of coal samples according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Defocus blurred image definition detecting method based on edge strength weight
CN104637064A
Impact arc image edge detection method and device
CN111398748A