Image capturing method, device, industrial endoscope and computer readable storage medium
By acquiring and analyzing the parameters of the area to be inspected, and segmenting and processing the parameters of sub-regions, the problem of missed detection in industrial endoscope inspection is solved, and the inspection efficiency and accuracy are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2026-04-14
AI Technical Summary
During industrial endoscope inspection, eye fatigue caused by prolonged work can easily lead to missed inspections, making it crucial to improve inspection efficiency.
By acquiring the regional parameters of the region to be detected, determining the sub-region parameters of the sub-regions to be detected based on the regional parameters, and capturing images of each sub-region to be detected based on the sub-region parameters, a detection image is obtained. This includes techniques such as preset segmentation rules, sub-resolution matching, noise reduction processing, and damage feature recognition.
This effectively avoids missing sub-regions to be inspected, reduces image acquisition time, and improves the working efficiency and inspection accuracy of industrial endoscopes.
Smart Images

Figure CN115294092B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image acquisition technology, and in particular to an image acquisition method, apparatus, industrial endoscope, and computer-readable storage medium. Background Technology
[0002] With the development of science and technology, industrial endoscopes are widely used in various industries. In the power industry, they are mainly used for the inspection and maintenance of pipelines, generator rotors and headers. Industrial endoscopes are a type of non-destructive testing instrument classified as Visual Testing (VT). They are used to observe the internal surface conditions of objects that cannot be directly seen with the naked eye. This testing method is non-destructive and easy to operate, eliminating the tedious disassembly and assembly process, avoiding damage to the structure of the object being tested, and effectively improving testing efficiency.
[0003] During their research, the inventors discovered that when using industrial endoscopes for inspection, eye fatigue caused by prolonged work can easily lead to missed inspections. Therefore, improving the efficiency of industrial endoscopes is becoming increasingly important. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, industrial endoscope, and computer-readable storage medium for acquiring images, in order to solve at least one of the above problems.
[0005] The above-mentioned inventive objective of this application is achieved through the following technical solutions:
[0006] Firstly, an image acquisition method is provided, the method comprising:
[0007] Obtain the region parameters of the area to be detected;
[0008] Based on the region parameters, determine the sub-region parameters corresponding to at least two sub-regions to be detected;
[0009] Based on the sub-region parameters, images are captured for each sub-region to be detected to obtain a detection image.
[0010] In one possible implementation, determining the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters includes:
[0011] Based on the preset segmentation rules and the region parameters, the region to be detected is divided into at least two sub-regions to be detected, and the sub-region parameters corresponding to each sub-region to be detected are obtained. The preset segmentation rules include: the direction to be detected and the region parameter weights corresponding to the direction to be detected.
[0012] In another possible implementation, the sub-region parameters include: low sub-region parameters and high sub-region parameters; the step of determining the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters further includes: calculating the region difference corresponding to each sub-region parameter, wherein the region difference is determined by the low sub-region parameters and the high sub-region parameters;
[0013] Obtain the first correspondence between the preset region difference and the preset sub-resolution, and determine the sub-resolution corresponding to each sub-region to be detected based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution.
[0014] In another possible implementation, the step of capturing images of each sub-region to be detected based on the sub-region parameters to obtain a detection image includes:
[0015] Based on the sub-region parameters and the sub-resolution, images are captured for each sub-region to be detected to obtain a detection image.
[0016] In another possible implementation, the step of capturing images of each sub-region to be detected based on the sub-region parameters to obtain a detection image further includes:
[0017] Obtain the grayscale value of each pixel in the detected image;
[0018] Based on the pixel grayscale value, determine whether the clarity of the detected image is less than a preset clarity to obtain a first determination result; if the first determination result is yes, then perform noise reduction processing on the detected image based on the pixel grayscale value to obtain a noise-reduced image.
[0019] In another possible implementation, after capturing images of each sub-region to be detected based on the detection sub-parameters to obtain a detection image, the method further includes:
[0020] The current data is obtained based on the pixel grayscale value, and the current data includes: current damage features, which include: current damage range and current damage shape;
[0021] Establish a second correspondence between the current damage range and the current damage shape;
[0022] The second correspondence, the current damage range, and the current damage shape are input into the trained detection model to obtain the current damage type.
[0023] In another possible implementation, the step of inputting the second correspondence, the current damage range, and the current damage shape into the trained detection model to obtain the current damage type further includes:
[0024] Obtain historical damage features and historical damage types, wherein the historical damage features include: historical damage range and historical damage shape; establish a third correspondence between the historical damage range and the historical damage shape, and based on the third correspondence, establish a fourth correspondence between the historical damage type and at least one of the historical damage range and the historical damage shape;
[0025] The third correspondence, the fourth correspondence, the historical damage range, the historical damage shape, and the historical damage type are input into the original model for training to obtain the trained detection model.
[0026] Secondly, an image-capturing device is provided, the device comprising:
[0027] The first acquisition module is used to acquire the region parameters of the region to be detected.
[0028] The determination module is used to determine the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters;
[0029] The image acquisition module is used to acquire images of each sub-region to be detected based on the sub-region parameters to obtain a detection image.
[0030] In one possible implementation, when the determining module determines the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters, it is specifically used for:
[0031] Based on the preset segmentation rules and the region parameters, the region to be detected is divided into at least two sub-regions to be detected, and the sub-region parameters corresponding to each sub-region to be detected are obtained. The preset segmentation rules include: the direction to be detected and the region parameter weights corresponding to the direction to be detected.
[0032] In another possible implementation, the sub-region parameters include: low sub-region parameters and high sub-region parameters; the device further includes: a calculation module and a second acquisition module, wherein the calculation module is used to calculate the region difference value corresponding to each sub-region parameter, and the region difference value is determined by the low sub-region parameters and the high sub-region parameters;
[0033] The second acquisition module is used to acquire a first correspondence between the preset region difference and the preset sub-resolution, and based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution, determine the sub-resolution corresponding to each sub-region to be detected.
[0034] In another possible implementation, when the image-capturing module captures images of each sub-region to be detected based on the sub-region parameters to obtain a detection image, it is specifically used for:
[0035] Based on the sub-region parameters and the sub-resolution, images are captured for each sub-region to be detected to obtain a detection image.
[0036] In another possible implementation, the device further includes: a third acquisition module, a judgment module, and a noise reduction processing module, wherein,
[0037] The third acquisition module is used to acquire the grayscale value of each pixel in the detected image;
[0038] The judgment module is used to determine whether the clarity of the detected image is less than a preset clarity based on the gray value of the pixel, and to obtain a first judgment result;
[0039] The noise reduction processing module is used to perform noise reduction processing on the detection image based on the pixel grayscale value when the first judgment result is yes, so as to obtain a noise-reduced image.
[0040] In another possible implementation, the apparatus further includes: a fourth acquisition module, a first establishment module, and an input module, wherein,
[0041] The fourth acquisition module is used to acquire current data based on the pixel grayscale value. The current data includes the current damage feature, which includes the current damage range and the current damage shape.
[0042] The first establishment module is used to establish a second correspondence between the current damage range and the current damage shape;
[0043] The input module is used to input the second correspondence, the current damage range, and the current damage shape into the trained detection model to obtain the current damage type.
[0044] In another possible implementation, the apparatus further includes: a fifth acquisition module, a second establishment module, and a training module, wherein,
[0045] The fifth acquisition module is used to acquire historical damage features and historical damage types, wherein the historical damage features include: historical damage range and historical damage shape;
[0046] The second establishment module is used to establish a third correspondence between the historical damage range and the historical damage shape, and based on the third correspondence, establish a fourth correspondence between the historical damage type and at least one of the historical damage range and the historical damage shape;
[0047] The training module is used to input the third correspondence, the fourth correspondence, the historical damage range, the historical damage shape, and the historical damage type into the original model for training, so as to obtain the trained detection model.
[0048] Thirdly, an industrial endoscope is provided, comprising:
[0049] One or more processors;
[0050] Memory;
[0051] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform operations corresponding to the imaging method shown in any possible implementation of the first aspect.
[0052] Fourthly, a computer-readable storage medium is provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement an image-taking method as shown in any possible implementation of the first aspect.
[0053] In summary, this application includes at least one of the following beneficial technical effects:
[0054] This application provides an image acquisition method, apparatus, industrial endoscope, and computer-readable storage medium. Compared with related technologies, in this application, by acquiring the region parameters of the area to be detected, determining the sub-region parameters corresponding to each sub-region to be detected based on the region parameters, and acquiring images of each sub-region to be detected based on the determined sub-region parameters, a detection image is obtained. This avoids the situation of missing any sub-region to be detected, thereby reducing the image acquisition time for each sub-region to be detected and further improving the efficiency of industrial endoscope operation. Attached Figure Description
[0055] Figure 1 This is a schematic flowchart of an image acquisition method provided in an embodiment of this application.
[0056] Figure 2 This is a schematic diagram of an image-capturing device provided in an embodiment of this application.
[0057] Figure 3 This is a schematic diagram of the structure of an industrial endoscope provided in an embodiment of this application. Detailed Implementation
[0058] The present application will be further described in detail below with reference to the accompanying drawings.
[0059] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0062] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0063] This application provides an image acquisition method performed by an industrial endoscope device, such as... Figure 1 As shown, the method may include:
[0064] Step S101: Obtain the region parameters of the region to be detected.
[0065] In this embodiment of the application, the area to be detected can be the entire internal space of the pipe. The area parameters are parameters characterizing the range of the entire internal space. For example, the area parameters for area 1 to be detected are a horizontal range of 10°-70° and a vertical range of 30°-60°. In this embodiment of the application, the industrial endoscope can acquire the area parameters of the area to be detected input by the user.
[0066] In the above-mentioned embodiments, after the industrial endoscope acquires the regional parameters of the area to be detected, the cloud storage device can store the regional parameters of the area to be detected acquired by the industrial endoscope. Furthermore, in this embodiment, the regional parameters of the area to be detected can also be stored locally, or the regional parameters of the area to be detected can be sent to other devices for storage.
[0067] Step S102: Determine the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters.
[0068] For the embodiments of this application, it is necessary to perform image detection in each direction of the area to be detected. After obtaining the area parameters in the above steps, the area to be detected can be the overall internal space of the pipeline. When taking images in each direction of the overall internal space, the overall internal space is divided into subspaces in each direction. That is, the area to be detected is divided into at least two sub-areas to be detected based on the area parameters, and the sub-area parameters are obtained.
[0069] Step S103: Based on the sub-region parameters, images are captured for each sub-region to be detected to obtain the detection image.
[0070] In the embodiments of this application, after obtaining the sub-region parameters, the sub-region positions are determined based on the sub-region parameters, and images are captured according to the positions of each sub-region. When capturing images of each region to be detected, each sub-region to be detected is numbered, and detection is completed sequentially according to the number. When a region with a certain number is not detected, an alarm message is issued. The alarm message may include the sub-region parameters of the undetected sub-region to remind the staff. For example, the region to be detected 1 is determined as sub-region 11, sub-region 12, and sub-region 13 to be detected, and images of the sub-regions to be detected are captured sequentially according to the number to obtain the detection image.
[0071] This application provides an image acquisition method. Compared with related technologies, in this application embodiment, by obtaining the region parameters of the area to be detected, and determining the sub-region parameters corresponding to each sub-region to be detected based on the region parameters, and acquiring images of each sub-region to be detected based on the determined sub-region parameters, a detection image is obtained. This avoids the situation of missing each sub-region to be detected, thereby reducing the image acquisition time of each sub-region to be detected and further improving the efficiency of industrial endoscope operation.
[0072] In one possible implementation of this application, step S102, which determines the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters, may specifically include: dividing the region to be detected into at least two sub-regions to be detected based on preset segmentation rules and region parameters, and obtaining the sub-region parameters corresponding to each sub-region to be detected.
[0073] The preset segmentation rules include: the direction to be detected and the weights of the region parameters corresponding to the direction to be detected.
[0074] For the embodiments of this application, the preset segmentation rules can be preset by the system or engineer, or determined by the user's current selection. The weight of the region parameter corresponding to the detection direction can include the weight of the horizontal range parameter and / or the weight of the vertical range parameter. For example, the region parameter is a horizontal range of 10°-70° and a vertical range of 30°-60°. When the detection direction is divided into left and right directions, the weight of the region parameter corresponding to the left is 0.4, and the weight of the region parameter corresponding to the right is 0.6. The sub-region parameters 1 after segmentation are a horizontal range of 10°-34° and a vertical range of 30°-60°, and the sub-region parameters 2 after segmentation are a horizontal range of 34°-70° and a vertical range of 30°-60°.
[0075] In this embodiment of the application, the area to be detected is divided into at least two sub-areas to be detected, so that when the area to be detected is imaged, the sub-areas to be detected are not missed.
[0076] Another possible implementation of this application embodiment includes: low sub-region parameters and high sub-region parameters;
[0077] Based on the region parameters, at least two sub-region parameters corresponding to the sub-regions to be detected are determined, followed by: steps Sa1 (not shown in the figure) and Sa2 (not shown in the figure), wherein,
[0078] Step Sa1: Calculate the regional difference corresponding to the parameters of each sub-region.
[0079] The regional difference is determined by the low sub-region parameters and the high sub-region parameters.
[0080] In this embodiment of the application, the size of each sub-region to be detected can be determined by calculating the regional difference value corresponding to each sub-region parameter. Each sub-region parameter includes: horizontal range parameter and vertical region parameter. The horizontal difference value is calculated by the low region parameter and high region parameter corresponding to the horizontal range, and the vertical difference value is calculated based on the low sub-region parameter and high sub-region parameter corresponding to the vertical range. The regional difference value is determined based on the preset horizontal weight, preset vertical weight, horizontal difference value, and vertical difference value. For example, the sub-region parameters of the sub-region to be detected 1 are: horizontal range 30°-35°, vertical range 10°-20°. Then the horizontal difference value of the sub-region to be detected 1 is 5° and the vertical difference value is 10°. Based on the preset vertical weight and preset horizontal weight, the regional difference value is calculated to be 6.6°. Among them, the low sub-region parameter of the horizontal range is 30° and the high sub-region parameter is 35°, the low sub-region parameter of the vertical range is 10° and the high sub-region parameter is 20°.
[0081] Step Sa2: Obtain the first correspondence between the preset region difference and the preset sub-resolution, and determine the sub-resolution corresponding to each sub-region to be detected based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution.
[0082] In the embodiments of this application, the preset sub-resolution is the resolution of the sub-region to be detected. The preset region difference and the preset sub-resolution can be preset by the engineer or the system, or can be selected by the user. In the embodiments of this application, different region differences are used to characterize the size of the sub-region to be detected. The smaller the region difference, the smaller the range of the sub-region to be detected corresponding to the region difference. When capturing images of the sub-region to be detected, different resolutions are used for sub-regions of different sizes.
[0083] Furthermore, after calculating the regional difference in the above steps, the regional difference is matched based on the preset difference to obtain the matched preset difference. Based on the first correspondence between the matched preset difference and the preset sub-resolution, the sub-resolution corresponding to the region to be detected is determined.
[0084] In the embodiments of this application, the sub-resolution corresponding to each region to be detected is determined by the sub-region parameters, eliminating the need for users to repeatedly adjust and select the sub-resolution, thus further improving the working efficiency of industrial endoscopes.
[0085] Furthermore, after obtaining the sub-resolution through the above embodiments, images of each sub-region to be detected are captured separately based on the sub-region parameters to obtain a detection image. Specifically, this may include: capturing images of each sub-region to be detected separately based on the sub-region parameters and the sub-resolution to obtain a detection image.
[0086] In this embodiment, images of each sub-region to be detected are captured separately using sub-region parameters. This avoids omissions when capturing images of the sub-regions to be detected. Furthermore, by capturing images of the sub-regions to be detected according to the sub-resolution corresponding to the sub-region parameters, the accuracy of capturing images of the sub-regions to be detected is further improved.
[0087] Another possible implementation of this application embodiment is to capture images of each sub-region to be detected based on sub-region parameters to obtain a detection image, and then may include: step Sb1 (not shown in the figure), step Sb2 (not shown in the figure) and step Sb3 (not shown in the figure), wherein step Sb1 can be executed after step Sa1, step Sb1 can also be executed after step Sa1, or step Sb1 can be executed simultaneously with step Sa1.
[0088] Step Sb1: Obtain the grayscale value of each pixel in the detected image.
[0089] In this embodiment of the application, the pixel grayscale value is the brightness of all pixels in the detected image. In this embodiment of the application, the pixel grayscale value can be obtained from local storage, from other devices, or from the pixel grayscale value input by the user.
[0090] Step Sb2: Determine whether the sharpness of the detected image is less than the preset sharpness based on the pixel grayscale value, and obtain the first judgment result.
[0091] In the embodiments of this application, the preset sharpness can be preset by the engineer or the system, or it can be currently selected and determined by the user. The sharpness of the detected image is calculated based on the grayscale values of pixels, for example, based on D(f)=∑ y ∑ x |f(x+2,y)-f(x,y)| 2 The sharpness of the detected image is obtained.
[0092] Where f(x, y) is used to characterize the gray value of pixel (x, y), (x, y) is used to characterize the coordinate position of a pixel, f(x+2, y) is used to characterize the gray value of pixel (x+2, y), and D(f) is used to characterize the sharpness of the detected image.
[0093] Step Sb3: If the first judgment result is yes, then the detection image is denoised to obtain a denoised image.
[0094] In the embodiments of this application, when the first judgment result is yes, that is, when the clarity of the detected image is less than the preset clarity, the detected image will affect the final detection result. The detected image is denoised based on the gray value of the pixel. The gray value of each pixel of the detected image is set to the median of the gray values of all pixels in a certain neighborhood window of that point. The size of the neighborhood window is preset by the engineer or the system to obtain the denoised image.
[0095] In this embodiment of the application, the sharpness of the captured detection image is compared by the grayscale value of the pixel, and the unclear detection image is subjected to noise reduction processing to make the obtained detection image clearer, so as to make the anomaly detection of the detection image more accurate and further improve the working efficiency of industrial endoscope.
[0096] Another possible implementation of this application embodiment is to capture images of each sub-region to be detected based on the detection sub-parameters to obtain a detection image, and then further include: step Sc1 (not shown in the figure), step Sc2 (not shown in the figure) and step Sc3 (not shown in the figure), wherein step Sc1 can be executed after step Sb1, step Sc1 can be executed before step Sb1, and step Sc1 can also be executed simultaneously with step Sb1.
[0097] Step Sc1: Obtain the current data based on the pixel grayscale value.
[0098] The current data includes: current damage characteristics, which in turn include: current damage range and current damage shape.
[0099] In the embodiments of this application, the current data of the detected image is the set of gray values of each pixel of the detected image at the current time, expressed in numerical form. In a detected image, the current data in the detected image is obtained by detecting the detected image. By checking the current data, the current features are determined, and the current damage features, damage range and damage shape are extracted from the current features. For example, the current damage range of detected image 1 is 2.44 square centimeters, and the current damage shape is circular.
[0100] Step Sc2: Establish a second correspondence between the current damage range and the current damage shape.
[0101] In this embodiment of the application, each current damage range corresponds to a current damage shape. Different current damage ranges in the detection image correspond to different current damage shapes. After establishing a second correspondence between the current damage range and the current damage shape, the second correspondence can be stored in the database. For example, the current damage range is 2.44 square centimeters, and the current damage shape corresponding to the current damage range is a circle.
[0102] Step Sc3: Input the second correspondence, the current damage range, and the current damage shape into the trained detection model to obtain the current damage type.
[0103] In this embodiment of the application, the current damage shape is vectorized to obtain the current damage shape of numerical features. Based on the first correspondence, the current damage range and the vectorized current damage shape are converted into a feature matrix. The feature matrix is then input into the trained detection model to obtain the current damage type of the detection image. This reduces the time required to determine the current damage type and further improves the working efficiency of industrial endoscopes.
[0104] Another possible implementation of this application embodiment is to obtain the original Building Information Modeling (BIM); update the original BIM model based on the current data to obtain the current BIM model.
[0105] In the embodiments of this application, the step of obtaining the original BIM model can be performed before the step of obtaining the current data based on the pixel grayscale value, or after the step of obtaining the current data based on the pixel grayscale value, or simultaneously with the step of obtaining the current data based on the pixel grayscale value.
[0106] Specifically, the original BIM model can be a historical BIM model of the area to be inspected (such as a pipeline). The original BIM model includes historical color data and historical shape data. By integrating the current data, the current BIM model data is obtained. The current BIM model includes current color data and current shape data. The historical BIM model data corresponding to the current BIM model data is updated to obtain the current BIM model. After obtaining the current BIM model, the display device can display the current BIM model in real time, and can also display the current BIM model when a display command triggered by the user is detected, so that the user can intuitively understand the current damage status of the inspected object.
[0107] Another possible implementation of this application embodiment is to input the second correspondence, the current damage range and the current damage shape into the trained detection model to obtain the current damage type. Before this, it may include: step Sd1 (not shown in the figure), step Sd2 (not shown in the figure) and step Sd3 (not shown in the figure), wherein step Sd1 can be executed after step Sc1, step Sd1 can be executed before step Sc1, and step Sd1 can be executed simultaneously with step Sc1.
[0108] Step Sd1: Obtain historical damage characteristics and historical damage types.
[0109] Among them, the characteristics of historical damage include: the extent of historical damage and the shape of historical damage.
[0110] For embodiments of this application, the historical damage range, historical damage shape, and historical damage type can be obtained from local storage, from other devices, or from user-inputted historical damage range, historical damage shape, and historical damage type.
[0111] The historical data can be the historical damage range, historical damage shape, and historical damage type of the hour or month preceding the current time corresponding to the current data. The specific time range is not limited in this application embodiment.
[0112] Step Sd2: Establish a third correspondence between historical damage range and historical damage shape, and based on the third correspondence, establish a fourth correspondence between historical damage type and at least one of historical damage range and historical damage shape.
[0113] In the embodiments of this application, different historical damage shapes correspond to different historical damage ranges, and different historical damage types correspond to different historical damage ranges and historical damage shapes. After establishing a third correspondence between historical damage ranges and historical damage shapes, and a fourth correspondence between historical damage types and at least one of historical damage ranges and historical damage shapes, the third correspondence and the fourth correspondence are stored in the database. For example, the historical damage type is "crack", the historical damage range is "1.3 cm", and the historical damage shape is "strip".
[0114] In accordance with the embodiments of this application, a third correspondence between historical damage range and historical damage shape, and a fourth correspondence between historical damage type and at least one of historical damage range and historical damage shape are established, so that the historical damage type corresponding to different historical damage characteristics is more accurate.
[0115] Step Sd3: Input the third correspondence, the fourth correspondence, the historical damage range, the historical damage shape, and the historical damage type into the original model for training to obtain the trained detection model.
[0116] In this embodiment, the historical damage shape and historical damage type are vectorized to obtain the historical damage shape of numerical features. Based on the third and fourth correspondences, the historical damage type and the vectorized historical damage shape and historical damage type are converted into a feature matrix. The feature matrix is trained using the back propagation (BP) algorithm. The feature matrix enters the network from the input layer, passes through the hidden layer to the output layer. If the output damage type of the output layer is different from the historical damage type, the back propagation of error is initiated. Back propagation includes: the difference between the actual output damage type and the historical damage type (i.e., the output error) is back propagated through the hidden layer to the input layer. During the back propagation process, the error is distributed to each unit of each layer to obtain the error signal of each layer, which is used as the basis for correcting the weights of each unit. When the sum of squared output errors is less than the preset error, the trained detection model is obtained.
[0117] In this embodiment of the application, the BP algorithm is used to train the historical damage range, historical damage shape and historical damage type based on the third and fourth correspondences. When the sum of squared output errors is less than the preset error, the trained detection model is obtained, making the trained detection model more accurate and further improving the working efficiency of industrial endoscopes.
[0118] The above embodiments describe an image acquisition method from the perspective of process flow. The following embodiments describe an image acquisition device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.
[0119] This application provides an image-capturing device, such as... Figure 2 As shown, the image-capturing device 20 may specifically include: a first acquisition module 21, a determination module 22, and an image-capturing module 23, wherein,
[0120] The first acquisition module 21 is used to acquire the region parameters of the region to be detected.
[0121] The determination module 22 is used to determine the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters;
[0122] The image acquisition module 23 is used to acquire images of each sub-region to be detected based on the sub-region parameters to obtain a detection image.
[0123] In one possible implementation, when determining the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters, the determining module 22 is specifically used for:
[0124] Based on preset segmentation rules and region parameters, the region to be detected is divided into at least two sub-regions to be detected, and the sub-region parameters corresponding to each sub-region to be detected are obtained. The preset segmentation rules include: the direction to be detected and the region parameter weights corresponding to the direction to be detected.
[0125] In another possible implementation, the sub-region parameters include: low sub-region parameters and high sub-region parameters;
[0126] Device 20 further includes: a calculation module and a second acquisition module, wherein
[0127] The calculation module is used to calculate the regional difference corresponding to the parameters of each sub-region. The regional difference is determined by the low sub-region parameter and the high sub-region parameter.
[0128] The second acquisition module is used to acquire the first correspondence between the preset region difference and the preset sub-resolution, and based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution, determine the sub-resolution corresponding to each sub-region to be detected.
[0129] In another possible implementation, when the image-capturing module 23 captures images of each sub-region to be detected based on the sub-region parameters to obtain the detection image, it is specifically used for:
[0130] Based on the sub-region parameters and sub-resolution, images are captured for each sub-region to be detected to obtain the detection image.
[0131] In another possible implementation, device 20 further includes: a third acquisition module, a judgment module, and a noise reduction processing module, wherein,
[0132] The third acquisition module is used to acquire the grayscale value of each pixel in the detected image;
[0133] The judgment module is used to determine whether the sharpness of the detected image is less than the preset sharpness based on the gray value of the pixel, and to obtain the first judgment result;
[0134] The noise reduction module is used to perform noise reduction processing on the detection image based on the pixel grayscale value when the first judgment result is yes, so as to obtain a noise-reduced image.
[0135] In another possible implementation, device 20 further includes: a fourth acquisition module, a first establishment module, and an input module, wherein,
[0136] The fourth acquisition module is used to acquire current data based on pixel grayscale values. The current data includes: current damage features, which include: current damage range and current damage shape.
[0137] The first module is used to establish a second correspondence between the current damage range and the current damage shape;
[0138] The input module is used to input the second correspondence, the current damage range, and the current damage shape into the trained detection model to obtain the current damage type.
[0139] In another possible implementation, device 20 further includes: a fifth acquisition module, a second establishment module, and a training module, wherein,
[0140] The fifth acquisition module is used to acquire historical damage characteristics and historical damage types. Historical damage characteristics include: historical damage range and historical damage shape.
[0141] The second module is used to establish a third correspondence between historical damage range and historical damage shape, and based on the third correspondence, to establish a fourth correspondence between historical damage type and at least one of historical damage range and historical damage shape; the training module is used to input the third correspondence, the fourth correspondence, historical damage range, historical damage shape and historical damage type into the original model for training, and obtain the trained prediction model.
[0142] This application provides an image acquisition device. Compared with related technologies, in this application embodiment, by acquiring the region parameters of the area to be detected, and determining the sub-region parameters corresponding to each sub-region to be detected based on the region parameters, and acquiring images of each sub-region to be detected based on the determined sub-region parameters, a detection image is obtained. This avoids the situation of missing each sub-region to be detected, thereby reducing the image acquisition time of each sub-region to be detected and further improving the efficiency of industrial endoscope operation.
[0143] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the image acquisition device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0144] This application provides an industrial endoscope, such as... Figure 3 As shown, Figure 3 The industrial endoscope 30 shown includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the industrial endoscope 30 may also include a transceiver 304. It should be noted that in practical applications, the transceiver 304 is not limited to one type, and the structure of this industrial endoscope 30 does not constitute a limitation on the embodiments of this application.
[0145] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0146] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0147] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0148] The memory 303 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0149] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, in this application embodiment, by acquiring the region parameters of the area to be detected and determining the sub-region parameters corresponding to each sub-region to be detected based on the region parameters, and by capturing images of each sub-region to be detected based on the determined sub-region parameters, a detection image is obtained. This avoids the possibility of missing any sub-regions to be detected, thereby reducing the image acquisition time for each sub-region to be detected and further improving the efficiency of industrial endoscope operation.
[0150] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0151] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for acquiring an image, characterized in that, include: Obtain the region parameters of the area to be detected; Based on the region parameters, determine the sub-region parameters corresponding to at least two sub-regions to be detected; Based on the sub-region parameters, images are captured for each sub-region to be detected to obtain a detection image; The step of determining the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters includes: Based on the preset segmentation rules and the region parameters, the region to be detected is divided into at least two sub-regions to be detected, and the sub-region parameters corresponding to each sub-region to be detected are obtained. The preset segmentation rules include: the direction to be detected and the weight of the region parameter corresponding to the direction to be detected. The sub-region parameters include: low sub-region parameters and high sub-region parameters; The process of determining sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters further includes: Calculate the regional difference corresponding to each sub-region parameter, wherein the regional difference is determined by the low sub-region parameter and the high sub-region parameter; Obtain the first correspondence between the preset region difference and the preset sub-resolution, and determine the sub-resolution corresponding to each sub-region to be detected based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution; The step of capturing images of each sub-region to be detected based on the sub-region parameters to obtain a detection image includes: Based on the sub-region parameters and the sub-resolution, images are captured for each sub-region to be detected to obtain a detection image.
2. The method according to claim 1, characterized in that, The step of capturing images of each sub-region to be detected based on the sub-region parameters to obtain a detection image, further includes: Obtain the grayscale value of each pixel in the detected image; Based on the grayscale values of the pixels, determine whether the sharpness of the detected image is less than a preset sharpness, and obtain a first judgment result; If the first determination result is yes, then the detected image is denoised based on the pixel grayscale value to obtain a denoised image.
3. The method according to claim 2, characterized in that, The step of capturing images of each sub-region to be detected based on the sub-region parameters to obtain a detection image, further includes: The current data is obtained based on the pixel grayscale value, and the current data includes: current damage features, which include: current damage range and current damage shape; Establish a second correspondence between the current damage range and the current damage shape; The second correspondence, the current damage range, and the current damage shape are input into the trained detection model to obtain the current damage type.
4. The method according to claim 3, characterized in that, The step of inputting the second correspondence, the current damage range, and the current damage shape into the trained detection model to obtain the current damage type also includes: Obtain historical damage characteristics and historical damage types, wherein the historical damage characteristics include: historical damage range and historical damage shape; A third correspondence is established between the historical damage range and the historical damage shape, and based on the third correspondence, a fourth correspondence is established between the historical damage type and at least one of the historical damage range and the historical damage shape; The third correspondence, the fourth correspondence, the historical damage range, the historical damage shape, and the historical damage type are input into the original model for training to obtain the trained detection model.
5. An image-capturing device, characterized in that, include: The first acquisition module is used to acquire the region parameters of the region to be detected. The determination module is used to determine the sub-region parameters corresponding to at least two sub-regions to be detected based on the region parameters; The image acquisition module is used to acquire images of each sub-region to be detected based on the sub-region parameters to obtain a detection image; The determining module is specifically used to divide the region to be detected into at least two sub-regions to be detected based on a preset segmentation rule and the region parameters, and to obtain the sub-region parameters corresponding to each sub-region to be detected. The preset segmentation rule includes: the direction to be detected and the weight of the region parameter corresponding to the direction to be detected. The sub-region parameters include: low sub-region parameters and high sub-region parameters; The device further includes: a calculation module and a second acquisition module, wherein... The calculation module is used to calculate the regional difference value corresponding to each sub-region parameter, wherein the regional difference value is determined by the low sub-region parameter and the high sub-region parameter; The second acquisition module is used to acquire a first correspondence between the preset region difference and the preset sub-resolution, and based on the first correspondence, the preset region difference, the region difference and the preset sub-resolution, determine the sub-resolution corresponding to each sub-region to be detected. The image acquisition module is configured to acquire images of each sub-region to be detected based on the sub-region parameters and the sub-resolution, thereby obtaining a detection image.
6. An industrial endoscope, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to: perform an image acquisition method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements an image acquisition method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Area-array camera-based PCB bare board defect detection method
CN106651849A
Method and system for realizing screen detection by multiple cameras and computer readable storage medium
CN110351530A
Workpiece defect detection method based on deep learning
CN114764763A