Image processing method, device, equipment and storage medium

Through image processing methods, including longitudinal projection, fitting and derivative operations, the target edge data of the lithium battery coating area is screened out, which solves the problems of incomplete extraction of the coating area and large time overhead in lithium battery detection, and achieves high efficiency, Accurate coating area extraction.

CN117197168BActive Publication Date: 2024-11-05TIMACO (BEIJING) IND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

Smart Images

  • Figure CN117197168B_ABST
    Figure CN117197168B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide an image processing method, apparatus, device and storage medium, wherein the image processing method includes: determining an initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data. By determining the initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data, the amount of data is reduced, the time cost is reduced, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of data processing technology, and in particular, to image processing methods. Background Art

[0002] When using cameras to measure the size and detect defects of lithium batteries, the first step is to use foreground extraction to extract the core coating area of ​​the lithium battery. However, the grayscale of lithium battery imaging varies greatly. Directly using the grayscale value of the image to distinguish is prone to coating extraction anomalies. For example, the coating area is not fully extracted. Or the background area is extracted as the coating area. Lithium battery detection requires high accuracy and fast speed, so the image data volume is large, and the grayscale foreground extraction method is time-consuming. Therefore, a better solution is urgently needed. Summary of the invention

[0003] In view of this, the embodiments of this specification provide an image processing method. One or more embodiments of this specification also relate to an image processing apparatus, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, there is provided an image processing method, including:

[0005] Determine an initial image, and determine an image to be processed corresponding to the initial image;

[0006] Analyze the image to be processed and determine the initial edge data of the image to be processed;

[0007] Screening based on initial edge data to determine target edge data;

[0008] A target image is determined based on the target edge data.

[0009] In a possible implementation, determining an initial image and determining an image to be processed corresponding to the initial image includes:

[0010] An image range parameter is determined, and an image to be processed corresponding to the initial image is determined based on the image range parameter and the initial image.

[0011] In a possible implementation, analyzing the image to be processed to determine initial edge data of the image to be processed includes:

[0012] Perform longitudinal projection on the image to be processed to determine the projected image;

[0013] Determine the average gray value of each column in the projection image to obtain a first array;

[0014] Fitting the first array to obtain a continuous function;

[0015] determining a second array based on the continuous function;

[0016] Initial edge data of the image to be processed is determined based on the second array.

[0017] In a possible implementation, determining the second array based on the continuous function includes:

[0018] Perform second-order derivative operations on continuous functions to obtain first derivative data;

[0019] A target point is determined from the first derivative data based on the target value to obtain a second array.

[0020] In a possible implementation, screening is performed based on the initial edge data to determine the target edge data, including:

[0021] Perform a first-order derivative operation on the continuous function to obtain the second derivative data;

[0022] determining a third array based on the second array and the second derivative data;

[0023] The third array is screened based on preset rules to determine target edge data.

[0024] In a possible implementation, screening the third array based on a preset rule to determine the target edge data includes:

[0025] Compare the third array with the judgment threshold to determine the fourth array;

[0026] Obtaining a grayscale value between two adjacent points in the fourth array, and determining a fifth array based on a preset grayscale range and grayscale value;

[0027] Obtaining the distance value between two adjacent points in the fifth array, and determining the sixth array based on the preset distance range and the distance value;

[0028] Target edge data is determined based on the sixth array.

[0029] In a possible implementation manner, determining the target edge data based on the sixth array includes:

[0030] Obtaining a grayscale variance between two adjacent points in the sixth array, and determining a first target point and a second target point based on the grayscale variance;

[0031] Object edge data is determined based on the first object point and the second object point.

[0032] According to a second aspect of the embodiments of this specification, there is provided an image processing apparatus, including:

[0033] An image determination module is configured to determine an initial image and an image to be processed corresponding to the initial image;

[0034] An edge analysis module is configured to analyze the image to be processed and determine initial edge data of the image to be processed;

[0035] An edge screening module is configured to screen based on the initial edge data to determine target edge data;

[0036] The edge determination module is configured to determine the target image based on the target edge data.

[0037] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0038] Memory and processor;

[0039] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned image processing method are implemented.

[0040] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned image processing method are implemented.

[0041] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image processing method.

[0042] The embodiments of this specification provide an image processing method, apparatus, device and storage medium, wherein the image processing method includes: determining an initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data. By determining the initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data, the amount of data is reduced, the time cost is reduced, and the efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a scene schematic diagram of an image processing method provided by an embodiment of this specification;

[0044] Figure 2 is a flow chart of an image processing method provided by an embodiment of this specification;

[0045] Figure 3 is a schematic diagram of an image to be processed in an image processing method provided by an embodiment of this specification;

[0046] Figure 4 is a first array schematic diagram of an image processing method provided by an embodiment of this specification;

[0047] Figure 5 is a second array schematic diagram of an image processing method provided by an embodiment of this specification;

[0048] Figure 6 is a fourth array schematic diagram of an image processing method provided by an embodiment of this specification;

[0049] Figure 7 is a schematic diagram of a target image of an image processing method provided by an embodiment of this specification;

[0050] Figure 8 is a structural schematic diagram of an image processing device provided by an embodiment of this specification;

[0051] Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0052] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0053] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0054] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0055] In this specification, an image processing method is provided. This specification also relates to an image processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0056] See also Figure 1 , Figure 1 A schematic diagram of a scene of an image processing method provided according to an embodiment of the present specification is shown.

[0057] exist Figure 1 In the application scenario, the computing device 101 may determine an initial image and determine an image to be processed 102 corresponding to the initial image. Then, the computing device 101 may analyze the image to be processed 102 and determine initial edge data 103 of the image to be processed 102. Afterwards, the computing device 101 may perform screening based on the initial edge data 103 and determine target edge data 104. Finally, the computing device 101 may determine a target image based on the target edge data 104, as shown by reference numeral 105.

[0058] It should be noted that the computing device 101 can be hardware or software. When the computing device 101 is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the computing device 101 is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0059] See also Figure 2 , Figure 2 A flowchart of an image processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0060] Step 201: determine an initial image, and determine an image to be processed corresponding to the initial image.

[0061] In a possible implementation, determining an initial image and determining an image to be processed corresponding to the initial image includes: determining an image range parameter, and determining the image to be processed corresponding to the initial image based on the image range parameter and the initial image.

[0062] In practical applications, see Figure 3 , generate the extraction area for coating foreground extraction according to the set effective area to reduce the interference of background.

[0063] Step 202: Analyze the image to be processed to determine initial edge data of the image to be processed.

[0064] In a possible implementation, the image to be processed is analyzed to determine the initial edge data of the image to be processed, including: longitudinally projecting the image to be processed to determine the projected image; determining the average grayscale value of each column in the projected image to obtain a first array; fitting the first array to obtain a continuous function; determining a second array based on the continuous function; and determining the initial edge data of the image to be processed based on the second array.

[0065] In practical applications, the image within the extraction range is projected vertically, and the average grayscale value of each column of the image within the extraction area is calculated. Combined into a one-dimensional discrete array: .like Figure 4 As shown. For a one-dimensional discrete array Use the least squares method to fit and get a continuous function For continuous functions Find the second order reciprocal . Select a part from it to form a one-dimensional array . See Figure 5 .

[0066] In a possible implementation, determining the second array based on the continuous function includes: performing a second-order derivative operation on the continuous function to obtain first derivative data; and determining a target point from the first derivative data based on a target value to obtain the second array.

[0067] Specifically, find all second-order inverses The points that are zero form a one-dimensional array . Represents The junction of all concave and convex functions in .

[0068] The embodiment of this specification uses the grayscale projection method to convert the two-dimensional image into a one-dimensional array, and then analyzes the one-dimensional array to avoid errors in coating area extraction caused by uneven coating grayscale. At the same time, the two-dimensional image is converted into a one-dimensional array, which reduces the amount of data and greatly reduces time overhead.

[0069] Step 203: Screening is performed based on the initial edge data to determine target edge data.

[0070] In one possible implementation, the target edge data is determined by screening based on the initial edge data, including: performing a first-order derivative operation on the continuous function to obtain second derivative data; determining a third array based on the second array and the second derivative data; and screening the third array based on preset rules to determine the target edge data.

[0071] Specifically, for continuous functions Find the first-order inverse ,Will Substituting the first-order inverse into the point , find the corresponding value and form a one-dimensional array . is the gradient value of the grayscale change corresponding to all suspected edges. Screen and determine the target edge data.

[0072] In one possible implementation, the third array is screened based on preset rules to determine target edge data, including: comparing the third array with a judgment threshold to determine a fourth array; obtaining a grayscale value between two adjacent points in the fourth array, and determining a fifth array based on a preset grayscale range and grayscale value; obtaining a distance value between two adjacent points in the fifth array, and determining a sixth array based on a preset distance range and distance value; and determining the target edge data based on the sixth array.

[0073] Specifically, the one-dimensional array The judgment threshold is set Compare and extract The absolute value is greater than points, forming a one-dimensional array , A suspected edge that meets the set gradient value. Figure 6 .

[0074] Further, traverse All points in Get the grayscale value between two points. If the grayscale value between two points does not meet the set grayscale range, it will be eliminated. The array after elimination is . Traverse All points in the array are obtained, and the distance between two points is obtained. If the distance between the bright spots does not meet the tolerance range of the set coating standard width, it is extracted. The array after elimination is .

[0075] In a possible implementation, determining the target edge data based on the sixth array includes: obtaining the grayscale variance between two adjacent points in the sixth array, determining the first target point and the second target point based on the grayscale variance; and determining the target edge data based on the first target point and the second target point.

[0076] Specifically, traverse All points in Get the grayscale variance between the two points, and get the two points with the smallest grayscale variance as the position of the coating boundary.

[0077] Step 204: Determine a target image based on the target edge data.

[0078] Specifically, the target image can be determined based on the position of the coating boundary. The extracted target image is the coating foreground area, such as Figure 7 shown.

[0079] The embodiments of this specification provide an image processing method, apparatus, device and storage medium, wherein the image processing method includes: determining an initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data. By determining the initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data, the amount of data is reduced, the time cost is reduced, and the efficiency is improved.

[0080] Corresponding to the above method embodiment, this specification also provides an image processing device embodiment, Figure 8 FIG. 2 shows a schematic diagram of the structure of an image processing device provided by an embodiment of the present specification. Figure 8 As shown, the device comprises:

[0081] The image determination module 801 is configured to determine an initial image and an image to be processed corresponding to the initial image;

[0082] The edge analysis module 802 is configured to analyze the image to be processed and determine the initial edge data of the image to be processed;

[0083] The edge screening module 803 is configured to screen based on the initial edge data to determine the target edge data;

[0084] The edge determination module 804 is configured to determine the target image based on the target edge data.

[0085] In a possible implementation, the image determination module 801 is further configured to: determine an image range parameter, and determine an image to be processed corresponding to the initial image based on the image range parameter and the initial image.

[0086] In a possible implementation, the edge analysis module 802 is further configured to: perform longitudinal projection on the image to be processed to determine the projected image; determine the average grayscale value of each column in the projected image to obtain a first array; fit the first array to obtain a continuous function; determine the second array based on the continuous function; and determine the initial edge data of the image to be processed based on the second array.

[0087] In a possible implementation, the edge analysis module 802 is further configured to: perform a second-order derivative operation on the continuous function to obtain first derivative data; determine a target point from the first derivative data based on a target value to obtain a second array.

[0088] In a possible implementation, the edge screening module 803 is further configured to: perform a first-order derivative operation on the continuous function to obtain second derivative data; determine a third array based on the second array and the second derivative data; and screen the third array based on preset rules to determine target edge data.

[0089] In a possible implementation, the edge screening module 803 is further configured to: compare the third array with the judgment threshold to determine the fourth array; obtain the grayscale value between two adjacent points in the fourth array, and determine the fifth array based on the preset grayscale range and the grayscale value; obtain the distance value between two adjacent points in the fifth array, and determine the sixth array based on the preset distance range and the distance value; and determine the target edge data based on the sixth array.

[0090] In a possible implementation, the edge screening module 803 is further configured to: obtain the grayscale variance between two adjacent points in the sixth array, determine the first target point and the second target point based on the grayscale variance; and determine the target edge data based on the first target point and the second target point.

[0091] The embodiments of this specification provide an image processing method, apparatus, device and storage medium, wherein the image processing apparatus comprises: determining an initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data. By determining the initial image, and determining an image to be processed corresponding to the initial image; analyzing the image to be processed, and determining initial edge data of the image to be processed; screening based on the initial edge data, and determining target edge data; and determining a target image based on the target edge data, the amount of data is reduced, the time cost is reduced, and the efficiency is improved.

[0092] The above is a schematic scheme of an image processing device of this embodiment. It should be noted that the technical scheme of the image processing device and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical scheme of the image processing device can be referred to the description of the technical scheme of the above-mentioned image processing method.

[0093] Fig. 9 The structure block diagram of a computing device 900 provided according to an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0094] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0095] In one embodiment of the present specification, the above components of the computing device 900 and Fig. 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0096] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 900 may also be a mobile or stationary server.

[0097] The processor 920 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned image processing method when executed by the processor. The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be found in the description of the technical scheme of the above-mentioned image processing method.

[0098] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned image processing method when executed by a processor.

[0099] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned image processing method.

[0100] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image processing method.

[0101] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above-mentioned image processing method.

[0102] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0103] Computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate form, etc. Computer readable media may include: any entity or device capable of carrying computer program codes, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROM), random access memories (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of computer readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.

[0104] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to specific implementation methods. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. An image processing method, It is characterized in that include: Determine an initial image, and determine an image to be processed corresponding to the initial image; Analyzing the image to be processed to determine initial edge data of the image to be processed; Screening based on the initial edge data to determine target edge data; The determining of the initial image and determining the image to be processed corresponding to the initial image includes: Determine an image range parameter, and determine an image to be processed corresponding to the initial image based on the image range parameter and the initial image; determining a target image based on the target edge data; The step of analyzing the image to be processed to determine initial edge data of the image to be processed includes: Performing longitudinal projection on the image to be processed to determine a projected image; Determine the average gray value of each column in the projection image to obtain a first array; Fitting the first array to obtain a continuous function; determining a second array based on the continuous function; Determining initial edge data of the image to be processed based on the second array; The determining of the second array based on the continuous function comprises: Performing a second-order derivative operation on the continuous function to obtain first derivative data; Determine a target point from the first derivative data based on a target value to obtain the second array; The screening based on the initial edge data to determine the target edge data includes: Performing a first-order derivative operation on the continuous function to obtain second derivative data; determining a third array based on the second array and the second derivative data; Screening the third array based on preset rules to determine target edge data; The step of screening the third array based on a preset rule to determine target edge data includes: Compare the third array with a judgment threshold to determine a fourth array; Obtaining a grayscale value between two adjacent points in the fourth array, and determining a fifth array based on a preset grayscale range and the grayscale value; Obtaining a distance value between two adjacent points in the fifth array, and determining a sixth array based on a preset distance range and the distance value; Determine target edge data based on the sixth array; The determining target edge data based on the sixth array includes: Obtaining a grayscale variance between two adjacent points in the sixth array, and determining a first target point and a second target point based on the grayscale variance; Target edge data is determined based on the first target point and the second target point.

2. An image processing device, used to implement the steps of the image processing method according to claim 1, It is characterized in that include: An image determination module is configured to determine an initial image and an image to be processed corresponding to the initial image; An edge analysis module is configured to analyze the image to be processed and determine initial edge data of the image to be processed; An edge screening module is configured to screen based on the initial edge data to determine target edge data; The edge determination module is configured to determine a target image based on the target edge data.

3. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the image processing method according to claim 1 are implemented.

4. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the image processing method of claim 1.