Photographing method and device in cast detection process, electronic equipment and storage medium
By optimizing the movement trajectory of the robotic arm during casting inspection, the problem of long photo-taking time in existing technologies has been solved, achieving efficient photo-taking and overall efficiency improvement in casting inspection.
Patent Information
- Application Number
- CN202511068250.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-07-31
AI Technical Summary
In existing technologies, taking photos during the casting inspection process takes a long time, which affects the overall inspection efficiency.
By acquiring the target motion trajectory of the robotic arm during casting inspection, optimizing the angle information between adjacent points, and generating a smoother motion trajectory, the robotic arm can take pictures while moving.
This shortens the photo-taking time during casting inspection and improves overall inspection efficiency.
Smart Images

Figure CN120568208B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of casting detection, and in particular to a photographing method and device in a casting detection process, an electronic device and a storage medium. BACKGROUND
[0002] In the casting detection process, it is usually necessary to take multiple-angle photographs of the casting to obtain global images of the casting, and then analyze the obtained global images to obtain the detection result of the casting, such as whether there are defects such as slag inclusion, cracks, pores, shrinkage holes, and shrinkage porosity.
[0003] However, the photographing method in the casting detection process in the prior art usually controls the robot to move to a certain point and stop moving, and then starts the camera to take a photograph. After the photograph is taken, the robot is controlled to continue moving to the next point. This results in a long time spent on photographing, which affects the overall detection efficiency of the casting. Therefore, how to shorten the photographing time in the casting detection process has become a technical problem to be solved. SUMMARY
[0004] The present application provides a photographing method and device in a casting detection process, an electronic device and a storage medium to solve the problem in the prior art that the photographing needs to be performed after the robot stays at the corresponding point, resulting in a long time spent on photographing and affecting the overall detection efficiency of the casting.
[0005] In a first aspect, the embodiments of the present application provide a photographing method in a casting detection process, which comprises:
[0006] obtaining a target motion trajectory of a robot in a detection process of a casting to be detected, wherein the robot is used to carry a camera to take a photograph of the casting to be detected and to carry the casting to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the casting to be detected;
[0007] determining the included angle information between all adjacent two segments in the target motion trajectory according to the connection order and pose information of each point in the target motion trajectory;
[0008] optimizing the target motion trajectory according to the included angle information to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than the trajectory smoothness of the target motion trajectory;
[0009] controlling the robot to move and take a photograph according to the optimized motion trajectory to obtain image information of the casting to be detected.
[0010] Optionally, the obtaining of the target motion trajectory of the robot in the detection process of the casting to be detected comprises:
[0011] an initial motion trajectory of the mechanical arm is acquired, wherein the initial motion trajectory is determined according to detection requirements of the castings to be detected;
[0012] an adjustment type of each point in the initial motion trajectory is acquired, wherein the adjustment type is a first type of point position sequence supporting adjustment or a second type of point position sequence not supporting adjustment;
[0013] a connection sequence of the first type of point between two adjacent second type of points is adjusted, and a motion trajectory with a minimum length after adjustment is determined as the target motion trajectory.
[0014] Optionally, the acquiring of the initial motion trajectory of the mechanical arm comprises:
[0015] a trajectory point list is determined according to detection requirements corresponding to the castings to be detected, wherein the trajectory point list comprises a plurality of point positions with an initial connection sequence, and pose information and operation information corresponding to each point position;
[0016] the plurality of point positions are connected by line segments to obtain the initial motion trajectory, wherein the initial motion trajectory comprises a plurality of road segments.
[0017] Optionally, the optimization of the target motion trajectory according to the included angle information comprises:
[0018] at least one target road segment set with an included angle less than a preset threshold is determined from the target motion trajectory according to the included angle information, wherein each target road segment set comprises two road segments forming the included angle;
[0019] if all point positions on the target road segment set are the first type of point positions, a connection sequence of the point positions on the target road segment set is adjusted to a target connection sequence to obtain an optimized motion trajectory, wherein an included angle between two new road segments formed by the target connection sequence is greater than or equal to the preset threshold;
[0020] if there is the second type of point position among the point positions on the target road segment set, a new point position is added as a neighboring point position of an intermediate point position on the target road segment set to obtain an optimized motion trajectory, wherein an included angle between any two of three new road segments formed after the addition of the new point position is greater than or equal to the preset threshold.
[0021] Optionally, the control of the mechanical arm to move according to the optimized motion trajectory and to take a photograph to obtain image information of the castings to be detected comprises:
[0022] control the mechanical arm to move according to the optimized motion trajectory, and collect the position of the mechanical arm in real time;
[0023] in the case that the mechanical arm moves to a preset distance from a target point, send to-position information to the cameras in the camera array and / or the cameras carried by the mechanical arm to obtain image information of the castings to be detected, wherein the target point refers to any point at which the castings to be detected need to be photographed, and the to-position information is used to trigger the cameras in the camera array and / or the cameras carried by the mechanical arm to take photos.
[0024] Optionally, the control of the mechanical arm to move according to the optimized motion trajectory comprises:
[0025] control the mechanical arm to move in a circular arc motion instead of a corner motion at each point of the optimized motion trajectory, wherein the smoothness of the circular arc motion is greater than that of the corner motion.
[0026] Optionally, after the control of the mechanical arm to move according to the optimized motion trajectory and take photos to obtain the image information of the castings to be detected, the method further comprises:
[0027] analyze the image information of the castings to be detected to obtain an analysis result, wherein the analysis result is used to determine whether the castings to be detected have surface defects;
[0028] control the mechanical arm to perform a subsequent detection process matched with the analysis result.
[0029] In a second aspect, the embodiments of the present application further provide a photographing device in a cast detection process, the device comprising:
[0030] an acquisition module configured to acquire a target motion trajectory of a mechanical arm in a detection process of a casting to be detected, wherein the mechanical arm is used to carry a camera to take photos of the casting to be detected and carry the casting to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the casting to be detected;
[0031] a determination module configured to determine angle information between all adjacent two road segments in the target motion trajectory according to the connection order and pose information of each point in the target motion trajectory;
[0032] an optimization module configured to optimize the target motion trajectory according to the angle information to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than that of the target motion trajectory;
[0033] A photographing module is configured to control the mechanical arm to move according to the optimized motion trajectory and take a photograph, so as to obtain image information of the cast to be detected.
[0034] In a third aspect, the embodiments of the present application further provide an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
[0035] The memory is configured to store a computer program.
[0036] The processor is configured to execute the program stored on the memory, so as to implement the photographing method in the cast detection process according to any one of the first aspect.
[0037] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the photographing method in the cast detection process according to any one of the first aspect.
[0038] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art: the method provided by the embodiments of the present application acquires a target motion trajectory of a mechanical arm in a detection process of a cast to be detected, wherein the mechanical arm is used to carry a camera to take a photograph of the cast to be detected and to carry the cast to be detected to move in a preset camera array, the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the cast to be detected, according to the connection order and pose information of each point in the target motion trajectory, the angle information between all adjacent two road segments in the target motion trajectory is determined, the target motion trajectory is optimized according to the angle information, so as to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than the trajectory smoothness of the target motion trajectory, and the mechanical arm is controlled to move according to the optimized motion trajectory and take a photograph, so as to obtain image information of the cast to be detected. In this way, the target motion trajectory can be optimized according to the angle information between all adjacent two road segments in the target motion trajectory of the mechanical arm, so as to obtain the optimized motion trajectory with higher trajectory smoothness, which can reduce the vibration of the mechanical arm in the movement process, and thus realize the effect of taking a photograph while moving, thereby effectively avoiding the time waste caused by the need to take a photograph after the mechanical arm stays at the corresponding point in the prior art, achieving the technical effects of shortening the photographing time in the cast detection process and improving the overall detection efficiency of the cast. BRIEF DESCRIPTION OF DRAWINGS
[0039] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate one embodiment consistent with the present application and, together with the description, serve to explain the principles of the application.
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced as follows. Obviously, the drawings are only a part of the embodiments of the present application, and thus they are not necessarily to be construed to limit the present application.
[0041] One or more embodiments are illustrated by way of example with reference to the drawings, which are not necessarily drawn to scale, and which are not necessarily construed as limiting the embodiments. The same reference numbers in different drawings represent the same elements unless otherwise stated. The drawings are not necessarily to scale.
[0042] Figure 1 A flowchart of a photographing method in a casting detection process according to an embodiment of the present application is shown in the figure.
[0043] Figure 2 A schematic diagram of a motion trajectory before and after optimization according to an embodiment of the present application is shown in the figure.
[0044] Figure 3 A schematic diagram of a motion trajectory before and after optimization according to another embodiment of the present application is shown in the figure.
[0045] Figure 4 A structural diagram of a photographing system in a casting detection process according to an embodiment of the present application is shown in the figure.
[0046] Figure 5 A flowchart of a photographing method in a casting detection process according to another embodiment of the present application is shown in the figure.
[0047] Figure 6 A structural diagram of a photographing device in a casting detection process according to an embodiment of the present application is shown in the figure.
[0048] Figure 7 A structural diagram of an electronic device according to an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0049] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0050] The disclosure below provides many different embodiments or examples for implementing different structures of the application. For the sake of simplicity, the description below of a particular embodiment or example does not cite every feature of that embodiment or example. This omission is not to be construed as having no significance. The present application is not limited to the embodiment or example that is described and shown.
[0051] In order to solve the problem in the prior art that the mechanical arm needs to stay at the corresponding point before taking a picture, resulting in a long time for taking a picture and affecting the overall detection efficiency of the casting, the present application provides a photographing method, device, electronic equipment and storage medium in the casting detection process, which can shorten the photographing time in the casting detection process and improve the overall detection efficiency of the casting.
[0052] Referring to Figure 1 , Figure 1 A flowchart of a photographing method in a casting detection process provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the photographing method in the casting detection process can include the following steps: Figure 1
[0053] Step S101, obtaining a target motion trajectory of a mechanical arm in a detection process of a casting to be detected, wherein the mechanical arm is used to carry a camera to take a picture of the casting to be detected and carry the casting to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the casting to be detected.
[0054] Specifically, the casting to be detected can be any casting such as a hub or a steering knuckle. The mechanical arm can carry the camera to take a picture of the casting to be detected and carry the casting to be detected to move in the preset camera array, and the camera carried by the mechanical arm itself is used to take a picture of the casting to be detected. The target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the casting to be detected. The target motion trajectory includes a plurality of points, and a road segment is formed between two adjacent points, i.e., the target motion trajectory is composed of a plurality of road segments. According to the detection requirements, the casting to be detected needs to be photographed and / or other functional operations such as grabbing, scanning, assembling, processing, etc. at each point.
[0055] In the acquisition of the target motion trajectory of the robot arm, the adjustment type of each point can be acquired, and then all possible point sequences of the point sequence supporting adjustment of each point are traversed to obtain a motion trajectory with the minimum length that meets the detection requirements of the to-be-detected casting, and the motion trajectory is taken as the target motion trajectory. As another optional implementation, the target motion trajectory can be pre-set, for example, the target motion trajectories corresponding to various castings can be pre-set, and after the type of the to-be-detected casting is determined, the target motion trajectory corresponding to the to-be-detected casting is acquired.
[0056] In step S102, the angle information between all adjacent two road segments in the target motion trajectory is determined according to the connection sequence and the pose information of each point in the target motion trajectory.
[0057] Specifically, the pose information can include position information (x-axis coordinate, y-axis coordinate, z-axis coordinate) and direction information (heading angle a, pitch angle β, roll angle γ), etc.
[0058] In this step, after the target motion trajectory of the robot arm is determined, the angle information between all adjacent two road segments in the target motion trajectory can be determined according to the connection sequence and the pose information of each point in the target motion trajectory.
[0059] In step S103, the target motion trajectory is optimized according to the angle information to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than the trajectory smoothness of the target motion trajectory.
[0060] In this step, the road segment with an angle less than a preset threshold (such as 90 degrees, etc.) in the target motion trajectory can be optimized, so that the motion trajectory of the robot arm becomes smoother, thereby obtaining the optimized motion trajectory. The optimization method can be adjusting the point connection sequence, adding a new point, or other methods, etc.
[0061] In step S104, the robot arm is controlled to move according to the optimized motion trajectory and take a photo to obtain image information of the to-be-detected casting.
[0062] In this step, after the optimized motion trajectory is acquired, the robot arm can be controlled to move according to the optimized motion trajectory, and the corresponding operation of each point (such as taking a photo, grabbing, etc.) can be performed when approaching each point, so that the required image information of the to-be-detected casting can be obtained.
[0063] In the embodiment, the target motion trajectory can be optimized according to the included angle information between all adjacent two segments in the target motion trajectory of the mechanical arm, so as to obtain an optimized motion trajectory with higher trajectory smoothness, which can reduce the vibration of the mechanical arm in the motion process, and further realize the effect of taking pictures while moving, thereby effectively avoiding the time waste caused by the need to take pictures after the mechanical arm stays at the corresponding point in the prior art, achieving the technical effects of shortening the photographing time in the casting detection process and improving the overall casting detection efficiency.
[0064] Further, the step S101 of obtaining the target motion trajectory of the mechanical arm in the detection process of the casting to be detected comprises:
[0065] obtaining an initial motion trajectory of the mechanical arm, wherein the initial motion trajectory is determined according to the detection requirement of the casting to be detected;
[0066] obtaining the adjustment type of each point in the initial motion trajectory, wherein the adjustment type is a first type of point sequence supporting adjustment or a second type of point sequence not supporting adjustment;
[0067] adjusting the connection order of the first type of point between the adjacent two second type of points, and determining the motion trajectory with the smallest length after adjustment as the target motion trajectory.
[0068] In an embodiment, when the target motion trajectory of the robot arm is acquired, the initial motion trajectory of the robot arm can be determined according to the detection requirements of the castings to be detected, then the adjustment types of each point in the initial motion trajectory are acquired, the connection order of the first type of points between the second type of adjacent points is adjusted, and the motion trajectory with the minimum length after adjustment is determined as the target motion trajectory. The reason why the adjustment types of the points need to be classified is to ensure that the point order of the second type of points remains unchanged, and only the point order of the first type of points is adjusted. For example, in the casting detection process, the upper surface and the gripping part of the casting usually need to be photographed first, then the robot arm is controlled to grip the casting, and then the position and angle of the robot arm are adjusted to take pictures of other parts of the casting. Therefore, the action of taking pictures of the upper surface and the gripping part of the casting must be performed before the action of gripping, and the execution order of the two actions cannot be adjusted. In this case, the points for taking pictures of the upper surface and the gripping part of the casting and the points for gripping can be regarded as the second type of points, and when the multi-angle photographing is performed after the robot arm grips the casting, the photographing angle order can be adjusted according to the requirements, so these points can be regarded as the first type of points. For another example, assuming that the initial motion trajectory includes points 1 to 10 in sequence, points 1, 6 and 10 are the second type of points, and the other points are the first type of points, then the point order of points 2 to 5 and points 7 to 9 can be adjusted to obtain the target motion trajectory with the minimum length.
[0069] In the above manner, the motion trajectory of the robot arm can be minimized as much as possible under the condition of meeting the detection requirements of the castings, thereby shortening the photographing time in the casting detection process and improving the overall detection efficiency of the castings.
[0070] Further, the above steps of acquiring the initial motion trajectory of the robot arm include:
[0071] According to the detection requirements corresponding to the castings to be detected, a trajectory point list is determined, wherein the trajectory point list includes a plurality of points with an initial connection order, and pose information and operation information corresponding to each point.
[0072] The plurality of points are connected by line segments to obtain an initial motion trajectory, wherein the initial motion trajectory includes a plurality of road segments.
[0073] In an embodiment, when the initial motion trajectory of the mechanical arm is acquired, a trajectory point list can be determined according to the detection requirements corresponding to the cast to be detected. The trajectory point list is used to store a plurality of point positions at which the mechanical arm needs to stop during the detection of the cast to be detected and operation information to be performed at each point position. Then, the plurality of point positions are connected by line segments to obtain the initial motion trajectory. In this way, the initial motion trajectory of the mechanical arm can be quickly determined, which facilitates subsequent determination of the target motion trajectory based on the initial motion trajectory.
[0074] Further, the step S103 of optimizing the target motion trajectory according to the included angle information to obtain the optimized motion trajectory comprises:
[0075] determining, according to the included angle information, at least one target segment set with an included angle less than a preset threshold from the target motion trajectory, wherein each target segment set comprises two segments forming an included angle;
[0076] if the point positions on the target segment set are all point positions of the first type, adjusting the connection order of the point positions on the target segment set to a target connection order to obtain the optimized motion trajectory, wherein the included angle between two new segments formed by the target connection order is greater than or equal to the preset threshold;
[0077] if the point positions on the target segment set include point positions of the second type, adding a new point position as an adjacent point position of the intermediate point position on the target segment set to obtain the optimized motion trajectory, wherein the included angle between any two of the three new segments formed after the new point position is added is greater than or equal to the preset threshold.
[0078] Specifically, the preset threshold can be set according to actual conditions, and the embodiments of the present application are not limited to, for example, 60 degrees, 90 degrees, and the like.
[0079] In an embodiment, when the target motion trajectory is optimized, at least one target segment set with an included angle less than a preset threshold can be determined from the target motion trajectory according to the included angle information, and then the types of the point positions on each target segment set are determined. If the point positions on a target segment set are all point positions of the first type, the connection order of the point positions on the target segment set is adjusted to a target connection order with an included angle greater than or equal to the preset threshold to obtain the optimized motion trajectory. For example, as shown in FIG. 8, the original point position order on the target segment set is shown on the left side, and the point positions on the target segment set are all point positions of the first type. Since the included angle formed by the target segment set is an acute angle, the point position order of these point positions can be adjusted to obtain the target connection order as shown on the right side. Figure 2 Figure 2 Figure 2 The angle of the movement trajectory shown on the right side is obtuse. If the point on the target road segment set is of the second type, new points are added in front of or behind the middle point to obtain an optimized movement trajectory with an angle greater than or equal to the preset threshold. As shown in Figure 3 The original point sequence on the target road segment set is as shown on the left side Figure 3 The angle of the movement trajectory shown on the right side is obtuse. If the point on the target road segment set is of the second type, new points are added in front of or behind the middle point to obtain an optimized movement trajectory with an angle greater than or equal to the preset threshold. As shown in Figure 3 The angle of the movement trajectory shown on the right side is obtuse. If the point on the target road segment set is of the second type, new points are added in front of or behind the middle point to obtain an optimized movement trajectory with an angle greater than or equal to the preset threshold. As shown in
[0080] In the above manner, the target road segment set with an angle less than the preset threshold in the target movement trajectory can be optimized, so that the angle of the target road segment set is greater than or equal to the preset threshold, thereby making the movement trajectory of the mechanical arm smoother, which is beneficial to moving and photographing the castings to be detected, and provides a prerequisite for the snapshot.
[0081] Further, the step S104, the mechanical arm is controlled to move according to the optimized movement trajectory and take a photograph to obtain image information of the castings to be detected, including:
[0082] The mechanical arm is controlled to move according to the optimized movement trajectory, and the position of the mechanical arm is collected in real time.
[0083] When the mechanical arm moves to a distance of a preset distance from the target point, the camera in the camera array and / or the camera carried by the mechanical arm is sent to the in-place information to obtain image information of the castings to be detected, wherein the target point refers to any point at which the castings to be detected need to be photographed, and the in-place information is used to trigger the camera in the camera array and / or the camera carried by the mechanical arm to take a photograph.
[0084] In an embodiment, the mechanical arm can be controlled to move according to the optimized motion trajectory, and the position of the mechanical arm can be collected in real time during the movement. When the mechanical arm moves to a position that is a preset distance away from the target position, a to-position information is sent to the cameras in the camera array and / or the cameras carried by the mechanical arm through a hardware IO interface, and then the cameras in the camera array and / or the cameras carried by the mechanical arm are controlled to take a picture of the casting to be detected through the to-position information, so as to obtain image information of the casting to be detected. The preset distance can be set according to actual needs, such as 0.1 mm. In this way, the mechanical arm does not need to stop when reaching the target position. When the mechanical arm moves to a position that is within 0.1 mm away from the target position, a to-position signal is transmitted in real time through the hardware IO interface, and then the camera with a global shutter is triggered to complete real-time shooting. The entire process is completed during the movement of the mechanical arm, that is, in the way of snapshot. Compared with the conventional shooting mode in which the mechanical arm needs to stop after moving to the target position, the camera shoots, and then the mechanical arm continues to move, the conventional shooting mode wastes about 40% of the time in stopping and moving again. Therefore, the shooting mode in the embodiment can save shooting time and improve overall detection efficiency.
[0085] Further, the step of controlling the mechanical arm to move according to the optimized motion trajectory comprises:
[0086] The mechanical arm is controlled to move in a circular arc motion instead of a corner motion at each point on the optimized motion trajectory, wherein the smoothness of the circular arc motion is greater than that of the corner motion.
[0087] Specifically, the circular arc motion refers to moving in a circular arc trajectory near each point, and the corner motion refers to moving in a trajectory corresponding to the included angle of each point near each point.
[0088] In an embodiment, when the mechanical arm is controlled to move according to the optimized motion trajectory, the mechanical arm can move in a circular arc motion instead of a corner motion at each point. Since the smoothness of the circular arc motion is greater than that of the corner motion, the smoothness of the motion trajectory of the mechanical arm can be further improved, so that the movement of the mechanical arm is more smooth.
[0089] Further, after the step S104 of controlling the mechanical arm to move according to the optimized motion trajectory and shooting to obtain the image information of the casting to be detected, the method further comprises:
[0090] The image information of the casting to be detected is analyzed to obtain an analysis result, wherein the analysis result is used to determine whether the casting to be detected has a surface defect.
[0091] The mechanical arm is controlled to perform a subsequent detection process matched with the analysis result.
[0092] In an embodiment, after obtaining the image information of the cast to be detected, the image information of the cast to be detected can be analyzed to determine whether the cast to be detected has surface defects, and then the cast to be detected is classified according to the analysis result, so as to facilitate subsequent assembly and processing operations of the cast without surface defects.
[0093] In an embodiment, the photographing method provided by the cast detection process of the application is applicable to Figure 4 The system shown in the figure can include a host computer, a mechanical arm, an optical module, a functional action module, etc. The host computer is used for point trajectory generation, point trajectory planning, information sending processing and feedback, etc. The mechanical arm is a motion execution module, which can carry the optical module and the functional action module according to the functional needs. The optical module and the functional action module can be carried on the mechanical arm or installed in a fixed position. The optical module can perform photographing operation, and the functional action module can perform grabbing, scanning, assembling, processing and other operations. The photographing process of the system in the cast detection process is shown in Figure 5 The photographing process of the system in the cast detection process is shown in
[0094] Step S501, determining a list of point positions according to the key points.
[0095] Through the operation requirements of photographing, assembling, processing and the like, the positions (spatial position information x, y, z, a, b, g) where the mechanical arm needs to stay are determined, and these spatial position information and the operations to be performed are saved in the host computer in the form of a list;
[0096] Step S502, connecting the point positions with line segments to form an initial motion trajectory.
[0097] Step S503, determining a target motion trajectory with the minimum length based on the initial motion trajectory.
[0098] Taking the order of the point positions in the initial motion trajectory as the initial value, the total length of the trajectory is calculated, and the point positions with unchangeable order in the initial motion trajectory are determined. The point positions with changeable order are adjusted, all possible point position orders are traversed using the traversal algorithm, and the motion trajectory with the minimum total length among them is found as the target motion trajectory.
[0099] Step S504, optimizing the local trajectory of the target motion trajectory.
[0100] According to the point coordinates, the included angle formed by the road section between adjacent point positions is calculated in a traversal manner. The acute angle bend with too large turning amplitude of the mechanical arm is changed into an obtuse angle bend by changing the order of the point positions. If the included angle of the next point position is obtuse after the order of the previous point position is changed, the change is saved, otherwise, the change of the order of the previous point position is abandoned. In addition, the corner motion is replaced by the circular arc motion at the trajectory corner, so that the mechanical arm does not need to decelerate and then accelerate when turning, the motion time is reduced, the trajectory is smoother, the mechanical arm shakes less, the smoothness of the point positions is optimized, and the effect of optimizing the beat and reducing the shaking of the mechanical arm is achieved. If an acute angle turning appears in the target motion trajectory and cannot be avoided, the acute angle turning is changed into an obtuse angle turning by increasing a transition point, and the corner motion is replaced by the circular arc motion.
[0101] In step S505, the mechanical arm is controlled to move according to the optimized trajectory, and a flying shot is used to take a picture of the castings to be detected.
[0102] The flying shot is a concept relative to the conventional shooting. In the conventional shooting, the following process is experienced: the mechanical arm moves to a position and stops, the camera takes a picture, and then the mechanical arm continues to move. The problem of the conventional shooting is that the mechanical arm needs to stop and move again every time, and about 40% of the time of the beat is wasted. The flying shot refers to that the mechanical arm does not stop every time, and when the mechanical arm moves to a corresponding point position within a range of 0.1 mm, a signal indicating that the mechanical arm is in position is transmitted in real time through a hardware input / output (Input / Output, referred to as IO) interface, a camera with a global shutter is triggered to take a picture in real time, and the whole process is completed in the case that the mechanical arm is moving, so it is called flying shot.
[0103] In the embodiment, the complex metal castings can be quickly and automatically detected without dead angle, and have the advantages of 360° omnidirectional shooting capability, fast detection beat, and strong detection capability.
[0104] Referring to Figure 6 , Figure 6 FIG. 1 is a structural schematic diagram of a photographing device in a cast detection process according to an embodiment of the present application. As shown in Figure 6 FIG. 1, the photographing device 600 in the cast detection process includes:
[0105] The acquisition module 601 is configured to acquire a target motion trajectory of a mechanical arm in a detection process of a cast to be detected, wherein the mechanical arm is used to carry a camera to take a picture of the cast to be detected and to carry the cast to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition that the cast to be detected meets the detection requirement.
[0106] The determination module 602 is configured to determine included angle information between all adjacent road sections in the target motion trajectory according to the connection order and pose information of each point position in the target motion trajectory.
[0107] an optimization module 603, configured to optimize the target motion trajectory according to the included angle information, to obtain an optimized motion trajectory, wherein a trajectory smoothness of the optimized motion trajectory is greater than a trajectory smoothness of the target motion trajectory;
[0108] a photographing module 604, configured to control the robot arm to move according to the optimized motion trajectory and take a photograph, to obtain image information of the castings to be detected.
[0109] Further, the acquisition module 601 comprises:
[0110] a first acquisition sub-module, configured to acquire an initial motion trajectory of the robot arm, wherein the initial motion trajectory is determined according to detection requirements of the castings to be detected;
[0111] a second acquisition sub-module, configured to acquire an adjustment type of each point in the initial motion trajectory, wherein the adjustment type is a first type of point position sequence supporting adjustment or a second type of point position sequence not supporting adjustment;
[0112] a first determination sub-module, configured to adjust a connection order of the first type of point between two adjacent points of the second type, and determine a motion trajectory with a minimum length after adjustment as the target motion trajectory.
[0113] Further, the first acquisition sub-module comprises:
[0114] a determination unit, configured to determine a trajectory point list according to detection requirements corresponding to the castings to be detected, wherein the trajectory point list comprises a plurality of points with an initial connection order, and pose information and operation information corresponding to each point;
[0115] a connection unit, configured to connect the plurality of points with line segments to obtain the initial motion trajectory, wherein the initial motion trajectory comprises a plurality of road segments.
[0116] Further, the optimization module 603 comprises:
[0117] a second determination sub-module, configured to determine at least one target road segment set with an included angle less than a preset threshold from the target motion trajectory according to the included angle information, wherein each target road segment set comprises two road segments forming an included angle;
[0118] an adjustment sub-module, configured to, if the points on the target road segment set are all of the first type, adjust a connection order of the points on the target road segment set to a target connection order to obtain the optimized motion trajectory, wherein an included angle between two new road segments formed by the target connection order is greater than or equal to the preset threshold;
[0119] The increasing submodule is configured to increase a new point as a neighboring point of the intermediate point on the target road segment set if the second type of point exists in the point on the target road segment set, to obtain an optimized motion trajectory, wherein an angle between any two of three new road segments formed after the new point is added is greater than or equal to a preset threshold.
[0120] Further, the photographing module 604 comprises:
[0121] The control submodule is configured to control the robot arm to move according to the optimized motion trajectory and collect the position of the robot arm in real time.
[0122] The photographing submodule is configured to send to-position information to the camera in the camera array and / or the camera carried by the robot arm when the robot arm moves to a preset distance from the target point, to obtain image information of the castings to be detected, wherein the target point refers to any point at which the castings to be detected need to be photographed, and the to-position information is used to trigger the camera in the camera array and / or the camera carried by the robot arm to take a photograph.
[0123] Further, the control submodule is specifically configured to:
[0124] The control submodule is configured to control the robot arm to move in a circular arc motion instead of a corner motion at each point on the optimized motion trajectory, wherein the smoothness of the circular arc motion is greater than that of the corner motion.
[0125] Further, the photographing device 600 in the casting detection process comprises:
[0126] The analysis module is configured to analyze the image information of the castings to be detected to obtain an analysis result, wherein the analysis result is used to determine whether the castings to be detected have surface defects.
[0127] The control module is configured to control the robot arm to perform a subsequent detection process matched with the analysis result.
[0128] It should be noted that the photographing device 600 in the casting detection process can implement the photographing method in the casting detection process provided by any one of the preceding method embodiments and achieve the same technical effects, and thus will not be described here in detail.
[0129] As shown in Figure 7 The present application also provides an electronic device, which comprises a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712 and the memory 713 communicate with each other through the communication bus 714,
[0130] The memory 713 is configured to store a computer program.
[0131] In an embodiment of the present application, the processor 711, when executing the program stored in the memory 713, implements the photographing method in the casting detection process provided by any one of the foregoing method embodiments, including:
[0132] obtaining a target motion trajectory of a mechanical arm in a detection process of a casting to be detected, wherein the mechanical arm is used to carry a camera to take a photograph of the casting to be detected and carry the casting to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirement of the casting to be detected;
[0133] determining angle information between any two adjacent segments in the target motion trajectory according to a connection order and pose information of each point in the target motion trajectory;
[0134] optimizing the target motion trajectory according to the angle information to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than the trajectory smoothness of the target motion trajectory;
[0135] controlling the mechanical arm to move according to the optimized motion trajectory and take a photograph to obtain image information of the casting to be detected.
[0136] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the photographing method in the casting detection process provided by any one of the foregoing method embodiments.
[0137] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.
[0138] Through the description of the foregoing embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. Based on such understanding, the foregoing technical solutions essentially or in other words, the part that contributes to the related art can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0139] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order
[0140] The above description is that of current embodiments of the application. Various modifications and changes can be made thereto without departing from the spirit and scope of the application as set forth. The scope of the application is not to be limited to the exact details shown above.
Claims
1. A photographing method in a casting inspection process, characterized by, The method comprises: acquiring a target motion trajectory of a mechanical arm in a detection process of a casting to be detected, wherein the mechanical arm is used to carry a camera to take a photo of the casting to be detected and to carry the casting to be detected to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirement of the casting to be detected; determining angle information between all adjacent two road sections in the target motion trajectory according to a connection order and pose information of each point in the target motion trajectory; optimizing the target motion trajectory according to the angle information to obtain an optimized motion trajectory, wherein a trajectory smoothness of the optimized motion trajectory is greater than a trajectory smoothness of the target motion trajectory; controlling the mechanical arm to move and take a photo according to the optimized motion trajectory to obtain image information of the casting to be detected.
2. The photographing method in a casting detection process according to claim 1, characterized in that, The acquiring of the target motion trajectory of the mechanical arm in the detection process of the casting to be detected comprises: acquiring an initial motion trajectory of the mechanical arm, wherein the initial motion trajectory is determined according to a detection requirement of the casting to be detected; acquiring an adjustment type of each point in the initial motion trajectory, wherein the adjustment type is a first type of point position order supporting adjustment or a second type of point position order not supporting adjustment; adjusting a connection order of the first type of point between adjacent two second type of points, and determining a motion trajectory with the minimum length after adjustment as the target motion trajectory.
3. The photographing method in a casting inspection process according to claim 2, characterized in that, The acquiring of the initial motion trajectory of the mechanical arm comprises: determining a trajectory point list according to a detection requirement corresponding to the casting to be detected, wherein the trajectory point list comprises a plurality of points with an initial connection order and pose information and operation information corresponding to each point; connecting the plurality of points with line segments to obtain the initial motion trajectory, wherein the initial motion trajectory comprises a plurality of road sections.
4. The photographing method in a casting inspection process according to claim 2, wherein The optimization of the target motion trajectory according to the angle information to obtain an optimized motion trajectory comprises: determining at least one target road section set with an angle less than a preset threshold from the target motion trajectory according to the angle information, wherein each target road section set comprises two road sections forming the angle; if all points on the target road section set are the first type of points, adjusting a connection order of the points on the target road section set to a target connection order to obtain an optimized motion trajectory, wherein an angle between two new road sections formed by the target connection order is greater than or equal to the preset threshold; if there is the second type of point among the points on the target road section set, adding a new point as an adjacent point of an intermediate point on the target road section set to obtain an optimized motion trajectory, wherein an angle between any two of three new road sections formed after the new point is added is greater than or equal to the preset threshold.
5. The photographing method in a casting inspection process according to claim 1, wherein The control of the mechanical arm to move and take a photo according to the optimized motion trajectory to obtain the image information of the casting to be detected comprises: Control the mechanical arm to move according to the optimized motion trajectory, and collect the position of the mechanical arm in real time; In the case where the mechanical arm moves to a distance of a preset distance from the target point, the camera in the camera array and / or the camera carried by the mechanical arm is sent to the in-place information, and the image information of the detected casting is obtained, wherein the target point refers to any point that needs to be photographed for the detected casting, and the in-place information is used to trigger the camera in the camera array and / or the camera carried by the mechanical arm to take a photo.
6. The photographing method in a casting inspection process according to claim 5, wherein The control of the mechanical arm moving according to the optimized motion trajectory comprises: Control the mechanical arm to move in a circular arc motion instead of a corner motion at each point of the optimized motion trajectory, wherein the smoothness of the circular arc motion is greater than that of the corner motion.
7. The photographing method in a casting inspection process according to claim 1, wherein After the control of the mechanical arm moving according to the optimized motion trajectory and taking a photo to obtain the image information of the detected casting, the method further comprises: Analyzing the image information of the detected casting to obtain an analysis result, wherein the analysis result is used to determine whether the detected casting has surface defects; Control the mechanical arm to execute a subsequent detection process matched with the analysis result.
8. A photographing device in a casting inspection process, characterized by, The device comprises: An acquisition module is configured to acquire a target motion trajectory of a mechanical arm during detection of a detected casting, wherein the mechanical arm is configured to carry a camera to take a photo of the detected casting and to carry the detected casting to move in a preset camera array, and the target motion trajectory is a motion trajectory with the minimum length under the condition of meeting the detection requirements of the detected casting; A determination module is configured to determine angle information between all adjacent two road segments in the target motion trajectory according to connection order and pose information of each point in the target motion trajectory; An optimization module is configured to optimize the target motion trajectory according to the angle information to obtain an optimized motion trajectory, wherein the trajectory smoothness of the optimized motion trajectory is greater than that of the target motion trajectory; A photo taking module is configured to control the mechanical arm to move according to the optimized motion trajectory and take a photo to obtain image information of the detected casting.
9. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the photo taking method in the casting detection process according to any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the photo taking method in the casting detection process according to any one of claims 1-7. The computer program is executed by the processor to implement the photo taking method in the casting detection process according to any one of claims 1-7.
Citation Information
Patent Citations
Hub defect detection method, device and equipment and computer readable medium
CN115115631A
Flying shooting control method and system based on flying shooting robot
CN117061876A