An image quantification method, system, device and medium
Patent Information
- Application Number
- CN202610870728.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-10-30
AI Technical Summary
[0013]与现有技术相比,本发明的有益效果:在普通实验室内就能实现对硅橡胶表面黑曲霉污染程度的直接、快速及定量表征。进一步的,还可以为不同试验条件下污染程度的对比分析以及污染对材料电气性能影响的研究提供可靠的定量依据。
Smart Images

Figure CN123015704A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image quantitative calculation technology, and in particular to an image quantitative calculation method, system, device and medium. Background Technology
[0002] Currently, the evaluation of the degree of Aspergillus niger contamination on silicone rubber surfaces mainly relies on washing the microorganisms off the material surface and counting the viable bacteria under a microscope, or on establishing a function model between grayscale components and density based on algae detection methods for indirect estimation. However, these methods generally involve complex experimental procedures and are highly dependent on specific experimental conditions, making it difficult to rapidly and quantitatively characterize the Aspergillus niger adhesion under ordinary laboratory conditions. Summary of the Invention
[0003] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides an image quantitative calculation method, comprising acquiring a digital image of the surface of a silicone rubber sample to be tested, and representing the digital image as a two-dimensional matrix composed of pixels; The image corresponding to the two-dimensional matrix is converted to a color space that can separate brightness and color information, and at least one color component related to the color features of Aspergillus niger is extracted. According to the preset discrimination criteria, the pixels that meet the discrimination criteria are identified as areas contaminated by Aspergillus niger and marked as the first value, while the remaining pixels are marked as the second value, thus generating a binary image. The number of pixels with the first value in the binary image is counted as the number of pixels in the contaminated area, and the total number of pixels in the binary image is also counted. Based on the number of pixels in the contaminated area and the total number of pixels, the coverage rate of Aspergillus niger on the silicone rubber surface is calculated and output.
[0004] As a preferred embodiment of the image quantitative calculation method of the present invention, wherein: at least one color component related to the color characteristics of Aspergillus niger is extracted, including: Convert the image corresponding to the two-dimensional matrix from the RGB color space to the LAB color space; The luminance component L and color component A are extracted from the converted LAB color space as color components associated with the color characteristics of Aspergillus niger.
[0005] As a preferred embodiment of the image quantitative calculation method of the present invention, the preset discrimination criterion is set based on the numerical difference in color components between the Aspergillus niger contaminated area and the uncontaminated area. Generate a binary image, including: Iterate through each pixel in the image corresponding to the two-dimensional matrix that has been converted to the color space. If the current pixel meets the discrimination criterion, then the current pixel is determined to be a black mold contamination area and assigned the first value. If the current pixel does not meet the discrimination criterion, then the current pixel is determined to be a non-contaminated area and assigned the second value; After all pixels are assigned values, a binary image corresponding to the digital image is generated.
[0006] As a preferred embodiment of the image quantitative calculation method of the present invention, acquiring a digital image of the surface of the silicone rubber sample to be tested includes: The resolution of the acquired digital image is no less than 2000×2000 pixels, and the actual spatial size corresponding to a single pixel in the digital image is smaller than the minimum feature size of the Aspergillus niger colony.
[0007] As a preferred embodiment of the image quantitative calculation method of the present invention, the preset discrimination criterion is that the luminance component L of the pixel in the LAB color space is less than 156 and the color component A is less than 156.
[0008] In a preferred embodiment of the image quantitative calculation method of the present invention, the first value is 255 and the second value is 0.
[0009] In a preferred embodiment of the image quantitative calculation method of the present invention, the actual spatial size corresponding to a single pixel is less than 0.5 mm.
[0010] In a second aspect, the present invention provides an image quantitative calculation system, comprising: an acquisition module for acquiring a digital image of the surface of a silicone rubber sample to be tested, and representing the digital image as a two-dimensional matrix composed of pixels; The extraction module is used to convert the image corresponding to the two-dimensional matrix into a color space that can separate brightness information and color information, and extract at least one color component related to the color characteristics of Aspergillus niger; The labeling module is used to identify pixels that meet the discrimination criteria as areas contaminated by Aspergillus niger and label them with a first value, and label the remaining pixels with a second value, thereby generating a binary image. The statistics module is used to count the number of pixels with a first value in the binary image as the number of pixels in the contaminated area, and to count the total number of pixels in the binary image. The calculation module is used to calculate and output the coverage of Aspergillus niger on the silicone rubber surface based on the number of pixels in the contaminated area and the total number of pixels.
[0011] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0012] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described above.
[0013] Compared with existing technologies, the advantages of this invention are: it enables direct, rapid, and quantitative characterization of the degree of Aspergillus niger contamination on silicone rubber surfaces in a typical laboratory setting. Furthermore, it provides reliable quantitative evidence for comparative analysis of contamination levels under different experimental conditions and for studying the impact of contamination on the electrical properties of materials. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart illustrating an image quantitative calculation method provided in one embodiment.
[0016] Figure 2 The original image of Aspergillus niger contamination on a silicone rubber surface.
[0017] Figure 3 This is a binary image of a corresponding contaminated area.
[0018] Figure 4 This is a schematic diagram of a coverage calculation result. Detailed Implementation
[0019] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0020] Example 1, referring to Figures 1-4 This is the first embodiment of the present invention, which provides a method for improving short-term high-frequency energy storage efficiency, comprising: To address the problems of existing methods for evaluating the degree of Aspergillus niger contamination on silicone rubber surfaces being cumbersome, time-consuming, prone to large errors, and dependent on complex models, this application provides a method that can effectively solve the aforementioned problems. The following embodiment will elaborate on how to implement this image quantitative calculation method. Figure 1A flowchart of an image quantitative calculation method is shown, including: S100: Acquire a digital image of the surface of the silicone rubber sample to be tested, and represent the digital image as a two-dimensional matrix composed of pixels.
[0021] In one alternative implementation, a digital image of the surface of the silicone rubber sample to be tested can be acquired using a mobile phone or an industrial camera. Specifically, the device is fixed directly above the silicone rubber sample, with the lens optical axis perpendicular to the sample surface. Under stable illumination provided by an LED white light source, the distance between the device and the sample is adjusted to 20–50 cm before the image is captured.
[0022] In another alternative implementation, the digital image of the surface of the silicone rubber sample to be tested can also be acquired by a flatbed scanner. The silicone rubber sample is placed flat on the glass panel of the flatbed scanner, the optical resolution is set to 1200 dpi or higher, the automatic color correction and sharpening functions in the scanning software are turned off, and the sample surface is scanned line by line in reflective format. The diffuse reflected light intensity of the sample surface is received by the linear CCD sensor built into the scanner and converted into an electrical signal to generate a high-resolution digital image.
[0023] In one specific implementation, the resolution of the acquired digital image should be no less than 2000×2000 pixels, and the actual spatial size corresponding to a single pixel in the digital image should be smaller than the minimum feature size of the Aspergillus niger colony.
[0024] Preferably, the actual spatial size corresponding to a single pixel is less than 0.5mm.
[0025] In one alternative implementation, representing a digital image as a two-dimensional matrix of pixels can be achieved by storing it using row and column indexes. This involves allocating a two-dimensional array in memory corresponding to the image size based on the image's height and width parameters. The grayscale / color value of the first pixel at the top left corner of the image is stored in the first row and first column of the array. Then, each pixel value is sequentially filled into the corresponding row and column positions in the array from left to right and from top to bottom, forming a two-dimensional matrix with row and column numbers as coordinates and pixel values as elements.
[0026] It is understandable that each pixel corresponds to a spatial location on the sample surface.
[0027] S200: Convert the image corresponding to the two-dimensional matrix to a color space that can separate brightness and color information, and extract at least one color component related to the color characteristics of Aspergillus niger.
[0028] In one specific implementation, step S200 further includes the following: A1: Convert the image corresponding to the two-dimensional matrix from the RGB color space to the LAB color space.
[0029] It should be noted that, compared to the strong coupling between channels in the RGB color space, the LAB color space can effectively reduce the impact of lighting changes on color components; at the same time, compared to the HSV color space's sensitivity to hue changes, the LAB color space has better stability when dealing with dark contaminants.
[0030] In one alternative implementation, the image corresponding to the two-dimensional matrix can be converted from the RGB color space to the LAB color space using a pixel-by-pixel mathematical conversion method. Specifically, the RGB values are first non-linearly normalized, then converted to the XYZ color space using a fixed linear transformation matrix. Next, the L, A, and B components are calculated according to the XYZ to LAB conversion formula. Finally, the RGB value of each pixel is replaced with the corresponding L, A, and B values to complete the conversion of the entire image.
[0031] Preferably, this method uses the LAB color space, which can separate luminance information from color information.
[0032] A2: Extract the luminance component L and color component A from the converted LAB color space as the color components related to the color characteristics of Aspergillus niger.
[0033] It should be noted that component L is used to reflect brightness information; while color component A is used to reflect the reddish or greenish characteristics of a color.
[0034] In one alternative implementation, the values of each pixel in the L and A channels are read sequentially by indexing, and the data in the B channel is discarded. The read L and A values are stored in two new two-dimensional matrices respectively, so that each matrix element records the brightness and red-green color bias of the corresponding pixel.
[0035] S300: According to the preset discrimination criteria, the pixels that meet the discrimination criteria are identified as areas contaminated by Aspergillus niger and marked as the first value, while the remaining pixels are marked as the second value, thus generating a binary image.
[0036] In one specific implementation, the preset discrimination criterion is set based on the numerical difference in color components between the Aspergillus niger contaminated area and the uncontaminated area.
[0037] Preferably, the preset discrimination criterion is that the luminance component L of the pixel in the LAB color space is less than 156, and the color component A is less than 156.
[0038] Preferably, the aforementioned preset discrimination criteria can directly perform pixel-level discrimination based on the inherent numerical differences between Aspergillus niger contaminated and uncontaminated areas in the LAB color space, which can greatly simplify the detection process and shorten the experimental cycle.
[0039] Furthermore, in this embodiment, step S300 also includes the following: B1: Iterate through each pixel in the image corresponding to the two-dimensional matrix that has been converted to the color space. If the current pixel meets the discrimination criterion, then the current pixel is determined to be a black mold contamination area and assigned the first value.
[0040] B2: If the current pixel does not meet the discrimination criterion, then the current pixel is determined to be a non-contaminated area and assigned the second value.
[0041] B3: After all pixels are assigned values, a binary image corresponding to the digital image is generated.
[0042] In one alternative implementation, the first value is 255 and the second value is 0.
[0043] S400: Count the number of pixels with the first value in the binary image as the number of pixels in the contaminated area, and count the total number of pixels in the binary image.
[0044] In one specific implementation, step S400 includes the following: C1: Iterate through each pixel in the binary image.
[0045] Specifically, starting from the first pixel in the top left corner of the binary image, each pixel is visited sequentially from left to right along the same row. After reaching the end of the row, the process jumps to the leftmost end of the next row and continues until the last pixel in the bottom right corner. The value of each pixel is read by visiting it.
[0046] C2: The number of pixels whose pixel value is equal to the first value is used as the number of pixels in the polluted area.
[0047] C3: Count the total number of pixels in the binary image, and use it as the total number of pixels.
[0048] S500: Calculates and outputs the coverage rate of Aspergillus niger on the silicone rubber surface based on the number of pixels in the contaminated area and the total number of pixels.
[0049] In one specific implementation, the coverage rate is obtained by calculating the ratio of the number of pixels in the polluted area to the total number of pixels, multiplying the ratio by 100%, and outputting the coverage rate as a percentage.
[0050] Specifically, the number of pixels with a value of 255 is taken as the number of pixels in the Aspergillus niger contaminated area, resulting in the number of contaminated area pixels N_mold and the total number of pixels N_total. The specific calculation formula is as follows: ; In the formula: This indicates the coverage rate of Aspergillus niger.
[0051] In a specific instance Figure 2 To obtain the original image of the surface of the silicone rubber sample, Figure 3 This is the corresponding binary image of the contaminated area. Figure 4 Here is an example graph showing the results of its coverage calculation.
[0052] Understandably, a higher coverage rate indicates a higher degree of Aspergillus niger contamination, while a lower coverage rate indicates a lower degree of Aspergillus niger contamination.
[0053] In summary, the beneficial effects of the image-based quantitative calculation method of this invention are: it enables direct, rapid, and quantitative characterization of the degree of Aspergillus niger contamination on silicone rubber surfaces in a typical laboratory setting. Furthermore, it provides reliable quantitative evidence for comparative analysis of contamination levels under different experimental conditions and for studying the impact of contamination on the electrical properties of materials.
[0054] Example 2, this example also provides an image quantitative calculation system, including: The acquisition module is used to acquire digital images of the surface of the silicone rubber sample to be tested and represent the digital images as a two-dimensional matrix composed of pixels; The extraction module is used to convert the image corresponding to the two-dimensional matrix into a color space that can separate brightness information and color information, and extract at least one color component related to the color characteristics of Aspergillus niger; The labeling module is used to identify pixels that meet the discrimination criteria as areas contaminated by Aspergillus niger and label them with a first value, and label the remaining pixels with a second value, thereby generating a binary image. The statistics module is used to count the number of pixels with a first value in the binary image as the number of pixels in the contaminated area, and to count the total number of pixels in the binary image. The calculation module is used to calculate and output the coverage of Aspergillus niger on the silicone rubber surface based on the number of pixels in the contaminated area and the total number of pixels.
[0055] This embodiment also provides an electronic device suitable for quantitative image calculation, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the quantitative image calculation method proposed in the above embodiment.
[0056] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the image quantitative calculation method proposed in the above embodiments.
[0057] The storage medium proposed in this embodiment and the image quantitative calculation method proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0058] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0059] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for quantitative calculation of images, characterized in that: include: A digital image of the surface of the silicone rubber sample to be tested is acquired, and the digital image is represented as a two-dimensional matrix composed of pixels; The image corresponding to the two-dimensional matrix is converted to a color space that can separate brightness and color information, and at least one color component related to the color characteristics of Aspergillus niger is extracted. According to the preset discrimination criteria, pixels that meet the discrimination criteria are identified as areas contaminated by Aspergillus niger and marked as a first value, while the remaining pixels are marked as a second value, thus generating a binary image. The number of pixels with a first value in the binary image is counted as the number of pixels in the contaminated area, and the total number of pixels in the binary image is also counted. Based on the number of pixels in the contaminated area and the total number of pixels, the coverage rate of Aspergillus niger on the silicone rubber surface is calculated and output.
2. The image quantitative calculation method as described in claim 1, characterized in that: The extraction of at least one color component related to the color characteristics of Aspergillus niger includes: The image corresponding to the two-dimensional matrix is converted from the RGB color space to the LAB color space; The luminance component L and color component A are extracted from the converted LAB color space as the color components associated with the color characteristics of Aspergillus niger.
3. The image quantitative calculation method as described in claim 2, characterized in that: The preset discrimination criterion is set based on the numerical difference in the color components between the Aspergillus niger contaminated area and the uncontaminated area. The generation of the binary image includes: Iterate through each pixel in the image corresponding to the two-dimensional matrix that has been converted to the color space. If the current pixel satisfies the discrimination criterion, then the current pixel is determined to be a black mold contamination area and assigned a first value. If the current pixel does not meet the discrimination criteria, then the current pixel is determined to be a non-contaminated area and assigned a second value; After all pixels are assigned values, a binary image corresponding to the digital image is generated.
4. The image quantitative calculation method as described in claim 3, characterized in that: The process of acquiring a digital image of the surface of the silicone rubber sample to be tested includes: The resolution of the acquired digital image is not less than 2000×2000 pixels, and the actual spatial size corresponding to a single pixel in the digital image is less than the minimum feature size of the Aspergillus niger colony.
5. The image quantitative calculation method as described in any one of claims 2 or 3, characterized in that: The preset discrimination criterion is that the luminance component L of the pixel in the LAB color space is less than 156, and the color component A is less than 156.
6. The image quantitative calculation method as described in claim 3, characterized in that: The first value is 255, and the second value is 0.
7. The image quantitative calculation method as described in claim 4, characterized in that: The actual spatial size corresponding to a single pixel is less than 0.5 mm.
8. An image quantitative calculation system, employing the method as described in any one of claims 1-7, characterized in that, include: The acquisition module is used to acquire a digital image of the surface of the silicone rubber sample to be tested, and to represent the digital image as a two-dimensional matrix composed of pixels; The extraction module is used to convert the image corresponding to the two-dimensional matrix into a color space that can separate brightness information and color information, and extract at least one color component related to the color characteristics of Aspergillus niger; The marking module is used to determine the pixels that meet the preset discrimination criteria as areas contaminated by Aspergillus niger and mark them as a first value, and mark the remaining pixels as a second value, thereby generating a binary image. The statistics module is used to count the number of pixels with a first value in the binary image as the number of pixels in the contaminated area, and to count the total number of pixels in the binary image. The calculation module is used to calculate and output the coverage rate of Aspergillus niger on the silicone rubber surface based on the number of pixels in the contaminated area and the total number of pixels.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
