Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "target," "current," and the like in the description and claims of the present invention and the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1a is a flowchart of a method for determining a center position of a circular tube according to an embodiment of the present invention, where the method may be performed by a device for determining a center position of a circular tube, and the device may be implemented in hardware and/or software.
Accordingly, as shown in fig. 1a, the method comprises:
s110, acquiring a circular tube image to be analyzed in real time.
The circular tube image comprises at least one circular tube container frame, and each circular tube container frame corresponds to a circular tube model; in one of the circular tube container frames, a plurality of identical circular tubes are included.
The circular tube image may be an image of a circular tube acquired in real time, and may include a plurality of types of circular tubes, each of which may include a plurality of circular tubes.
In this embodiment, the round tube may be a bicycle round head tube aluminum alloy material tube, where the round tube is not limited.
Specifically, the circular tube image may include at least one circular tube container, as shown in fig. 1b, which is a schematic structural diagram of the circular tube image. In this fig. 1b, two circular tube containers are included, and each circular tube container is inconsistent in the type of the corresponding circular tube, specifically, the outer diameter of the circular tube on the left side of the image is larger than the outer diameter of the circular tube on the right side of the image.
S120, identifying the circular tube images to be analyzed, determining the number of the circular tube container frames, and performing image segmentation processing on the circular tube images to determine at least one target circular tube image.
In this embodiment, the number of circular tube container frames in the circular tube image may be determined by identifying the circular tube container frames, and then the image is segmented by an image segmentation algorithm to obtain at least one target circular tube image.
In the previous example, as shown in fig. 1b, which includes two circular tube containers, it is necessary to divide the circular tube image into two parts, one for each circular tube container. It will be appreciated that the circular tube image is divided into two target circular tube images.
Specifically, one type of circular tube is contained in each target circular tube image. For example: the two target circular tube images are a target circular tube image A and a target circular tube image B respectively, and a circular tube of type a corresponding to the target circular tube image A can be arranged; the target circular tube image B corresponds to a circular tube of type B.
S130, acquiring a round tube model corresponding to the target round tube image, performing image analysis processing on the target round tube image, and calculating to obtain round tube centers corresponding to the round tubes in the target round tube image.
The round pipe model can be used for describing the size parameters of the round pipe, and the round pipes of different models correspond to different shape description parameters.
In the previous example, the round tube model corresponding to the round tube in the target round tube image needs to be acquired first. For example, the round tube type identified herein is a round tube type a. Further, image analysis processing is required to be performed on the target circular tube image, so that the outline of the target circular tube image where each circular tube is located can be determined, as shown in fig. 1c, which is a schematic structural diagram of the circular tube outline corresponding to the analysis result of the circular tube image. Corresponding to fig. 1b, specifically, the left circular tube container frame of fig. 1b corresponds to the left frame fitting result; the right circular tube box in fig. 1b corresponds to the right box fitting result. Further, the circular tube centers corresponding to the circular tubes in the target circular tube image can be calculated.
Optionally, the obtaining the circular tube model corresponding to the target circular tube image includes: acquiring a circular tube model corresponding to the target circular tube image, and determining a shape description parameter according to the circular tube model; the shape description parameters include: the inner diameter of the circular tube, the outer diameter of the circular tube and the thickness of the wall of the circular tube.
In this embodiment, the different circular tube signals respectively correspond to a set of different shape description parameters, specifically, the shape description parameters include the inner diameter of the circular tube, the outer diameter of the circular tube, and the wall thickness of the circular tube.
Specifically, for a round head tube aluminum alloy material tube of a bicycle, the inner diameter of the round tube is generally as follows: 40-55 mm; the outer diameter of the circular tube is as follows: 50-75 mm; the thickness of the pipe wall of the circular pipe is as follows: 5-10 mm.
Optionally, the obtaining a circular tube model corresponding to the target circular tube image, performing image analysis processing on the target circular tube image, and calculating to obtain a circular tube center corresponding to each circular tube in the target circular tube image, where the calculating includes: performing image analysis on the received target circular tube image through a circular detection algorithm to obtain a circular tube image analysis result; obtaining the inner diameter, the outer diameter and the wall thickness of the circular pipe corresponding to the type of the circular pipe; and calculating to obtain the round tube centers corresponding to the round tubes in the target round tube image according to the round tube image analysis result, the round tube inner diameter, the round tube outer diameter and the round tube wall thickness.
In this embodiment, the image analysis processing is required to be performed on the target circular tube image by using a circular detection algorithm, so that a circular tube image analysis result including a plurality of circular tube contours can be obtained.
Further, according to the obtained inner diameter, outer diameter and wall thickness of the circular tube and the analysis result of the circular tube image, further calculating to obtain the circular tube center corresponding to each circular tube in the target circular tube image.
Optionally, the calculating, according to the analysis result of the circular tube image, the inner diameter of the circular tube, the outer diameter of the circular tube, and the thickness of the wall of the circular tube, the center of the circular tube corresponding to each circular tube in the circular tube image includes: in the round tube image analysis result, randomly acquiring the inner diameter of a round tube image, the outer diameter of the round tube image and the wall thickness of the round tube image corresponding to a target round tube; and calculating according to the inner diameter of the circular tube and the inner diameter of the circular tube image to obtain a scaling scale, and calculating according to the inner diameter of the circular tube image to obtain the center of the circular tube corresponding to each circular tube in the circular tube image when the outer diameter of the circular tube and the outer diameter of the circular tube image, and the wall thickness of the circular tube image meet the scaling scale.
Exemplary, in the round tube image analysis result, the internal diameter of the round tube image corresponding to a target round tube is randomly obtained to be m 1 Diameter of circular tube image outside n 1 And circular tube image wall thickness l 1 . Let it be assumed that the inner diameter m of the circular tube 2 Diameter n of outside of circular tube 2 And circular tube wall thickness l 2 。
Further, according to the inner diameter m of the circular tube 2 And circular tube image inside diameter m 1 Calculating to obtain a scaling scale asLater, whether the outer diameter of the circular tube and the outer diameter of the circular tube image, the wall thickness of the circular tube and the wall thickness of the circular tube image meet the scaling scale or not can be respectively verified, and if so, the inner diameter m of the circular tube image is determined 1 And calculating to obtain the centers of the round pipes corresponding to the round pipes in the round pipe image.
Optionally, the circular detection algorithm is an image detection algorithm based on edge detection and hough transform.
In this embodiment, the circle detection algorithm may select reference points, calculate gradient angles for edge pixel points, and each gradient angle may store a distance and an angle of a corresponding reference point. Moreover, the circular detection algorithm has good anti-interference performance, and has a large storage space and a large calculated amount.
In addition, the circle center can be further detected through Hough transformation, and the position of the circle center is determined. Specifically, the circle center is the intersection of all normals passing through the periphery where the circle center is located, and the intersection is the circle center. Furthermore, verification of the calculated center of the circular tube can be achieved, and accuracy of determining the center of the circular tube is improved.
Optionally, after calculating the circular tube centers corresponding to the circular tubes in the circular tube image according to the circular tube image analysis result, the circular tube inner diameter, the circular tube outer diameter and the circular tube wall thickness, the method further includes: visualizing the image analysis result of the circular tube to obtain a first circular tube visual image; and respectively visualizing the centers of the circular pipes, and combining the visualized images with the visualized images according to the first circular pipe to obtain a visualized image of a second circular pipe.
In this embodiment, the image analysis result of the circular tube and the center of the circular tube may be visualized to obtain a corresponding visualized image, so that the inspection of the worker is facilitated, and the accuracy of capturing the circular tube is improved.
S140, acquiring the coordinate position of the robot, and determining the center position of the circular tube according to the center of the circular tube.
Optionally, the acquiring the coordinate position of the robot, and determining the center position of the circular tube according to the center of the circular tube, includes: acquiring an initial circular tube center position corresponding to the circular tube center; and acquiring the coordinate position of the robot, calculating the relative position according to the initial circular tube center position, and determining the circular tube center position.
In the present embodiment, it is assumed that the initial circular tube center position is calculated as (x 1 ,y 1 ) The robot coordinate position corresponding to the robot is (a) 1 ,b 1 ) Because the robot and the center of the circular tube do not belong to the same coordinate system, the position of the center of the initial circular tube needs to be converted. For example, the robot coordinate position may be (a 1 ,b 1 ) Converted to (0, 0), the center position of the circular tube can be determined to be (x) 1 -a 1 ,y 1 -b 1 ). Therefore, the specific position of each circular pipe fitting can be determined more accurately, and the robot can conveniently and timely perform grabbing operation.
And S150, sending the center position of the round pipe to a robot control system so as to achieve grabbing of each round pipe through an indication robot.
In this embodiment, after calculating each circular sense center position, the circular tube center positions may be sequentially transmitted to the robot control system. After the robot control system receives the center position of each circular pipe, the gripping of the circular pipe fittings is sequentially performed.
According to the technical scheme, the circular tube image to be analyzed is acquired in real time; identifying circular tube images to be analyzed, determining the number of circular tube container frames, and performing image segmentation processing on the circular tube images to determine at least one target circular tube image; acquiring a round tube model corresponding to a target round tube image, performing image analysis processing on the target round tube image, and calculating to obtain round tube centers corresponding to all round tubes in the target round tube image; acquiring a robot coordinate position and determining the center position of the circular tube; and sending the center position of the round pipe to a robot control system so as to realize the grabbing of each round pipe by indicating the robot. The problem that the position of a round pipe fitting placed randomly cannot be moved by grabbing through a robot is solved, the labor cost and the time cost are saved, and the grabbing efficiency of the round pipe fitting is improved.
Example two
Fig. 2 is a schematic structural diagram of a device for determining a center position of a circular tube according to a second embodiment of the present invention. The device for determining the center position of the circular tube provided by the embodiment of the invention can be realized through software and/or hardware, and can be configured in terminal equipment or a server to realize the method for determining the center position of the circular tube. As shown in fig. 2, the apparatus includes: a circular tube image acquisition module 210, a target circular tube image determination module 220, a circular tube center calculation module 230, a circular tube center position determination module 240, and a circular tube center position transmission module 250.
The circular tube image acquisition module 210 is used for acquiring a circular tube image to be analyzed in real time; the circular tube image comprises at least one circular tube container frame, and each circular tube container frame corresponds to a circular tube model; in one of the circular tube container frames, a plurality of identical circular tubes are included;
the target circular tube image determining module 220 is configured to identify the circular tube image to be analyzed, determine the number of the circular tube container frames, and perform image segmentation processing on the circular tube image to determine at least one target circular tube image;
the circular tube center calculating module 230 is configured to obtain a circular tube model corresponding to the target circular tube image, perform image analysis processing on the target circular tube image, and calculate a circular tube center corresponding to each circular tube in the target circular tube image;
the circular tube center position determining module 240 is configured to obtain a robot coordinate position, and determine a circular tube center position according to a circular tube center;
and the round tube center position sending module 250 is used for sending the round tube center position to a robot control system so as to achieve the purpose of completing grabbing each round tube by indicating the robot.
According to the technical scheme, the circular tube image to be analyzed is acquired in real time; identifying circular tube images to be analyzed, determining the number of circular tube container frames, and performing image segmentation processing on the circular tube images to determine at least one target circular tube image; acquiring a round tube model corresponding to a target round tube image, performing image analysis processing on the target round tube image, and calculating to obtain round tube centers corresponding to all round tubes in the target round tube image; acquiring a robot coordinate position and determining the center position of the circular tube; and sending the center position of the round pipe to a robot control system so as to realize the grabbing of each round pipe by indicating the robot. The problem that the position of a round pipe fitting placed randomly cannot be moved by grabbing through a robot is solved, the labor cost and the time cost are saved, and the grabbing efficiency of the round pipe fitting is improved.
Optionally, the circular pipe center calculating module 230 may be specifically configured to: acquiring a circular tube model corresponding to the target circular tube image, and determining a shape description parameter according to the circular tube model; the shape description parameters include: the inner diameter of the circular tube, the outer diameter of the circular tube and the thickness of the wall of the circular tube.
Optionally, the circular pipe center calculating module 230 may be specifically configured to: performing image analysis on the received target circular tube image through a circular detection algorithm to obtain a circular tube image analysis result; obtaining the inner diameter, the outer diameter and the wall thickness of the circular pipe corresponding to the type of the circular pipe; and calculating to obtain the round tube centers corresponding to the round tubes in the target round tube image according to the round tube image analysis result, the round tube inner diameter, the round tube outer diameter and the round tube wall thickness.
Optionally, the circular pipe center calculating module 230 may be further specifically configured to: in the round tube image analysis result, randomly acquiring the inner diameter of a round tube image, the outer diameter of the round tube image and the wall thickness of the round tube image corresponding to a target round tube; and calculating according to the inner diameter of the circular tube and the inner diameter of the circular tube image to obtain a scaling scale, and calculating according to the inner diameter of the circular tube image to obtain the center of the circular tube corresponding to each circular tube in the circular tube image when the outer diameter of the circular tube and the outer diameter of the circular tube image, and the wall thickness of the circular tube image meet the scaling scale.
Optionally, the circular detection algorithm is an image detection algorithm based on edge detection and hough transform.
Optionally, the circular pipe center calculating module 230 may be further specifically configured to: after calculating the round tube centers corresponding to the round tubes in the round tube image according to the round tube image analysis result, the round tube inner diameter, the round tube outer diameter and the round tube wall thickness, visualizing the round tube image analysis result to obtain a first round tube visualized image; and respectively visualizing the centers of the circular pipes, and combining the visualized images with the visualized images according to the first circular pipe to obtain a visualized image of a second circular pipe.
Optionally, the circular tube center position determining module 240 may be specifically configured to: acquiring an initial circular tube center position corresponding to the circular tube center; and acquiring the coordinate position of the robot, calculating the relative position according to the initial circular tube center position, and determining the circular tube center position.
The device for determining the center position of the circular tube provided by the embodiment of the invention can execute the method for determining the center position of the circular tube provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement a third embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as the center position determination method of the circular tube.
In some embodiments, the method of determining the center position of a circular tube may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the circular tube center position determination method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method of center position determination of the circular tube in any other suitable manner (e.g., by means of firmware).
The method comprises the following steps: collecting a circular tube image to be analyzed in real time; identifying the circular tube images to be analyzed, determining the number of the circular tube container frames, and performing image segmentation processing on the circular tube images to determine at least one target circular tube image; acquiring a round tube model corresponding to the target round tube image, performing image analysis processing on the target round tube image, and calculating to obtain round tube centers corresponding to the round tubes in the target round tube image respectively; acquiring a robot coordinate position, and determining the center position of the circular pipe according to the center of the circular pipe; and sending the center position of the round pipe to a robot control system so as to realize the grabbing of each round pipe by indicating the robot.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Example IV
A fourth embodiment of the present invention also provides a computer-readable storage medium containing computer-readable instructions, which when executed by a computer processor, is configured to perform a method of determining a center position of a circular pipe, the method comprising: collecting a circular tube image to be analyzed in real time; identifying the circular tube images to be analyzed, determining the number of the circular tube container frames, and performing image segmentation processing on the circular tube images to determine at least one target circular tube image; acquiring a round tube model corresponding to the target round tube image, performing image analysis processing on the target round tube image, and calculating to obtain round tube centers corresponding to the round tubes in the target round tube image respectively; acquiring a robot coordinate position, and determining the center position of the circular pipe according to the center of the circular pipe; the center position of the round pipe is sent to a robot control system so as to achieve the purpose that the robot is instructed to finish grabbing each round pipe
Of course, the embodiment of the present invention provides a computer-readable storage medium, and the computer-executable instructions thereof are not limited to the method operations described above, but may also perform the related operations in the method for determining the center position of a circular tube provided by any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above-mentioned central position determining apparatus for a circular tube, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.