Disclosure of Invention
The embodiment of the application provides a method and a system for drawing a motor with a lens motion, which are used for solving the problems of low recognition efficiency and high recognition error rate caused by the fact that when a shooting background and a shooting object are misplaced and all misplaced object information cannot be clearly shot through one-time imaging in the prior art by shooting images.
The embodiment of the application provides a motor with lens motion picture picking method, which comprises the following steps:
step S1, when a product to be detected reaches a shooting area, acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between a camera lens and the product to be detected;
s2, determining photographing times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
and S3, synthesizing the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
Preferably, the step S1 specifically includes:
when the product to be detected is conveyed to the shooting area, the relative position relation between the product to be detected and the preset reference position is obtained, and the relative position relation between the product to be detected and the preset reference position is determined based on the position of the product to be detected.
Preferably, in the step S2, the determining the number of photographing times based on the width of the product to be detected and the relative positional relationship between the product to be detected and the camera lens specifically includes:
and determining the optimal shooting times based on the predetermined width of the product to be detected, the relative position of the product to be detected and a camera lens and the camera zooming distance, so that when the obtained image of the product to be detected is shot under each focal length, the edges of all the products to be detected are clearly distributed in the corresponding image of the product to be detected.
Preferably, in the step S2, the obtaining the image of the product to be detected under different focal lengths based on the continuous zooming method specifically includes:
and controlling the camera lens to do uniform motion relative to the product to be detected according to a preset speed, and carrying out equidistant zooming shooting through the camera lens to obtain images of the product to be detected under different focal lengths, wherein at least one image of the product to be detected is obtained under each focal length.
Preferably, the step S3 specifically includes:
and acquiring the definition of each part in each image of the product to be detected, and circularly extracting the part with the highest definition in each image of the product to be detected, and carrying out superposition synthesis until all the characteristics of the image of the product to be detected are contained in the synthesized image.
In a second aspect, an embodiment of the present application provides a motor with lens motion image capturing system, including:
the positioning unit is used for acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between the camera lens and the product to be detected when the product to be detected reaches the shooting area;
the shooting unit is used for determining shooting times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
and the synthesis unit synthesizes the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the steps of the method for capturing images of motor lens movement according to the embodiment of the first aspect of the present application are implemented when the processor executes the program.
In a fourth aspect, embodiments of the present application provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a motor-with-lens motion mapping method according to the embodiments of the first aspect of the present application.
According to the method and the system for drawing the motor with the lens, provided by the embodiment of the application, the liquid lens is used for continuously zooming, the camera is used for continuously collecting a plurality of images, so that edges of all products to be detected can be respectively and clearly distributed in corresponding images, and the images are synthesized to obtain the images with the edges of all the products to be detected being clear, so that the problems that in the prior art, when the shooting background is misplaced with a shooting object, the information of all misplaced objects cannot be clearly shot through one-time imaging, and the recognition efficiency is low and the recognition error rate is high are solved.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the embodiment of the present application, the term "and/or" is merely an association relationship describing the association object, which indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone.
The terms "first", "second" in embodiments of the application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the application, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a system, article, or apparatus that comprises a list of elements is not limited to only those elements or units listed but may alternatively include other elements not listed or inherent to such article, or apparatus. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In the detection field, the traditional manual detection method has the defects of low speed, low efficiency, false detection and high omission factor, and cannot meet the production requirement. In the prior art, detection and identification are carried out through shooting images, when the shooting background and the shooting object are misplaced, all misplaced object information cannot be clearly shot through one-time imaging, so that the identification efficiency is low and the identification error rate is high. The hardware such as a lens is used for enlarging the dislocation range of shooting to achieve clear imaging at one time, the current market is provided with a zoom lens, and the focusing point of the lens can be controlled to carry out imaging for multiple times to synthesize a picture with clear dislocation object, but the hardware has the defects of overlong zooming instability, long zooming time and high price.
Therefore, the embodiment of the application provides a motor with lens motion image acquisition method, which is characterized in that a liquid lens is continuously zoomed, a camera continuously acquires a plurality of images, the edges of all products to be detected can be ensured to be respectively and clearly distributed in corresponding images, and the images are combined to obtain an image with clear edges of each product to be detected. The following description and description will be made with reference to various embodiments.
Fig. 1 is a diagram illustrating a motor with lens motion diagram picking method according to an embodiment of the present application, including:
step S1, when a product to be detected reaches a shooting area, acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between a camera lens and the product to be detected;
specifically, when a product to be detected is conveyed to a shooting area, acquiring the relative position relation between the product to be detected and a preset reference position, and determining the relative position relation between the tab and the preset reference position based on the position of the product to be detected;
and determining the optimal shooting times based on the predetermined width of the product to be detected, the relative position of the product to be detected and a camera lens and the camera zooming distance, so that when the obtained image of the product to be detected is shot under each focal length, the edges of all the products to be detected are clearly distributed in the corresponding image of the product to be detected.
S2, determining photographing times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
the focusing distance after the camera lens is matched is fixed, the photographing position is adjusted according to the fixed position, the positioning camera calculates the position change of the product to be detected and changes, the positioning camera calculates the relative position relation of the product to be detected, the edge of the product to be detected and a certain fixed position (preset reference position) on a mechanism to calculate the obtained position relation, and the photographing times are confirmed through calculating the width of the tab to ensure that the measured object can be completely photographed;
controlling the camera lens to move back and forth at a uniform speed relative to the product to be detected according to a preset speed, and triggering the camera to shoot and collect pictures when reaching the corresponding position; and carrying out equidistant zooming shooting through a camera lens to obtain images of the product to be detected under different focal lengths.
In this embodiment, through continuous zooming of the liquid lens, the camera continuously collects a plurality of images, so that edges of all products to be detected can be respectively and clearly distributed in corresponding images, and image synthesis is performed on all the images, so as to obtain an image with clear edges of each product to be detected, and accurately distinguish the images.
The lens with the zoom ring can be controlled to carry out equidistant zooming, the zoom ring is driven by the logic control motor, and the zooming is realized by moving a fixed zooming distance; in the embodiment, the focal length is fixed and is determined by hardware, a part of the clear images can be focused by debugging according to a conventional lens focusing mode, and a complete and clear image can be synthesized by a plurality of part of clear images; the zooming algorithm is adjusted according to a certain focusing interval according to the zooming range of the lens.
When the product to be detected is black, shooting the product by using low-angle light to obtain a gray level image of the product, and obtaining the edge of the product to be detected according to an edge filtering algorithm;
or when the product to be detected is silvery and the gummed paper is green, firstly shooting the product by using white tunnel light to obtain a gray image of the product, and obtaining the edge of the product to be detected according to an edge filtering algorithm;
or when the product to be detected is silver and the gummed paper is blue, firstly shooting the product by using white tunnel light to obtain a gray image of the product, and obtaining the edge of the product to be detected according to an edge filtering algorithm.
And S3, synthesizing the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
And acquiring the definition of each part in each image of the product to be detected, and circularly extracting the part with the highest definition in each image of the product to be detected for superposition and synthesis until the synthesized image contains all the characteristics of the product to be detected.
Specifically, when the products to be detected have irregular dislocation, all edges cannot be focused by one-time photographing, so that continuous zooming is required through a liquid lens, the cameras respectively collect images under different focal lengths, the edges of all the products to be detected are ensured to be respectively and clearly distributed in corresponding images, and image synthesis is carried out on all the images to obtain an image with clear edges of each product to be detected.
The synthesis algorithm is to analyze the acquired image, circularly extract each clear part for synthesis, and is related to shooting, and the corresponding detected object to be shot cannot deviate from the detected object area; in this example, halon was used for the synthesis.
The method of the embodiment can be applied to the detection of the electrode lugs, the existing bare cell detection method is usually manual measurement, the bare cell is pressed by hands, and then the bare cell is clamped by a vernier caliper for measurement, but the following defects exist: the force of pressing the bare cell by the hand is different from the pressing thickness; the strength of manually clamping and measuring the bare cell by using a vernier caliper is also different; the precision of the vernier caliper is 0.01mm, the specification range of the width of the bare cell is +/-0.25 mm, and the measurement precision of the vernier caliper cannot meet the requirements. The existing measuring method leads to lower measuring accuracy of the bare cell and cannot meet the increasingly improved high-precision requirement of cell design. The specific detection method comprises the following steps:
step S1, when an electric core reaches a shooting area, acquiring a relative position relation between a pole lug and a preset reference position and a relative position relation between a camera lens and the pole lug;
specifically, when the battery cell is transmitted to a shooting area, acquiring the relative position relation between the battery cell and a preset reference position, and determining the relative position relation between the tab and the preset reference position based on the tab position in the battery cell;
and determining the optimal shooting times based on the preset tab width, the relative positions of the tabs and the camera lens and the camera zooming distance, so that all tab edges are clearly distributed in the corresponding tab images when the obtained tab images are shot under each focal length.
S2, determining shooting times based on the width of the tab and the relative position relation between the tab and a camera lens, and acquiring tab images under different focal lengths based on a continuous zooming method;
the focusing distance after the camera lens is fixed is matched, the photographing position is adjusted according to the fixed position, the positioning camera calculates the position change of the battery core and changes the position change, the positioning camera calculates the relative position relation of a lug on the battery core, the battery core edge and a certain fixed position (preset reference position) on a mechanism to calculate the obtained position relation, and the photographing times are confirmed through calculating the width of the lug to ensure that the measured object can be completely photographed;
the camera lens is controlled to move at a constant speed relative to the tab back and forth at a preset speed, and the camera lens reaches a corresponding position to trigger the camera to shoot and collect pictures; and carrying out equidistant zooming shooting through a camera lens to obtain tab images under different focal lengths.
In this embodiment, through continuous zooming of the liquid lens, the camera continuously collects a plurality of images, so as to ensure that all the tab edges can be clearly distributed in the corresponding images respectively, and image synthesis is performed on all the images, so as to obtain an image with clear tab edges, so that the images can be accurately distinguished.
The lens with the zoom ring can be controlled to carry out equidistant zooming, the zoom ring is driven by the logic control motor, and the zooming is realized by moving a fixed zooming distance; in the embodiment, the focal length is fixed and is determined by hardware, a part of the clear images can be focused by debugging according to a conventional lens focusing mode, and a complete and clear image can be synthesized by a plurality of part of clear images; the zooming algorithm is adjusted according to a certain focusing interval according to the zooming range of the lens.
When the battery cell of the product is black, shooting the product by using low-angle light to obtain a gray level image of the product, and obtaining the edge of the tab of the battery cell according to an edge filtering algorithm;
or when the battery core of the product is silver and the gummed paper is green, firstly shooting the product by using white tunnel light to obtain a gray image of the product, and obtaining the tab edge of the battery core according to an edge filtering algorithm;
or when the battery core is silver and the gummed paper is blue, firstly shooting the product by using white tunnel light to obtain a gray level image of the product, and obtaining the lug edge of the battery core according to an edge filtering algorithm.
And S3, synthesizing the tab images under different focal lengths into a tab synthesized image based on an image synthesis method.
As shown in fig. 2, the definition of each part in each tab image is obtained, and the part with the highest definition in each tab image is circularly extracted for superposition and synthesis until all features of the tab are contained in the synthesized image.
Specifically, because irregular dislocation exists in the lateral direction of the coiled tab, all edges cannot be focused by one-time photographing, continuous zooming is needed through a liquid lens, the camera respectively collects images under different focal lengths, the situation that all tab edges can be respectively and clearly distributed in corresponding images is ensured, image synthesis is carried out on all the images, and an image with clear tab edges is obtained.
The synthesis algorithm is to analyze the acquired image, circularly extract each clear part for synthesis, and is related to shooting, and the corresponding detected object to be shot cannot deviate from the detected object area; in this example, halon was used for the synthesis.
The embodiment of the application also provides a motor with lens motion image acquisition system, which is based on the motor with lens motion image acquisition method in each embodiment, and comprises the following steps:
the positioning unit is used for acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between the camera lens and the product to be detected when the product to be detected reaches the shooting area;
the shooting unit is used for determining shooting times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
and the synthesis unit synthesizes the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
Based on the same conception, the embodiment of the present application further provides a physical structure schematic diagram, as shown in fig. 3, where the server may include: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform the steps of the motor-driven lens movement mapping method described in the embodiments above. Examples include:
step S1, when a product to be detected reaches a shooting area, acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between a camera lens and the product to be detected;
s2, determining photographing times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
and S3, synthesizing the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Based on the same conception, the embodiments of the present application also provide a non-transitory computer readable storage medium storing a computer program, where the computer program includes at least one piece of code, and the at least one piece of code may be executed by a master control device to control the master control device to implement the steps of the motor with lens motion mapping method according to the above embodiments. Examples include:
step S1, when a product to be detected reaches a shooting area, acquiring the relative position relation between the product to be detected and a preset reference position and the relative position relation between a camera lens and the product to be detected;
s2, determining photographing times based on the width of the product to be detected and the relative position relation between the product to be detected and a camera lens, and acquiring images of the product to be detected under different focal lengths based on a continuous zooming method;
and S3, synthesizing the product images to be detected under different focal lengths into a product synthesized image to be detected based on an image synthesis method.
Based on the same technical concept, the embodiment of the present application also provides a computer program, which is used to implement the above-mentioned method embodiment when the computer program is executed by the master control device.
The program may be stored in whole or in part on a storage medium that is packaged with the processor, or in part or in whole on a memory that is not packaged with the processor.
Based on the same technical concept, the embodiment of the application also provides a processor, which is used for realizing the embodiment of the method. The processor may be a chip.
In summary, according to the method for capturing images by using the motor with lens motion provided by the embodiment of the application, through continuous zooming of the liquid lens, continuous acquisition of a plurality of images by the camera, and guarantee that edges of all products to be detected can be respectively and clearly distributed in corresponding images, and image synthesis is performed on all images to obtain an image with clear edges of each product to be detected, so that the problems that in the prior art, detection and identification are performed through shooting images, when a shooting background and a shooting object are misplaced, all misplaced object information cannot be clearly shot through one-time imaging, and therefore identification efficiency is low and identification error rate is high are solved.
The embodiments of the present application may be arbitrarily combined to achieve different technical effects.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.