An image processing method, device and computer readable storage medium

By performing feature extraction and hiding processing on images, and automatically determining pixel values ​​and segmenting them, the problem of cumbersome and inefficient splash extraction operations in existing technologies is solved, achieving efficient and accurate splash extraction.

CN116740084BActive Publication Date: 2025-11-07SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310497868.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2025-11-07
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

The current technology for extracting splashes from images is cumbersome and inefficient, making it difficult to automate.

Method used

By performing feature extraction and hiding processes on the image to be processed, the values ​​of pixels are determined, and segmentation is performed based on these values ​​to automatically extract the target object.

Benefits of technology

It improves the efficiency and accuracy of extracting splashes from images, avoiding the tedious operation of human experience analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740084B_ABST
    Figure CN116740084B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method, which comprises the following steps: acquiring an image to be processed; performing feature extraction on the image to be processed to obtain a first object, and performing hiding processing on the first object in the image to be processed to obtain a target image; determining a first value corresponding to a pixel point of the target image based on a pixel value of the pixel point, and performing first segmentation processing on the target image based on the first value to determine a second object; and determining a target object based on the first object and the second object, wherein the first object and the second object are of the same type. The application also discloses an image processing device and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the image processing technology in the field of image processing, and in particular to an image processing method, device and computer readable storage medium. BACKGROUND

[0002] In the process of laser processing metal, plume, splash, noise and other phenomena will be generated; among them, the splash is derived from the inside of the molten pool, and analyzing the splash can determine the quality of laser processing. In related technologies, when extracting the splash, a large number of images are usually collected in the process of laser processing metal, and the collected images are analyzed according to human experience to extract the splash from the images; however, the above-mentioned method of extracting the splash has the problems of complicated operation and low efficiency. SUMMARY

[0003] The embodiments of the present application provide an image processing method, device and computer readable storage medium, which solve the problems of complicated operation and low efficiency of the scheme for extracting the splash from the image in related technologies.

[0004] The technical scheme of the present application is implemented as follows:

[0005] An image processing method, the method comprising:

[0006] obtaining a to-be-processed image;

[0007] performing feature extraction on the to-be-processed image to obtain a first object, and performing hidden processing on the first object in the to-be-processed image to obtain a target image;

[0008] determining a first value corresponding to a pixel point of the target image based on a pixel value of the pixel point, and performing first segmentation processing on the target image based on the first value to determine a second object;

[0009] determining a target object based on the first object and the second object; wherein the types of the first object and the second object are the same.

[0010] In the above scheme, the performing feature extraction on the to-be-processed image to obtain a first object comprises:

[0011] performing second segmentation processing on the to-be-processed image to determine a first sub-object;

[0012] performing enhancement processing on the to-be-processed image, and performing second segmentation processing on the to-be-processed image after the enhancement processing to determine a second sub-object;

[0013] superimposing the first sub-object and the second sub-object to obtain the first object.

[0014] In the scheme, the first value corresponding to the pixel point of the first region is determined based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the second region.

[0015] The target image is regionally divided based on the target size parameter to obtain a plurality of first regions.

[0016] For each first region, a plurality of second regions related to the position of the first region are determined.

[0017] The first value corresponding to the pixel point of the first region is determined based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the second region.

[0018] In the scheme, the plurality of second regions related to the position of the first region are determined.

[0019] The position information of the first region in the target image is obtained.

[0020] Based on the position information and the target distance, the plurality of second regions related to the position of the first region are determined.

[0021] In the scheme, the first value corresponding to the pixel point of the first region is determined based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the second region.

[0022] The pixel value of the pixel point of each second region in the plurality of second regions is operated to obtain a second value corresponding to each region.

[0023] The pixel value of the pixel point of the first region is screened to obtain a target pixel value.

[0024] Based on the plurality of second values and the target pixel value, the pixel value of each pixel point of the first region is processed to obtain a first value corresponding to each pixel point of the first region.

[0025] In the scheme, the first value corresponding to each pixel point of the first region is determined based on the plurality of second values and the target pixel value.

[0026] In the case where the target pixel value is greater than the plurality of second values, the pixel value of each pixel point of the first region is increased to obtain a first value corresponding to each pixel point of the first region.

[0027] In the case where the target pixel value is less than or equal to the plurality of second values, the pixel value of each pixel point of the first region is decreased to obtain a first value corresponding to each pixel point of the first region.

[0028] In the above solution, the first segmentation processing is performed on the target image based on the first value to determine a second object, including:

[0029] The target image is subjected to threshold segmentation processing in a target segmentation manner to determine the second object.

[0030] In the above solution, the target object is determined based on the first object and the second object, including:

[0031] The first object and the second object are superimposed to obtain a superimposed object.

[0032] The superimposed object is subjected to third segmentation processing to obtain the target object.

[0033] In the above solution, the method further includes:

[0034] The number of target objects existing in the image to be processed is determined.

[0035] The area of each target object is determined.

[0036] An image processing device, the device comprising: a processor, a memory and a communication bus;

[0037] The communication bus is used to realize the communication connection between the processor and the memory;

[0038] The processor is used to execute the image processing program in the memory to realize the steps of the above image processing method.

[0039] An image processing apparatus, the apparatus comprising:

[0040] An acquisition unit is configured to acquire an image to be processed.

[0041] A processing unit is configured to perform feature extraction on the image to be processed to obtain a first object, and perform hidden processing on the first object in the image to be processed to obtain a target image.

[0042] The processing unit is further configured to determine a first value corresponding to a pixel point of the target image based on a pixel value of the pixel point, and perform first segmentation processing on the target image based on the first value to determine a second object.

[0043] The processing unit is further configured to determine a target object based on the first object and the second object, wherein the first object and the second object are of the same type.

[0044] A computer-readable storage medium stores one or more programs, which are executable by one or more processors to implement the steps of the image processing method described above.

[0045] The image processing method, device and computer-readable storage medium provided by the embodiments of the present application acquire a to-be-processed image, perform feature extraction on the to-be-processed image to obtain a first object, perform hiding processing on the first object in the to-be-processed image to obtain a target image, determine a first value corresponding to a pixel point of the target image based on a pixel value of the pixel point, perform first segmentation processing on the target image based on the first value to determine a second object, and determine a target object based on the first object and the second object. The types of the first object and the second object are the same. In this way, the first object determined in the to-be-processed image is hidden to obtain the target image, the first segmentation processing is performed on the target image based on the first value corresponding to the pixel point of the target image to obtain the second object, and the target object is determined based on the first object and the second object, thereby realizing automatic extraction of the target object from the to-be-processed image and improving the efficiency of extracting the target object, instead of manually analyzing the collected to-be-processed image to extract the target object, thereby solving the problem of complicated operation and low efficiency of the related art scheme of extracting the target object (splashing) from the image. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A flowchart of an image processing method provided by the embodiments of the present application is shown in the figure.

[0047] Figure 2 A flowchart of another image processing method provided by the embodiments of the present application is shown in the figure.

[0048] FIG. 3(a) is a partial schematic view of a target image in the image processing method provided by the embodiments of the present application.

[0049] FIG. 3(b) is a schematic view of a first region and a second region of the target image in the image processing method provided by the embodiments of the present application.

[0050] FIG. 4(a) is an effect diagram of the first region before the gray value of the pixel point of the first region is processed in the image processing method provided by the embodiments of the present application.

[0051] FIG. 4(b) is an effect diagram after the gray value of the pixel point of the first region is processed in the image processing method provided by the embodiments of the present application.

[0052] Figure 5 A flowchart of another image processing method provided by the embodiments of the present application is shown in the figure.

[0053] Figure 6An image processing effect diagram in an image processing method provided by an embodiment of the present application;

[0054] Figure 7 A structural schematic diagram of an image processing device provided by an embodiment of the present application;

[0055] Figure 8 A structural schematic diagram of an image processing device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application.

[0057] It should be understood that the "embodiments of the present application" or "the foregoing embodiments" mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the foregoing embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In various embodiments of the present application, the size of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial number of the above-mentioned embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.

[0058] Unless otherwise specified, the electronic device executes any step in the embodiments of the present application, which can be a processor of the electronic device executing the step. It is also worth noting that the embodiments of the present application do not limit the order of the steps executed by the electronic device. In addition, the way of processing data in different embodiments can be the same method or different method. It should be noted that any step in the embodiments of the present application can be independently executed by the electronic device, that is, the electronic device can execute any step in the embodiments described below without depending on the execution of other steps.

[0059] The specific embodiments described herein are merely intended to explain the present application, and not to limit the present application.

[0060] The embodiments of the present application provide an image processing method, which can be applied to an image processing device, as shown in Figure 1 The method comprises the following steps:

[0061] Step 101, acquiring an image to be processed.

[0062] In the embodiments of the present application, the image processing device can be an intelligent device with certain data processing function and image acquisition function. The image to be processed can be an image acquired in real time in the process of laser processing metal, or a historically acquired image. The image to be processed can be a three-channel color image.

[0063] Specifically, the image to be processed can be acquired by the image processing device in response to a received acquisition instruction, or can be acquired by other devices and then sent to the image processing device, or can be downloaded by the image processing device through a network. In this way, the image to be processed can be acquired in different ways, improving the flexibility of acquiring the image to be processed.

[0064] In a possible implementation, the image processing device can acquire a video to be processed in the process of laser processing metal, and extract the image to be processed from the video to be processed based on a quality threshold parameter of the image. The quality threshold parameter is used to measure the quality of the image, and the quality threshold parameter at least includes a definition threshold. In this way, the image to be processed is obtained by screening the images in the video to be processed based on the quality threshold parameter, ensuring the quality of the obtained image to be processed, and further improving the accuracy of extracting the spatter from the image to be processed.

[0065] Step 102, feature extraction is performed on the image to be processed to obtain a first object, and the first object in the image to be processed is hidden to obtain a target image.

[0066] In the embodiments of the present application, the first object can be obtained by performing feature extraction on the image to be processed based on the pixel value of the pixel point of the image to be processed, and then the first object in the image to be processed can be hidden based on a preset hiding degree parameter to obtain the target image. In this way, the first object is no longer presented in the target image, so as to extract the second object from the target image, avoid the interference of the first object on the extraction of the second object, and improve the accuracy of extracting the second object.

[0067] Step 103, based on the pixel value of the pixel point of the target image, a first value corresponding to the pixel point is determined, and the target image is subjected to first segmentation processing based on the first value to determine the second object.

[0068] In the embodiments of the present application, the first value corresponding to the pixel point of the target image can be obtained by performing operation on the pixel points of the target image based on the difference between the pixel values of the pixel points of different regions in the target image. In this way, the detection of the second object can be realized based on the difference between the pixel values of the pixel points of different regions in the target image, and the accuracy of detecting the second object is improved.

[0069] The pixel values of the pixels in the region where the second object exists and the region where the second object does not exist determined by detection are processed differently, and a first value corresponding to each pixel in the target image is obtained. In this way, the target image can be threshold segmented based on the first value corresponding to each pixel in the target image determined, to determine the second object, thereby improving the accuracy of determining the second object from the target image.

[0070] In a possible implementation, the first object can be a splash with a relatively high gray value, and the second object can be a splash with a relatively low gray value.

[0071] Step 104, determining a target object based on the first object and the second object.

[0072] The first object and the second object are of the same type.

[0073] In the embodiments of the present application, the first object and the second object can be synthesized, and the synthesized object can be processed to obtain the target object. In this way, the first object and the second object are considered to determine the target object, thereby improving the completeness and accuracy of the determined target object.

[0074] The image processing method provided by the embodiments of the present application includes the following steps: acquiring a to-be-processed image; performing feature extraction on the to-be-processed image to obtain a first object, and performing hiding processing on the first object in the to-be-processed image to obtain a target image; determining a first value corresponding to a pixel in the target image based on a pixel value of the pixel, and performing first segmentation processing on the target image based on the first value to determine a second object; determining a target object based on the first object and the second object; and the first object and the second object are of the same type. In this way, the first object determined in the to-be-processed image can be hidden to obtain the target image, and then the first segmentation processing is performed on the target image based on the first value corresponding to the pixel in the target image to obtain the second object, and the target object is determined based on the first object and the second object, thereby realizing the automatic extraction of the target object from the to-be-processed image, improving the efficiency of extracting the target object, and solving the problem of complicated operation and low efficiency in the related art of extracting the target object (splash) from the image.

[0075] Based on the foregoing embodiments, the embodiments of the present application provide an image processing method, which refers to FIG. 2. Figure 2 The method includes the following steps:

[0076] Step 201, an image processing device acquires a to-be-processed image.

[0077] Step 202, the image processing device performs second segmentation processing on the to-be-processed image to determine a first sub-object.

[0078] The second segmentation processing can be specifically a binarization processing; and the first segmentation processing and the second segmentation processing are different.

[0079] In the embodiments of the present application, a global threshold algorithm or a local threshold algorithm can be used to perform binarization processing on the to-be-processed image to obtain the first image, and the connected domain in the first image is taken as a position region of the first sub-object.

[0080] The global threshold algorithm includes an OTSU algorithm (maximum inter-class variance method); and the local threshold algorithm includes a Sauvola algorithm.

[0081] In a feasible implementation manner, the OTSU algorithm can be used to perform binarization processing on the to-be-processed image collected in the process of laser processing metal to obtain the first image.

[0082] In step 203, the image processing device performs enhancement processing on the to-be-processed image, and performs second segmentation processing on the to-be-processed image after the enhancement processing to determine a second sub-object.

[0083] In the embodiments of the present application, an image gradient extraction algorithm can be used to perform enhancement processing on the to-be-processed image to obtain the to-be-processed image after the enhancement processing, and the second segmentation processing is performed on the to-be-processed image after the enhancement processing to obtain a second image, and the connected domain in the second image is taken as a position region of a second sub-object; and the second sub-object is an object corresponding to the connected domain in the second image. The first sub-object and the second sub-object are obtained by performing different processing on the to-be-processed image, which realizes different degrees of extraction of partial features of the target object from the to-be-processed image, so as to determine the target object based on the partial features of the target object subsequently.

[0084] It should be noted that the process of obtaining the second image by performing the second segmentation processing on the to-be-processed image after the enhancement processing is similar to the process of obtaining the first image by performing the second segmentation processing on the to-be-processed image, and the specific implementation process of obtaining the first image by performing the second segmentation processing on the to-be-processed image can be referred to, and the embodiments of the present application will not be described here. Figure 2 It is shown that step 202 is executed before step 203, of course, step 202 can also be executed after step 203, and step 202 and step 203 can also be executed simultaneously, and the order between step 202 and step 203 is not limited in the embodiments of the present application.

[0085] In step 204, the image processing device superimposes the first sub-object and the second sub-object to obtain a first object.

[0086] In the embodiment of the present application, the first sub-object and the second sub-object can be superimposed, and the superimposed object can be taken as the first object.

[0087] Specifically, the first image and the second image can be superimposed to realize superimposition of the first sub-object and the second sub-object, and a connected domain can be determined from the superimposed image, and the object corresponding to the connected domain in the superimposed image can be taken as the first object. Of course, the first sub-object cut from the first image and the second sub-object cut from the second image can also be superimposed to obtain the first object.

[0088] It should be noted that in visual presentation, the visual effect of the first sub-object in the to-be-processed image is better than that of the second sub-object in the to-be-processed image. The size of the first sub-object can also be greater than that of the second sub-object. In this way, by processing the to-be-processed image differently, the partial features of the target object are extracted, and the accuracy of the subsequent determination of the target object is further improved.

[0089] Step 205, the image processing device performs hiding processing on the first object in the to-be-processed image to obtain a target image.

[0090] Step 206, the image processing device performs region division on the target image based on a target size parameter to obtain a plurality of first regions.

[0091] The target size parameter can be pre-set or determined according to the size of the to-be-processed image.

[0092] In the embodiment of the present application, the target image can be divided into a plurality of small first regions based on the target size parameter, so as to subsequently detect each first region. When it is determined that the first region has a second object, the pixel value of the pixel point of the first region is subjected to first processing to determine a first value corresponding to the pixel point of the first region. When it is determined that the first region has no second object, the pixel value of the pixel point of the first region is subjected to second processing to determine a first value corresponding to the pixel point of the first region. In this way, the target image is divided based on the target size parameter, so as to subsequently process each first region obtained by division respectively, thereby improving the accuracy of detecting the second object.

[0093] Step 207, the image processing device determines, for each first region, a plurality of second regions related to the position of the first region.

[0094] In the embodiments of the present application, for the Nth first region, a plurality of second regions related to the position of the Nth first region are determined from the plurality of first regions obtained by the division. In this way, the plurality of second regions related to the position of each first region can be determined, so that the first region is detected based on the difference in pixel value between the first region and the plurality of second regions related to the position of the first region, and it is determined whether the second object exists in the first region. Wherein, N is a positive integer.

[0095] It should be noted that step 207 can be implemented by steps A1-A2:

[0096] Step A1, obtaining the position information of the first region in the target image.

[0097] In the embodiments of the present application, the position information of the first region in the target image can be obtained by analyzing the target image, or can be sent to the image processing device by other devices.

[0098] Step A2, determining a plurality of second regions related to the position of the first region based on the position information and the target distance.

[0099] In the embodiments of the present application, for the Nth first region, the first region within the target distance range from the Nth first region can be determined as the second region from the plurality of first regions of the target image based on the target distance and the position information of the Nth first region in the target image. Wherein, the target distance is pre-set, or can be determined according to the size of the image to be processed.

[0100] Step 208, the image processing device determines the corresponding first value of the first region based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the plurality of second regions.

[0101] In the embodiments of the present application, for each first region, the pixel value difference between the first region and the plurality of second regions can be determined based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the plurality of second regions, and the pixel value of the pixel point of the first region is processed based on the pixel value difference between the first region and the plurality of second regions, to obtain the corresponding first value of the pixel point of the first region.

[0102] It should be noted that step 208 can be implemented by steps B1-B3:

[0103] Step B1, the image processing device performs operation on the pixel value of the pixel point of each second region in the plurality of second regions to obtain the corresponding second value of each second region.

[0104] In the embodiment of the present application, the gray scale values of the plurality of pixel points of each second region can be calculated to obtain the second value corresponding to each second region; wherein the pixel values of the pixel points of the plurality of second regions include the gray scale values. The gray scale values of the plurality of pixel points of each second region can be the gray scale values of all the pixel points of each second region, or the gray scale values of part of the pixel points of each second region.

[0105] In a feasible implementation, as shown in FIG. 3(a), a partial schematic diagram of a target image is shown, and FIG. 3(b) is a schematic diagram of a first region and a second region; wherein, as shown in FIG. 3(b), the plurality of second regions are represented by 1-8, and the first region is represented by 0. The mean value of the gray scale values of all the pixel points of each region in the regions 1-8 can be calculated to obtain the second value corresponding to each region in the regions 1-8.

[0106] Step B2, the image processing device screens the pixel values of the pixel points of the first region to obtain a target pixel value.

[0107] The pixel value of the pixel point of the first region can be determined from the pixel values of the pixel points of the target image based on the position of the pixel point of the first region; wherein the pixel value of the pixel point of the first region can be the pixel value of all the pixel points in the first region, or the pixel value of part of the pixel points in the first region. The target pixel value can be one or a plurality of values.

[0108] In the embodiment of the present application, the pixel value greater than the target pixel threshold value can be determined from the pixel values of the pixel points of the first region to obtain the target pixel value; of course, the maximum pixel value can also be determined from the pixel values of the pixel points of the first region to obtain the target pixel value; further, the pixel values of the pixel points of the first region can be sorted in descending order, and the first preset number of pixel values can be determined from the sorted pixel values to obtain the target pixel value.

[0109] In a feasible implementation, the maximum pixel value can be determined from the pixel values of the pixel points of the first region, and the maximum pixel value is taken as the target pixel value.

[0110] Step B3, based on the plurality of second values and the target pixel value, the pixel value of each pixel point of the first region is processed to obtain the first value corresponding to each pixel point of the first region.

[0111] In the embodiment of the present application, the pixel value of each pixel point of the first region can be processed based on the difference between the target pixel value and each second value to obtain the first value corresponding to each pixel point of the first region.

[0112] It should be noted that step B3 can be implemented by steps b1-b2:

[0113] Step b1, in the case that the target pixel value is greater than the plurality of second values, increasing the pixel value of each pixel point in the first region to obtain the first value corresponding to each pixel point in the first region.

[0114] In the embodiments of the present application, the target pixel value can be compared with each second value to obtain a comparison result; wherein in the case that the comparison result represents that the target pixel value is greater than each second value, the pixel value of each pixel point in the first region is increased to obtain the first value corresponding to each pixel point in the first region. In this way, by increasing the pixel value of each pixel point in the first region, the first value corresponding to each pixel point in the first region is obtained, so as to enhance the first region in which the second object exists in the target image, so as to improve the accuracy of extracting the second object in the subsequent extraction of the second object.

[0115] In a feasible implementation manner, the first preset value can be multiplied by the pixel value of each pixel point in the first region to obtain the first value corresponding to each pixel point in the first region. Wherein the pixel value of each pixel point in the first region is a gray value; the first preset value is a value greater than 1.

[0116] Step b2, in the case that the target pixel value is less than or equal to the plurality of second values, reducing the pixel value of each pixel point in the first region to obtain the first value corresponding to each pixel point in the first region.

[0117] It should be noted that in the case that the target pixel value is less than any second value, it indicates that the first region is a region in which the second object does not exist, and then the pixel value of each pixel point in the first region can be reduced to obtain the first value corresponding to each pixel point in the first region, so as to realize the suppression of the region in which the second object does not exist (i.e. the background region).

[0118] In a feasible implementation manner, the second preset value can be multiplied by the pixel value of each pixel point in the first region. Wherein the second preset value is a value greater than 0 and less than 1.

[0119] Fig. 4(a) is an effect diagram of the first region without processing the gray value of the pixel point of the first region, in which the direction perpendicular to the horizontal plane is the Z-axis direction, and the value of the Z-axis represents the gray value; Fig. 4(b) is an effect diagram of the first region after processing the gray value of the pixel point of the first region, in which the direction perpendicular to the horizontal plane is the Z-axis direction, and the value of the Z-axis represents the first value. It can be obviously seen that the second object existing in the processed first region is more obvious, so as to improve the accuracy of extracting the second object in the subsequent extraction of the second object.

[0120] In step 209, the image processing device performs threshold segmentation processing on the target image by using a target segmentation manner to determine a second object.

[0121] The target segmentation manner can be pre-set or determined according to the first values corresponding to the pixel points of the target image.

[0122] In the embodiments of the present application, the target threshold segmentation manner can be used to perform threshold segmentation processing on the target image based on the first values to obtain a third image, and the connected domain in the third image is taken as a region where the second object is located; the second object is an object corresponding to the connected domain in the third image.

[0123] In a feasible implementation manner, when the first value corresponding to each pixel point in the target image is less than or equal to a third preset value, the automatic threshold segmentation manner can be used to perform threshold segmentation processing on the target image based on the first values to obtain the third image; when there is a pixel point in the target image whose first value is greater than the third preset value, the manual threshold segmentation manner can be used to perform threshold segmentation processing on the target image based on the first values to obtain the third image. In a feasible implementation manner, the third preset value is 255.

[0124] The global threshold algorithm includes an OTSU algorithm, and the local threshold algorithm includes a Sauvola algorithm. In this way, the threshold segmentation processing manner can be flexibly selected to perform threshold segmentation processing on the target image based on the first values corresponding to the pixel points of the target image, and the flexibility of threshold segmentation processing on the target image is improved.

[0125] In step 210, the image processing device superimposes the first object and the second object to obtain a superimposed object.

[0126] In the embodiments of the present application, the first object and the second object can be superimposed to obtain a superimposed object; in this way, the target object can be determined through the superimposed object, and the integrity and accuracy of the determined target object are improved.

[0127] It should be noted that the process of superimposing the first object and the second object in step 210 to obtain the superimposed object is the same as the process of superimposing the first sub-object and the second sub-object in step 204 to obtain the first object, and the process of superimposing the first sub-object and the second sub-object in step 204 to obtain the first object can be referred to for details, which will not be described herein again.

[0128] In step 211, the image processing device performs third segmentation processing on the superimposed object to obtain a target object.

[0129] The third segmentation processing is specifically a binaryzation processing; and the third segmentation processing and the second segmentation processing adopt different algorithms.

[0130] In the embodiments of the present application, the algorithm used for the second segmentation processing on the to-be-processed image and the second segmentation processing on the to-be-processed image after the enhancement processing is a global threshold algorithm, and the algorithm used for the third segmentation processing on the superimposed object is a local threshold algorithm.

[0131] It should be noted that the superimposed object can be subjected to local threshold processing by using the local threshold algorithm, so as to realize the clipping of the superimposed object and obtain the target object. In this way, the redundancy existing after the superimposition of the first object and the second object is removed, the accuracy of determining the target object is improved, and the existence of the redundancy is avoided to reduce the accuracy of determining the target object.

[0132] Based on the foregoing embodiments, in other embodiments of the present application, the image processing method can further include the following steps:

[0133] In step 212, the image processing device determines the number of target objects.

[0134] In the embodiments of the present application, the target objects can be counted to obtain the number of target objects.

[0135] In step 213, the image processing device determines the area of each target object.

[0136] In the embodiments of the present application, for each target object, the area of each target object can be calculated; in this way, subsequent analysis can be performed according to the number of target objects and the area of the target objects.

[0137] In a feasible manner, the target object refers to the spatter generated in the process of laser processing metal, and the processing quality can be evaluated according to the determined number and area of the spatter. In addition, the process parameters of laser processing can be adjusted according to the determined number and area of the spatter to improve the processing quality.

[0138] The following application scenarios are combined to explain and describe the image processing method provided by the embodiments of the present application in detail.

[0139] In the embodiments of the present application, the to-be-processed image can be collected in the process of laser processing metal; in the to-be-processed image, in addition to the spatter, there are also molten pools, plumes, etc. Through the image processing method provided by the present application, the spatter can be automatically extracted from the to-be-processed image, and the accuracy of extracting the spatter is guaranteed.

[0140] As Figure 5As shown, the image to be processed (also called the splash image) can be acquired, and the OTSU algorithm is used to perform threshold segmentation on the image to be processed, obtaining the corresponding binarized image (i.e., the first image). Simultaneously, the Sobel operator is used to enhance the image to be processed, and the OTSU algorithm is used to perform threshold segmentation on the enhanced image, obtaining the corresponding binarized image (i.e., the second image). The binarized image corresponding to the image to be processed and the binarized image corresponding to the gradient image are superimposed to obtain the splashes with higher grayscale values ​​in the image to be processed. Then, the splashes with higher grayscale values ​​in the image to be processed are masked. After masking, splashes with lower grayscale values ​​still exist in the image to be processed, which can be addressed using a local contrast algorithm. The Measure (LCM) process the pixel value of each pixel in the masked image to obtain the first value corresponding to each pixel in the masked image. Based on the first value corresponding to each pixel in the masked image, the masked image is manually thresholded to obtain weak splashes. Then, the splashes with lower gray values ​​and the splashes with higher gray values ​​are superimposed, and local thresholding is performed on the superimposed splashes to remove the redundant parts in the superimposed splashes, so as to obtain each independent splash.

[0141] The LCM algorithm is an algorithm applied to infrared small target detection. It targets targets in images with low signal-to-noise ratios that occupy a small number of image pixels and have gray values ​​slightly higher than the background noise. Its core idea is to enhance small targets that are difficult to detect in the image while suppressing background areas. Thus, by using the LCM algorithm to process the masked image, it enhances the gray values ​​of small splashes with low gray values ​​and suppresses the background, thereby extracting small splashes with low gray values.

[0142] like Figure 6 As shown, (1. Splash Image) to (4. Binarized Image) is the threshold segmentation of the image to be processed using the OTSU algorithm to obtain the corresponding binarized image; the splash image is a three-channel color image. (2. Gradient Image) to (5. Binarization) is the binarization of the enhanced splash image to obtain the corresponding binarized image of the gradient image; (3. Micro Splash Image) to (6. LCM Algorithm) is the determination of micro splashes from the target image; (7. (4) + (5) + (6)) refers to superimposing splashes with higher gray values ​​and splashes with lower gray values; (8. Local Binarization) refers to the image obtained after superimposing splashes with higher gray values ​​and splashes with lower gray values ​​and performing local binarization processing (i.e., local threshold segmentation).

[0143] It should be noted that there may be redundancies after superimposing the splashes with low gray values and the splashes with high gray values, and these redundancies will reduce the accuracy of extracting the splashes. In order to more accurately locate the splashes and extract the splashes, it is extremely necessary to accurately cut all the superimposed splashes. Therefore, a local threshold segmentation method is used to cut the superimposed splashes and finally extract all the splashes. The independent connected domains corresponding to the splashes are counted, and the areas of the independent connected domains are counted, so as to obtain the areas and quantities of the splashes. The areas and quantities of the splashes can be referred to as splash information.

[0144] Table 1 is the comparison and verification results of extracting splashes under different process parameters of splash processing metal by using the image processing method provided in the embodiments of the present application and by using human experience to extract splashes.

[0145]

[0146] Table 1

[0147] Figure 6 In each image sequence diagram, the horizontal coordinate represents the label of the image to be processed. Each image sequence diagram corresponds to 21 images obtained under different processing parameters. Each image sequence diagram represents the number of splashes extracted by using the image processing method of the present application and the number of splashes extracted by using human experience. It can be obviously seen that the accuracy of extracting splashes by using the image post-processing method provided in the present application is close to the effect of extracting splashes by using human experience. That is, the image processing method provided in the embodiments of the present application realizes automatic extraction of splashes from images and maintains the accuracy of extracting splashes.

[0148] It should be noted that the same steps and the same content in the embodiments of the present application can refer to the description in other embodiments, and will not be described here.

[0149] The image processing method provided in the embodiments of the present application can perform hiding processing on the first object determined in the image to be processed to obtain a target image. Then, according to the first value corresponding to the pixel point of the determined target image, the target image is subjected to first segmentation processing to obtain a second object. The target object is determined according to the first object and the second object. The target object is automatically extracted from the image to be processed, and the efficiency of extracting the target object is improved. Instead of using human experience to analyze the collected image to be processed to extract the target object, the problem that the scheme for extracting the target object (splash) from the image in the related art is complicated and inefficient is solved.

[0150] Based on the foregoing embodiments, the embodiments of the present application provide an image processing device, which can be applied to Figures 1-2 In the image processing method provided in the corresponding embodiments, the image processing method is used forFigure 7 As shown in the figure, the image processing device 3 can include a processor 31, a memory 32 and a communication bus 33;

[0151] The communication bus 33 is used to realize the communication connection between the processor 31 and the memory 32;

[0152] The processor 31 is used to execute the image processing program in the memory 32 to realize the following steps:

[0153] Obtain the image to be processed;

[0154] Feature extraction is performed on the image to be processed to obtain a first object, and the first object in the image to be processed is hidden to obtain a target image;

[0155] Based on the pixel value of the pixel point of the target image, the first value corresponding to the pixel point is determined, and the target image is subjected to first segmentation processing based on the first value to determine a second object;

[0156] Based on the first object and the second object, a target object is determined; wherein the types of the first object and the second object are the same.

[0157] In other embodiments of the present application, the processor 31 is used to execute the image processing program in the memory 32 to perform feature extraction on the image to be processed to obtain a first object, to realize the following steps:

[0158] The image to be processed is subjected to second segmentation processing to determine a first sub-object;

[0159] The image to be processed is subjected to enhancement processing, and the image to be processed after the enhancement processing is subjected to second segmentation processing to determine a second sub-object;

[0160] The first sub-object and the second sub-object are superimposed to obtain the first object.

[0161] In other embodiments of the present application, the processor 31 is used to execute the image processing program in the memory 32 to determine the first value corresponding to the pixel point based on the pixel value of the pixel point of the target image, to realize the following steps:

[0162] Based on the target size parameter, the target image is subjected to region division to obtain a plurality of first regions;

[0163] For each first region, a plurality of second regions related to the position of the first region are determined;

[0164] Based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the plurality of second regions, the first value corresponding to the pixel point of the first region is determined.

[0165] In other embodiments of the present application, the processor 31 is configured to execute the image processing program in the memory 32 to determine a plurality of second regions related to the position of the first region based on the pixel values of the pixel points of the first region and the pixel values of the pixel points of the plurality of second regions, to obtain a first value corresponding to each pixel point of the first region, to implement the following steps:

[0166] Obtaining position information of the first region in the target image;

[0167] Determining a plurality of second regions related to the position of the first region based on the position information and the target distance.

[0168] In other embodiments of the present application, the processor 31 is configured to execute the image processing program in the memory 32 to determine a plurality of second regions related to the position of the first region based on the pixel values of the pixel points of the first region and the pixel values of the pixel points of the plurality of second regions, to obtain a first value corresponding to each pixel point of the first region, to implement the following steps:

[0169] Calculating the pixel values of the pixel points of each second region in the plurality of second regions to obtain a second value corresponding to each second region;

[0170] Selecting the pixel values of the pixel points of the first region to obtain a target pixel value;

[0171] Processing the pixel values of each pixel point of the first region based on the plurality of second values and the target pixel value to obtain a first value corresponding to each pixel point of the first region.

[0172] In other embodiments of the present application, the processor 31 is configured to execute the image processing program in the memory 32 to determine a plurality of second regions related to the position of the first region based on the pixel values of the pixel points of the first region and the pixel values of the pixel points of the plurality of second regions, to obtain a first value corresponding to each pixel point of the first region, to implement the following steps:

[0173] In the case where the target pixel value is greater than the plurality of second values, increasing the pixel values of each pixel point of the first region to obtain a first value corresponding to each pixel point of the first region;

[0174] In the case where the target pixel value is less than or equal to the plurality of second values, decreasing the pixel values of each pixel point of the first region to obtain a first value corresponding to each pixel point of the first region.

[0175] In other embodiments of the present application, the processor 31 is configured to execute the image processing program in the memory 32 to perform first segmentation processing on the target image based on the first value to determine a second object, to implement the following steps:

[0176] Performing threshold segmentation processing on the target image in a target segmentation manner to determine a second object.

[0177] In other embodiments of the present application, the processor 31 is configured to execute the image processing program in the memory 32 based on the first object and the second object, determine the target object, to implement the following steps:

[0178] superimpose the first object and the second object to obtain a superimposed object;

[0179] perform a third segmentation processing on the superimposed object to obtain the target object.

[0180] It should be noted that the specific implementation process of the steps performed by the processor in this embodiment can refer to Figures 1-2 the implementation process in the image processing method provided by the corresponding embodiments, which will not be described here.

[0181] The image processing device provided by the embodiments of the present application can perform hiding processing on the first object determined in the to-be-processed image to obtain a target image, and then perform first segmentation processing on the target image according to the first value corresponding to the pixel point of the determined target image, to obtain a second object, and determine the target object based on the first object and the second object. The target object is extracted from the to-be-processed image automatically, which improves the efficiency of extracting the target object, instead of analyzing the collected to-be-processed image to extract the target object by human experience, and solves the problem of complicated operation and low efficiency of the scheme for extracting the target object (splashing) in the related art.

[0182] Based on the foregoing embodiments, the embodiments of the present application provide an image processing device, which can be applied to Figures 1-2 In the image processing method provided by the corresponding embodiments, refer to Figure 8 As shown in the figure, the image processing device 4 includes:

[0183] The acquisition unit 41 is configured to acquire a to-be-processed image.

[0184] The processing unit 42 is configured to perform feature extraction on the to-be-processed image to obtain a first object, and perform hiding processing on the first object in the to-be-processed image to obtain a target image.

[0185] The processing unit 42 is further configured to determine a first value corresponding to a pixel point based on the pixel value of the pixel point of the target image, and perform first segmentation processing on the target image based on the first value, to determine a second object.

[0186] The processing unit 42 is further configured to determine a target object based on the first object and the second object; wherein the types of the first object and the second object are the same.

[0187] In the embodiments of the present application, the processing unit 42 is further configured to perform the following steps:

[0188] performing a second segmentation processing on the to-be-processed image to determine a first sub-object;

[0189] performing an enhancement processing on the to-be-processed image, and performing a second segmentation processing on the to-be-processed image after the enhancement processing to determine a second sub-object;

[0190] superimposing the first sub-object and the second sub-object to obtain a first object.

[0191] In the embodiments of the present application, the processing unit 42 is further configured to perform the following steps:

[0192] performing region division on the target image based on the target size parameter to obtain a plurality of first regions;

[0193] for each first region, determining a plurality of second regions related to the position of the first region;

[0194] determining a first value corresponding to the pixel point of the first region based on the pixel value of the pixel point of the first region and the pixel value of the pixel point of the plurality of second regions.

[0195] In the embodiments of the present application, the processing unit 42 is further configured to perform the following steps:

[0196] obtaining position information of the first region in the target image;

[0197] determining a plurality of second regions related to the position of the first region based on the position information and the target distance.

[0198] In the embodiments of the present application, the processing unit 42 is further configured to perform the following steps:

[0199] performing operation on the pixel value of the pixel point of each second region in the plurality of second regions to obtain a second value corresponding to each second region;

[0200] performing screening on the pixel value of the pixel point of the first region to obtain a target pixel value;

[0201] performing processing on the pixel value of each pixel point of the first region based on the plurality of second values and the target pixel value to obtain a first value corresponding to each pixel point of the first region.

[0202] In the embodiments of the present application, the processing unit 42 is further configured to perform the following steps:

[0203] in the case where the target pixel value is greater than the plurality of second values, increasing the pixel value of each pixel point of the first region to obtain the first value corresponding to each pixel point of the first region;

[0204] In a case that the target pixel value is less than or equal to the plurality of second values, the pixel value of each pixel point in the first region is reduced to obtain the first value corresponding to each pixel point in the first region.

[0205] In the embodiment of the present application, the processing unit 42 is further configured to perform the following steps:

[0206] The target image is subjected to threshold segmentation processing in a target segmentation manner to determine the second object.

[0207] In the embodiment of the present application, the processing unit 42 is further configured to perform the following steps:

[0208] The first object and the second object are superimposed.

[0209] The superimposed object is subjected to third segmentation processing to obtain the target object.

[0210] It should be noted that the specific implementation process of the steps performed by each unit in the embodiment of the present application can refer to the implementation process of the image processing method provided by the corresponding embodiment, which will not be described here. Figures 1-2 The specific implementation process of the steps performed by each unit in the embodiment of the present application can refer to the implementation process of the image processing method provided by the corresponding embodiment, which will not be described here.

[0211] The image processing apparatus provided by the embodiment of the present application can hide the first object determined in the to-be-processed image to obtain a target image, and then perform first segmentation processing on the target image according to the first value corresponding to the pixel point of the determined target image to obtain a second object, and determine a target object according to the first object and the second object, thereby realizing automatic extraction of the target object from the to-be-processed image and improving the efficiency of extracting the target object, instead of manually analyzing the collected to-be-processed image to extract the target object, thereby solving the problem of complicated operation and low efficiency of the scheme for extracting the target object (splashing) in the related art.

[0212] Based on the foregoing embodiment, the embodiment of the present application provides a computer readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement Figures 1-2 the steps of the image processing method provided by the corresponding embodiment.

[0213] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer usable program codes.

[0214] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0215] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0216] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0217] The above merely provides a preferred embodiment of the present application, and is not intended to limit the protection scope of the present application.

Claims

1. An image processing method, characterized by, The method comprises: acquiring a to-be-processed image; performing feature extraction on the to-be-processed image to obtain a first object, and performing hiding processing on the first object in the to-be-processed image to obtain a target image; based on pixel values of pixel points of the target image, determining first values corresponding to the pixel points, and based on the first values, performing first segmentation processing on the target image to determine a second object; based on the first object and the second object, determining a target object; wherein the first object and the second object are of the same type; wherein, based on the pixel values of the pixel points of the target image, determining the first values corresponding to the pixel points comprises: based on a target size parameter, performing region division on the target image to obtain a plurality of first regions; for each first region, determining a plurality of second regions related to the position of the first region; based on the pixel values of the pixel points of the first region and the pixel values of the pixel points of the plurality of second regions, determining the first values corresponding to the pixel points of the first region; wherein, determining the plurality of second regions related to the position of the first region comprises: acquiring position information of the first region in the target image; based on the position information and a target distance, determining the plurality of second regions related to the position of the first region; wherein, based on the pixel values of the pixel points of the first region and the pixel values of the pixel points of the plurality of second regions, determining the first values corresponding to the pixel points of the first region comprises: performing operations on the pixel values of the pixel points of each second region in the plurality of second regions to obtain a second value corresponding to each second region; performing screening on the pixel values of the pixel points of the first region to obtain a target pixel value; based on the plurality of second values and the target pixel value, processing the pixel values of each pixel point of the first region to obtain the first values corresponding to each pixel point of the first region.

2. The method of claim 1, wherein, The feature extraction on the to-be-processed image to obtain the first object comprises: performing second segmentation processing on the to-be-processed image to determine a first sub-object; performing enhancement processing on the to-be-processed image, and performing second segmentation processing on the to-be-processed image after the enhancement processing to determine a second sub-object; superimposing the first sub-object and the second sub-object to obtain the first object.

3. The method of claim 1, wherein, The processing of the pixel values of each pixel point of the first region based on the plurality of second values and the target pixel value to obtain the first values corresponding to each pixel point of the first region comprises: in the case where the target pixel value is greater than the plurality of second values, increasing the pixel values of each pixel point of the first region to obtain the first values corresponding to each pixel point of the first region; in the case where the target pixel value is less than or equal to the plurality of second values, decreasing the pixel values of each pixel point of the first region to obtain the first values corresponding to each pixel point of the first region.

4. The method of claim 1, wherein, The first segmentation processing on the target image based on the first values to determine the second object comprises: The target image is subjected to threshold segmentation processing in a target segmentation manner to determine the second object.

5. The method of claim 1, wherein, The target object is determined based on the first object and the second object, including: The first object and the second object are superimposed to obtain a superimposed object; The superimposed object is subjected to third segmentation processing to obtain the target object.

6. An image processing apparatus characterized by comprising: The device includes a processor, a memory and a communication bus; The communication bus is configured to realize communication connection between the processor and the memory; The processor is configured to execute an image processing program in the memory to realize the steps of the image processing method in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores one or more programs executable by one or more processors to realize the steps of the image processing method in any one of claims 1-5.