Energy-saving material density detection method and system
By calculating the real-time density of the material to be detected and combining with the material classification model, we judge and mark materials that do not meet the standards, and trace the source through segmentation and watermarking technology of the detection process video, it is solved that it is difficult to judge and trace the source in the existing technology. The problem of energy-saving materials has achieved efficient and accurate detection and traceability.
Patent Information
- Application Number
- CN202410754683.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-06-12
AI Technical Summary
It is difficult for the prior art to effectively judge and trace energy-saving materials that do not meet the standards, especially during the material density detection process.
By obtaining the basic data of the material to be detected, the real-time density is calculated, and the real-time image set is input into the pre-constructed material classification model, the material category and standard density interval are obtained, and whether the density meets the standards is determined. If it does not match, mark and generate a video of the detection process, and further processed through video segmentation and watermarking technology.
It is realized that the material that does not meet the standards is determined by the material density, and the traceability can be efficiently carried out after confirming that it does not meet the standards, improving the accuracy and efficiency of the detection.
Smart Images

Figure CN118781052B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material detection, and more specifically, to a method and system for detecting density of energy-saving materials. Background Art
[0002] The building exterior wall is one of the most important parts in construction, which often requires many materials and is therefore a key link in energy consumption. The introduction of energy-saving materials can invisibly improve the protection of the external environment, reduce energy loss, and also reduce carbon emissions to a large extent. The density of energy-saving materials is one of the important indicators. Through the density of energy-saving materials, it can be judged to a certain extent whether the energy-saving materials meet the standards. In the existing technology, the mass and volume of energy-saving materials are usually tested to calculate the density;
[0003] For example, the patent with publication number CN101339115A provides a method and system for detecting the density of a mixture. The patent divides the total mass of various materials by the volume of the mixture, and the quotient obtained is used as the density of the mixture. The patent with publication number CN104977226A provides a method and device for measuring the density of a rock. The patent obtains the height, diameter and mass of a sample to calculate the density. Although the above method can obtain the density of the material, there are still certain problems.
[0004] Although the above patent obtains the density of the material by calculation, there may be materials that do not meet the standards during the material testing process. In the prior art, it is rare to be able to determine whether the material does not meet the standards based on the density, and it is also impossible to efficiently trace the materials that do not meet the standards.
[0005] In view of this, the present invention proposes an energy-saving material density detection method and system to solve the above problems. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art, the present invention provides an energy-saving material density detection method and system.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for detecting density of energy-saving materials, comprising:
[0009] S10: Obtain basic data of the material to be tested, and calculate the real-time density of the material to be tested according to the basic data;
[0010] The basic data includes material length, material width, material thickness and material weight;
[0011] Methods for obtaining material length, material width, and material thickness include:
[0012] Obtain M characteristic edges of the material to be detected, determine the corresponding measured straight line equation based on the M characteristic edges, obtain the corresponding theoretical straight line equation based on the M characteristic edges, determine the rotation amount based on the measured straight line equation and the theoretical straight line equation, determine the translation amount based on the first center coordinate of the measured straight line equation and the second center coordinate of the theoretical straight line equation, adjust the position of the material to be detected according to the rotation amount and the translation amount, and obtain the material length, material width and material thickness of the material to be detected after the adjustment, where M is an integer greater than 1;
[0013] S20: obtaining a real-time image set of the material to be detected, inputting the real-time image set into a pre-built material classification model to obtain the material category, obtaining a standard density range based on the material category and the mapping relationship, and determining whether the real-time density is within the standard density range;
[0014] S30: When the real-time density is not within the standard density range, marking the material to be inspected according to the real-time image set, and generating a corresponding initial inspection process video;
[0015] S40: Segmenting the initial detection process video based on the real-time image set to generate an intermediate detection process video, and processing the intermediate detection process video according to the real-time density to generate a target detection process video.
[0016] Furthermore, the method for constructing the material classification model includes:
[0017] Obtain i groups of data, where i is a positive integer greater than 1, and the data include historical image sets and historical material categories. Take the historical image sets and historical material categories as sample sets, divide the sample sets into training sets and test sets, build a classifier, take the historical image sets in the training set as input data, take the historical material categories in the training set as output data, train the classifier to obtain an initial classifier, test the initial classifier using the test set, and output a classifier that meets the preset accuracy as a material classification model.
[0018] Furthermore, the method for marking the material to be detected according to the real-time image set includes:
[0019] A target real-time image is selected based on the real-time image set, and a target area corresponding to the target real-time image is sprayed, so as to mark the material to be detected, wherein the target area is an area generated by segmenting the material to be detected.
[0020] Furthermore, the method for selecting a target real-time image based on the real-time image set includes:
[0021] The real-time image set is traversed to generate grayscale values corresponding to each real-time image, the generated grayscale values are arranged in descending order, the grayscale value at the top is marked, and the real-time image corresponding to the marked grayscale value is determined as the target real-time image.
[0022] Furthermore, the method of segmenting the initial detection process video to generate the intermediate detection process video based on the real-time image set includes:
[0023] The initial frame number of the real-time image set is obtained, the initial frame number is adjusted according to the basic data to generate the target frame number, and the initial detection process video is segmented based on the target frame number to generate the intermediate detection process video.
[0024] Furthermore, the method for adjusting the initial frame number according to the basic data includes:
[0025] The first non-zero digits of the material length, material width and material thickness in the basic data are summed up respectively to obtain the target adjustment value, and the target adjustment value and the initial frame number are summed up to obtain the target frame number.
[0026] Furthermore, the method of processing the intermediate detection process video according to the real-time density to generate the target detection process video includes:
[0027] The first W non-zero digits corresponding to the real-time density are obtained, and the corresponding segmented videos in the intermediate detection process video are watermarked according to the first W non-zero digits, so as to obtain the target detection process video, wherein the first W non-zero digits are all less than the target frame number, and W is an integer greater than 0.
[0028] Furthermore, the method of watermarking the corresponding segmented video in the intermediate detection process video according to the first three non-zero digits includes:
[0029] Take the intermediate frames of the corresponding segmented videos respectively, inject the target execution code into the startup process, and obtain the target view display function, and watermark the intermediate frames based on the target view display function. The target execution code is used to call the target dynamic link library opening instruction, and the target dynamic link library is a dynamic link library that encapsulates the target view display function.
[0030] A system for detecting density of energy-saving materials, which is used to implement the above-mentioned method for detecting density of energy-saving materials, comprises:
[0031] Data acquisition module: used to obtain the basic data of the material to be tested and calculate the real-time density of the material to be tested based on the basic data;
[0032] Detection module: used to obtain a real-time image set of the material to be detected, input the real-time image set into a pre-built material classification model, obtain the material category, obtain the standard density range based on the material category and the mapping relationship, and determine whether the real-time density is within the standard density range;
[0033] Marking module: used to mark the material to be tested according to the real-time image set when the real-time density is not within the standard density range, and to generate the corresponding initial testing process video;
[0034] Encryption module: used to segment the initial detection process video based on the real-time image set to generate an intermediate detection process video, and process the intermediate detection process video according to the real-time density to generate a target detection process video.
[0035] A computer-readable storage medium stores a computer program, and when the computer program is executed, the energy-saving material density detection method described above is implemented.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention obtains basic data of the material to be detected and calculates the real-time density, then inputs the real-time image set into a pre-built material classification model to obtain the material category, determines the standard density interval according to the category and the mapping relationship, and judges whether the real-time density is in the standard density interval. If not, the material is marked to generate an initial detection process video, and the initial video is segmented based on the real-time image to generate an intermediate detection process video. The intermediate video is processed according to the real-time density to generate a target detection process video. The density of the material is obtained by calculation, and it can be judged whether there is a material that does not meet the standards according to the density of the material. After the material that does not meet the standards is determined, the material that does not meet the standards can be efficiently traced. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of a method for detecting density of energy-saving materials in the present invention;
[0039] Figure 2 A schematic diagram of a computer-readable storage medium in the present invention. DETAILED DESCRIPTION
[0040] 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 only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Example 1
[0042] See also Figure 1 As shown, this embodiment discloses a method for detecting density of energy-saving materials, including:
[0043] S10: Obtain basic data of the material to be tested, and calculate the real-time density of the material to be tested according to the basic data;
[0044] It should be noted that the basic data at least includes material length, material width, material thickness and material weight, and the material weight can be directly obtained by a weight sensor;
[0045] Methods for obtaining material length, material width, and material thickness include:
[0046] Obtain M characteristic edges of the material to be detected, determine the corresponding measured straight line equation based on the M characteristic edges, obtain the corresponding theoretical straight line equation based on the M characteristic edges, determine the rotation amount based on the measured straight line equation and the theoretical straight line equation, determine the translation amount based on the first center coordinate of the measured straight line equation and the second center coordinate of the theoretical straight line equation, adjust the position of the material to be detected according to the rotation amount and the translation amount, and obtain the material length, material width and material thickness of the material to be detected after the adjustment, where M is an integer greater than 1;
[0047] It can be understood that, since the position of the material to be detected is random during the actual detection process, and the position of the sensor is relatively fixed, it is necessary to adjust the position of the material to be detected. The characteristic edge can be the side of the material to be detected. Taking the energy-saving material to be detected as a square as an example, the length and width of the energy-saving material are both characteristic edges. The measured straight line equation is generated by establishing a coordinate system based on the detection platform. The theoretical straight line equation refers to the equation of the corresponding characteristic edge when the material to be detected is in an ideal position. The theoretical straight line equation is usually determined in advance.
[0048] The method for determining the amount of rotation mentioned above may be to obtain a surface image of the material to be detected, compare the surface image with a preset image, and determine the amount of rotation of the surface image when the surface image is rotated to the same direction as the preset image. The method for determining the amount of translation mentioned above may be to determine the amount of translation by calculating the distance between the first center coordinate and the second center coordinate. The material length, material width and material thickness mentioned above may be directly obtained by a photoelectric sensor.
[0049] Methods for calculating the real-time density of the material to be tested based on basic data include:
[0050]
[0051] In the formula, Rdy is the real-time density, MG is the material mass, ML is the material length, MW is the material width, and MT is the material thickness;
[0052] It is worth noting that the above method for calculating real-time density is only an exemplary description. This embodiment is described with the material to be detected being a square energy-saving material. For example, when the material to be detected is a circular energy-saving material, the corresponding volume calculation formula of the circle is substituted. It can be understood that when the material to be detected is an irregular object, it is necessary to generate a corresponding three-dimensional model by 3D scanning, and then calculate the volume of the three-dimensional model to obtain the volume of the material to be detected, and obtain the density of the corresponding material to be detected by the formula for calculating the density;
[0053] S20: obtaining a real-time image set of the material to be detected, inputting the real-time image set into a pre-built material classification model to obtain the material category, obtaining a standard density range based on the material category and the mapping relationship, and determining whether the real-time density is within the standard density range;
[0054] In this embodiment, obtaining the real-time image set may be to segment the material to be detected, and obtain the real-time image corresponding to each segment, so as to generate the real-time image set. The material categories include but are not limited to thermal insulation materials, heat insulation materials, solar energy materials and renewable building materials. It can be understood that the above material categories are exemplified by the categories of energy-saving materials in the construction field. Solar energy materials may be solar panels, and renewable building materials may be grass fiber boards. The standard density interval corresponding to each material is different. In this embodiment, a mapping relationship between material categories and standard density intervals is pre-established;
[0055] The construction method of the material classification model includes:
[0056] Obtain i groups of data, where i is a positive integer greater than 1, and the data includes a historical image set and a historical material category. The historical image set and the historical material category are used as a sample set, and the sample set is divided into a training set and a test set. A classifier is constructed, and the historical image set in the training set is used as input data, and the historical material category in the training set is used as output data. The classifier is trained to obtain an initial classifier, and the initial classifier is tested using the test set, and a classifier that meets a preset accuracy is output as a material classification model, and the classifier is preferably a naive Bayes model or a support vector machine model;
[0057] S30: When the real-time density is not within the standard density range, marking the material to be inspected according to the real-time image set, and generating a corresponding initial inspection process video;
[0058] It is understandable that when the real-time density is not within the standard density range, it indicates that the material to be tested does not meet the standard, so the test material needs to be marked. There are many marking methods. This embodiment provides a marking method through the following content;
[0059] Methods for marking materials to be inspected based on real-time image sets include:
[0060] Selecting a target real-time image based on the real-time image set, and spraying a target area corresponding to the target real-time image, so as to mark the material to be detected, wherein the target area is an area generated by segmenting the material to be detected;
[0061] In accordance with the above, obtaining the real-time image set may be to segment the material to be detected, and obtain the real-time images corresponding to each segment, so as to generate the real-time image set. Then, each segment of the material to be detected is an area, and has a one-to-one correspondence with the corresponding real-time image. In this embodiment, the most representative target real-time image is selected from the real-time image set, and the target area corresponding to the target real-time image is sprayed, so as to realize marking of the material to be detected. The target real-time image may be an image representing a defect, or an image representing the characteristics of the material to be detected.
[0062] It should be noted that when the material to be detected is a regular material, it can be divided equally according to the length or width of the material to be detected. When the material to be detected is an irregular material, a contour detection algorithm (such as findContours in OpenCV) can be used to identify and extract the contour of the material to be detected, and the material to be detected can be segmented according to the contour information;
[0063] The method for selecting a target real-time image based on the real-time image set includes:
[0064] Traversing the real-time image set to generate grayscale values corresponding to each real-time image, arranging the generated grayscale values in descending order, marking the grayscale value at the top, and determining the real-time image corresponding to the marked grayscale value as the target real-time image;
[0065] It should be understood that, in this embodiment, each real-time image in the real-time image set is first converted into a corresponding grayscale image, and then the grayscale value corresponding to the grayscale image is obtained. The grayscale value can be the average grayscale value of the grayscale image. The above method of selecting the target real-time image is just an example. In this embodiment, the image of the characteristics of the material to be detected is used as the target real-time image. The initial detection process video mentioned above refers to the process video of adjusting or detecting the material to be detected. In this embodiment, adjusting the material to be detected refers to adjusting the position of the material to be detected in the above content, so it is captured in real time by the corresponding camera to obtain the process video of adjusting the material to be detected;
[0066] S40: segmenting the initial detection process video based on the real-time image set to generate an intermediate detection process video, and processing the intermediate detection process video according to the real-time density to generate a target detection process video;
[0067] The method for segmenting the initial detection process video based on the real-time image set to generate the intermediate detection process video includes:
[0068] Obtaining the initial frame number of the real-time image set, adjusting the initial frame number according to the basic data to generate the target frame number, and segmenting the initial detection process video based on the target frame number to generate the intermediate detection process video;
[0069] Methods for adjusting the initial frame rate based on basic data include:
[0070] The first non-zero digits of the material length, material width and material thickness in the basic data are summed up respectively to obtain the target adjustment value, and the target adjustment value and the initial frame number are summed up to obtain the target frame number;
[0071] It should be understood that the method for acquiring the real-time image set is to segment the material to be detected and acquire the real-time image corresponding to each segment, so as to generate the real-time image set. In this embodiment, the material to be detected can be segmented in an equal interval manner, then the initial frame number of the real-time image set corresponds to the segment number of the material to be detected, and this embodiment also sums the target adjustment value and the initial frame number to obtain the target frame number. Since the segment number and basic data corresponding to the material to be detected have certain uniqueness, it is possible to establish a connection between the intermediate detection process video and the material to be detected;
[0072] The above method of generating the target frame number is only an exemplary description. The first implementation method is described below in combination with a specific application scenario.
[0073] When the material length, material width and material thickness in the basic data are 16 decimeters, 12 decimeters and 3.5 decimeters respectively, the target adjustment value is 5. If the initial frame number is 8, the target frame number is 13. Therefore, the initial detection process video is divided into 13 segments. The segments can be divided according to equal duration or according to key frames.
[0074] The method for processing the intermediate detection process video according to the real-time density to generate the target detection process video includes:
[0075] Obtain the first W non-zero digits corresponding to the real-time density, and watermark the corresponding segmented video in the intermediate detection process video according to the first W non-zero digits, so as to obtain the target detection process video, wherein the first W non-zero digits are all less than the target frame number, and W is an integer greater than 0;
[0076] It can be understood that, the initial detection process video is segmented by the target frame number to generate the intermediate detection process video, then the intermediate detection process video includes a plurality of segmented videos, and the plurality of segmented videos are sequentially arranged, and the sequence numbers are 1-G;
[0077] For example, when the real-time density of the material to be tested is 3058.45 g / dm 3 When W is 3, the first three non-zero digits are 3, 5, and 8 respectively, and the segmented videos with serial numbers 3, 5, and 8 are watermarked accordingly to form a mark, where G is the serial number of the Gth segmented video;
[0078] The method for watermarking the corresponding segmented video in the intermediate detection process video according to the first three non-zero digits includes:
[0079] Respectively taking the intermediate frames of the corresponding segmented videos, injecting the target execution code into the startup process, and obtaining the target view display function, watermarking the intermediate frames based on the target view display function, wherein the target execution code is used to call the target dynamic link library opening instruction, and the target dynamic link library is a dynamic link library that encapsulates the target view display function;
[0080] The dynamic link library mentioned above can be a Python library and a PIL library, and the target view display function refers to the code for generating a watermark. It should be noted that although the connection between the intermediate detection process video and the material to be detected is established in the above, the connection between the intermediate detection process video and the material to be detected is not a strong association, and the material to be detected cannot be quickly found through the intermediate detection process video, that is, it is impossible to quickly trace the source, so the intermediate detection process video is further processed to obtain the target detection process video, so that the target detection process video is strongly associated with the material to be detected, so when the manager finds an error prompt, the corresponding material to be detected can be quickly found through the target detection process video, and the material to be detected that does not meet the standards can be quickly processed;
[0081] In this embodiment, basic data of the material to be detected is obtained, the real-time density of the material to be detected is calculated based on the basic data, and then a real-time image set of the material to be detected is obtained, and the real-time image set is input into a pre-built material classification model to obtain the material category, and the standard density interval is obtained based on the material category and the mapping relationship, and it is determined whether the real-time density is in the standard density interval. When the real-time density is not in the standard density interval, the material to be detected is marked according to the real-time image set, and a corresponding initial detection process video is generated. The initial detection process video is segmented based on the real-time image set to generate an intermediate detection process video, and the intermediate detection process video is processed according to the real-time density to generate a target detection process video. The density of the material is obtained by calculation, and it is possible to determine whether there is a material that does not meet the standards based on the density of the material. After determining the material that does not meet the standards, the non-standard material can be efficiently traced.
[0082] Example 2
[0083] This embodiment provides an energy-saving material density detection system based on the first embodiment, including:
[0084] Data acquisition module: used to obtain the basic data of the material to be tested and calculate the real-time density of the material to be tested based on the basic data;
[0085] It should be noted that the basic data at least includes material length, material width, material thickness and material weight, and the material weight can be directly obtained by a weight sensor;
[0086] Methods for obtaining material length, material width, and material thickness include:
[0087] Obtain M characteristic edges of the material to be detected, determine the corresponding measured straight line equation based on the M characteristic edges, obtain the corresponding theoretical straight line equation based on the M characteristic edges, determine the rotation amount based on the measured straight line equation and the theoretical straight line equation, determine the translation amount based on the first center coordinate of the measured straight line equation and the second center coordinate of the theoretical straight line equation, adjust the position of the material to be detected according to the rotation amount and the translation amount, and obtain the material length, material width and material thickness of the material to be detected after the adjustment, where M is an integer greater than 1;
[0088] It can be understood that, since the position of the material to be detected is random during the actual detection process, and the position of the sensor is relatively fixed, it is necessary to adjust the position of the material to be detected. The characteristic edge can be the side of the material to be detected. Taking the energy-saving material to be detected as a square as an example, the length and width of the energy-saving material are both characteristic edges. The measured straight line equation is generated by establishing a coordinate system based on the detection platform. The theoretical straight line equation refers to the equation of the corresponding characteristic edge when the material to be detected is in an ideal position. The theoretical straight line equation is usually determined in advance.
[0089] The method for determining the amount of rotation mentioned above may be to obtain a surface image of the material to be detected, compare the surface image with a preset image, and determine the amount of rotation of the surface image when the surface image is rotated to the same direction as the preset image. The method for determining the amount of translation mentioned above may be to determine the amount of translation by calculating the distance between the first center coordinate and the second center coordinate. The material length, material width and material thickness mentioned above may be directly obtained by a photoelectric sensor.
[0090] Methods for calculating the real-time density of the material to be tested based on basic data include:
[0091]
[0092] In the formula, Rdy is the real-time density, MG is the material mass, ML is the material length, MW is the material width, and MT is the material thickness;
[0093] It is worth noting that the above method for calculating real-time density is only an exemplary description. This embodiment is described with the material to be detected being a square energy-saving material. For example, when the material to be detected is a circular energy-saving material, the corresponding volume calculation formula of the circle is substituted. It can be understood that when the material to be detected is an irregular object, it is necessary to generate a corresponding three-dimensional model by 3D scanning, and then calculate the volume of the three-dimensional model to obtain the volume of the material to be detected, and obtain the density of the corresponding material to be detected by the formula for calculating the density;
[0094] Detection module: used to obtain a real-time image set of the material to be detected, input the real-time image set into a pre-built material classification model, obtain the material category, obtain the standard density range based on the material category and the mapping relationship, and determine whether the real-time density is within the standard density range;
[0095] In this embodiment, obtaining the real-time image set may be to segment the material to be detected, and obtain the real-time image corresponding to each segment, so as to generate the real-time image set. The material categories include but are not limited to thermal insulation materials, heat insulation materials, solar energy materials and renewable building materials. It can be understood that the above material categories are exemplified by the categories of energy-saving materials in the construction field. Solar energy materials may be solar panels, and renewable building materials may be grass fiber boards. The standard density interval corresponding to each material is different. In this embodiment, a mapping relationship between material categories and standard density intervals is pre-established;
[0096] The construction method of the material classification model includes:
[0097] Obtain i groups of data, where i is a positive integer greater than 1, and the data includes a historical image set and a historical material category. The historical image set and the historical material category are used as a sample set, and the sample set is divided into a training set and a test set. A classifier is constructed, and the historical image set in the training set is used as input data, and the historical material category in the training set is used as output data. The classifier is trained to obtain an initial classifier, and the initial classifier is tested using the test set, and a classifier that meets a preset accuracy is output as a material classification model, and the classifier is preferably a naive Bayes model or a support vector machine model;
[0098] Marking module: used to mark the material to be tested according to the real-time image set when the real-time density is not within the standard density range, and to generate the corresponding initial testing process video;
[0099] It is understandable that when the real-time density is not within the standard density range, it indicates that the material to be tested does not meet the standard, so the test material needs to be marked. There are many marking methods. This embodiment provides a marking method through the following content;
[0100] Methods for marking materials to be inspected based on real-time image sets include:
[0101] Selecting a target real-time image based on the real-time image set, and spraying a target area corresponding to the target real-time image, so as to mark the material to be detected, wherein the target area is an area generated by segmenting the material to be detected;
[0102] In accordance with the above, obtaining the real-time image set may be to segment the material to be detected, and obtain the real-time images corresponding to each segment, so as to generate the real-time image set. Then, each segment of the material to be detected is an area, and has a one-to-one correspondence with the corresponding real-time image. In this embodiment, the most representative target real-time image is selected from the real-time image set, and the target area corresponding to the target real-time image is sprayed, so as to realize marking of the material to be detected. The target real-time image may be an image representing a defect, or an image representing the characteristics of the material to be detected.
[0103] The method for selecting a target real-time image based on the real-time image set includes:
[0104] Traversing the real-time image set to generate grayscale values corresponding to each real-time image, arranging the generated grayscale values in descending order, marking the grayscale value at the top, and determining the real-time image corresponding to the marked grayscale value as the target real-time image;
[0105] It should be understood that, in this embodiment, each real-time image in the real-time image set is first converted into a corresponding grayscale image, and then the grayscale value corresponding to the grayscale image is obtained. The grayscale value can be the average grayscale value of the grayscale image. The above method of selecting the target real-time image is just an example. In this embodiment, the image of the characteristics of the material to be detected is used as the target real-time image. The initial detection process video mentioned above refers to the process video of adjusting or detecting the material to be detected. In this embodiment, adjusting the material to be detected refers to adjusting the position of the material to be detected in the above content, so it is captured in real time by the corresponding camera to obtain the process video of adjusting the material to be detected;
[0106] Encryption module: used to segment the initial detection process video based on the real-time image set to generate an intermediate detection process video, and process the intermediate detection process video according to the real-time density to generate a target detection process video;
[0107] The method for segmenting the initial detection process video based on the real-time image set to generate the intermediate detection process video includes:
[0108] Obtaining the initial frame number of the real-time image set, adjusting the initial frame number according to the basic data to generate the target frame number, and segmenting the initial detection process video based on the target frame number to generate the intermediate detection process video;
[0109] Methods for adjusting the initial frame rate based on basic data include:
[0110] The first non-zero digits of the material length, material width and material thickness in the basic data are summed up respectively to obtain the target adjustment value, and the target adjustment value and the initial frame number are summed up to obtain the target frame number;
[0111] It should be understood that the method for acquiring the real-time image set is to segment the material to be detected and acquire the real-time image corresponding to each segment, so as to generate the real-time image set. In this embodiment, the material to be detected can be segmented in an equal interval manner, then the initial frame number of the real-time image set corresponds to the segment number of the material to be detected, and this embodiment also sums the target adjustment value and the initial frame number to obtain the target frame number. Since the segment number and basic data corresponding to the material to be detected have certain uniqueness, it is possible to establish a connection between the intermediate detection process video and the material to be detected;
[0112] The material average value in the above-mentioned method can be rounded to an integer or rounded to zero. The above-mentioned method of generating the target frame number is only an exemplary description. The first implementation method mentioned above is described as follows in combination with a specific application scenario;
[0113] When the material length, material width and material thickness in the basic data are 16 decimeters, 12 decimeters and 3.5 decimeters respectively, the target adjustment value is 5. If the initial frame number is 8, the target frame number is 13. Therefore, the initial detection process video is divided into 13 segments. The segments can be divided according to equal duration or according to key frames.
[0114] The method for processing the intermediate detection process video according to the real-time density to generate the target detection process video includes:
[0115] Obtain the first W non-zero digits corresponding to the real-time density, and watermark the corresponding segmented video in the intermediate detection process video according to the first W non-zero digits, so as to obtain the target detection process video, wherein the first W non-zero digits are all less than the target frame number, and W is an integer greater than 0;
[0116] It can be understood that, the initial detection process video is segmented by the target frame number to generate the intermediate detection process video, then the intermediate detection process video includes a plurality of segmented videos, and the plurality of segmented videos are sequentially arranged, and the sequence numbers are 1-G;
[0117] For example, when the real-time density of the material to be tested is 3058.45 g / dm 3 When W is 3, the first three non-zero digits are 3, 5, and 8, respectively. Then the segmented videos with serial numbers 3, 5, and 8 are watermarked accordingly to form a mark;
[0118] The method for watermarking the corresponding segmented video in the intermediate detection process video according to the first three non-zero digits includes:
[0119] Respectively taking the intermediate frames of the corresponding segmented videos, injecting the target execution code into the startup process, and obtaining the target view display function, watermarking the intermediate frames based on the target view display function, wherein the target execution code is used to call the target dynamic link library opening instruction, and the target dynamic link library is a dynamic link library that encapsulates the target view display function;
[0120] The dynamic link library mentioned above can be a Python library and a PIL library, and the target view display function refers to the code for generating a watermark. It should be noted that although the connection between the intermediate detection process video and the material to be detected is established in the above, the connection between the intermediate detection process video and the material to be detected is not a strong correlation, and the material to be detected cannot be quickly found through the intermediate detection process video, that is, it is impossible to quickly trace the source. Therefore, the intermediate detection process video is further processed to obtain the target detection process video, so that the target detection process video is strongly associated with the material to be detected. Therefore, when the manager finds an error prompt, he can quickly find the corresponding material to be detected through the target detection process video, and can quickly deal with the material to be detected that does not meet the standards.
[0121] Example 3
[0122] This embodiment discloses an electronic device, including a power supply, an interface, a keyboard, a memory, a central processing unit, and a computer program stored in the memory and executable on the central processing unit. When the central processing unit executes the computer program, an energy-saving material density detection method provided by the above methods is implemented. The interface includes a network interface and a data interface. The network interface includes a wired or wireless interface, and the data interface includes an input or output interface.
[0123] Since the electronic device introduced in this embodiment is an electronic device used to implement an energy-saving material density detection method in the embodiment of this application, based on the energy-saving material density detection method introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as the technical personnel of this field implement the electronic device used in the energy-saving material density detection method in the embodiment of this application, it belongs to the scope of protection of this application.
[0124] Example 4
[0125] like Figure 2As shown, this embodiment discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the above-mentioned energy-saving material density detection method is implemented.
[0126] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters, weights and thresholds in the formula are set by technicians in this field according to actual conditions.
[0127] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0128] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0130] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0133] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0134] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting the density of energy-saving materials, characterized in that: include: S10: Obtain basic data of the material to be tested, and calculate the real-time density of the material to be tested according to the basic data; The basic data includes material length, material width, material thickness and material weight; Methods for obtaining material length, material width, and material thickness include: Obtain M characteristic edges of the material to be detected, determine the corresponding measured straight line equation based on the M characteristic edges, obtain the corresponding theoretical straight line equation based on the M characteristic edges, determine the rotation amount based on the measured straight line equation and the theoretical straight line equation, determine the translation amount based on the first center coordinate of the measured straight line equation and the second center coordinate of the theoretical straight line equation, adjust the position of the material to be detected according to the rotation amount and the translation amount, and obtain the material length, material width and material thickness of the material to be detected after the adjustment, where M is an integer greater than 1; S20: obtaining a real-time image set of the material to be detected, inputting the real-time image set into a pre-built material classification model to obtain the material category, obtaining a standard density range based on the material category and the mapping relationship, and determining whether the real-time density is within the standard density range; S30: When the real-time density is not within the standard density range, marking the material to be inspected according to the real-time image set, and generating a corresponding initial inspection process video; S40: segmenting the initial detection process video based on the real-time image set to generate an intermediate detection process video, and processing the intermediate detection process video according to the real-time density to generate a target detection process video; The method for segmenting the initial detection process video based on the real-time image set to generate the intermediate detection process video comprises: Obtaining the initial frame number of the real-time image set, adjusting the initial frame number according to the basic data to generate the target frame number, and segmenting the initial detection process video based on the target frame number to generate the intermediate detection process video; The method for processing the intermediate detection process video according to the real-time density to generate the target detection process video includes: The first W non-zero digits corresponding to the real-time density are obtained, and the corresponding segmented video in the intermediate detection process video is watermarked according to the first W non-zero digits, so as to obtain the target detection process video, wherein the first W non-zero digits are all less than the target frame number, and W is an integer greater than 0.
2. The energy-saving material density detection method according to claim 1, characterized in that: The method for constructing the material classification model includes: Obtain i groups of data, where i is a positive integer greater than 1, and the data include historical image sets and historical material categories. Take the historical image sets and historical material categories as sample sets, divide the sample sets into training sets and test sets, build a classifier, take the historical image sets in the training set as input data, take the historical material categories in the training set as output data, train the classifier to obtain an initial classifier, test the initial classifier using the test set, and output a classifier that meets the preset accuracy as a material classification model.
3. The energy-saving material density detection method according to claim 1, characterized in that: The method for marking the material to be detected according to the real-time image set comprises: A target real-time image is selected based on the real-time image set, and a target area corresponding to the target real-time image is sprayed, so as to mark the material to be detected, wherein the target area is an area generated by segmenting the material to be detected.
4. The energy-saving material density detection method according to claim 3, characterized in that: The method for selecting a target real-time image based on a real-time image set comprises: The real-time image set is traversed to generate grayscale values corresponding to each real-time image, the generated grayscale values are arranged in descending order, the grayscale value at the top is marked, and the real-time image corresponding to the marked grayscale value is determined as the target real-time image.
5. The energy-saving material density detection method according to claim 1, characterized in that: The method for adjusting the initial frame number according to the basic data comprises: The first non-zero digits of the material length, material width and material thickness in the basic data are summed up respectively to obtain the target adjustment value, and the target adjustment value and the initial frame number are summed up to obtain the target frame number.
6. The energy-saving material density detection method according to claim 5, characterized in that: The method for watermarking the corresponding segmented video in the intermediate detection process video according to the first three non-zero digits includes: Take the intermediate frames of the corresponding segmented videos respectively, inject the target execution code into the startup process, and obtain the target view display function, and watermark the intermediate frames based on the target view display function. The target execution code is used to call the target dynamic link library opening instruction, and the target dynamic link library is a dynamic link library that encapsulates the target view display function.
7. An energy-saving material density detection system, used to implement an energy-saving material density detection method according to any one of claims 1 to 6, characterized in that: include: Data acquisition module: used to obtain the basic data of the material to be tested and calculate the real-time density of the material to be tested based on the basic data; Detection module: used to obtain a real-time image set of the material to be detected, input the real-time image set into a pre-built material classification model, obtain the material category, obtain the standard density range based on the material category and the mapping relationship, and determine whether the real-time density is within the standard density range; Marking module: used to mark the material to be tested according to the real-time image set when the real-time density is not within the standard density range, and to generate the corresponding initial testing process video; Encryption module: used to segment the initial detection process video based on the real-time image set to generate an intermediate detection process video, and process the intermediate detection process video according to the real-time density to generate a target detection process video.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the energy-saving material density detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Mixture density checking method and system
CN101339115A
Rock density measurement and rock density measurement device
CN104977226A