Calligraphy copying method and apparatus for intelligent robot, and device and storage medium
Through real-time shooting and image recognition technology, calligraphy style features are extracted and the robot's end effector is controlled to achieve flexible copying of different calligraphy styles, solving the problems of existing calligraphy robots being unable to copy in real time and having poor flexibility, and improving practical value.
Patent Information
- Application Number
- PCT/CN2023/137196
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-12
- Filing Date
- 2023-12-07
- Publication Date
- 2024-10-17
AI Technical Summary
Existing calligraphy robots cannot copy calligraphy in real time, have poor flexibility, cannot adapt to different calligraphy styles, and have low practical value.
A pre-set camera is used to capture the calligraphy writing process in real time, a pre-trained image recognition model is used to identify and segment the writing area, and calligraphy style features are extracted. The three-dimensional coordinates of the robot's end effector are determined through the inverse kinematic solution to achieve real-time copying.
It realizes the flexible display of different calligraphy styles. The copying method is not limited to teaching content in advance, and the order of calligraphy strokes can be accurately copied, which improves the practical value.
Smart Images

Figure CN2023137196_17102024_PF_FP_ABST
Abstract
Description
Calligraphy copying method, device, equipment and storage medium for intelligent robot Technical Field
[0001] The present application relates to the technical field of intelligent robots, and in particular to a calligraphy copying method, device, equipment and storage medium for intelligent robots. Background Art
[0002] Chinese calligraphy boasts a history spanning thousands of years, with countless renowned calligraphers leaving behind a wealth of masterpieces. Calligraphy is not only a cultural heritage of the Chinese nation but also a vehicle for its history. Today, this exceptional Chinese culture is receiving increasing attention, with the Ministry of Education planning to incorporate calligraphy into elementary and middle school education and the high school entrance exam. However, Chinese calligraphy is ever-changing, and achieving a high level of proficiency requires considerable practice.
[0003] With the development of science and technology, robots have gradually entered people's lives. In robotics, many studies focus on robot imitation. With the miniaturization of robots, robots have been used in calligraphy writing and teaching. If a small calligraphy robot can imitate and demonstrate calligraphy, it can be more intuitive and greatly increase children's interest in calligraphy. Technical issues
[0004] However, most of the current calligraphy robots are taught in advance, with the calligraphy trajectory manually entered, and then the robot copies the calligraphy entered in advance. The copying pattern is fixed, and the style of the calligraphy is completely dependent on the calligraphy entered in advance. It cannot copy the calligraphy writing process in real time, and has poor flexibility and low practical value. Technical Solutions
[0005] In view of this, the present application provides a calligraphy copying method, device, equipment and storage medium for an intelligent robot to solve the problem that existing calligraphy robots cannot copy calligraphy in real time and have poor flexibility.
[0006] In order to solve the above technical problems, a technical solution adopted in this application is: to provide a calligraphy copying method for an intelligent robot, which includes: using a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image; using a pre-trained image recognition model to sequentially identify and segment the area of calligraphy writing in each frame of the writing image in the order of acquisition to obtain a target feature image; extracting calligraphy style features from each frame of the target feature image in turn, and obtaining the three-dimensional coordinates of the motion trajectory of the robot end effector based on the calligraphy style feature analysis; based on the inverse kinematic solution, determining the motion control parameters of the robot manipulator according to each three-dimensional coordinate in turn, and controlling the robot to copy calligraphy according to the motion control parameters.
[0007] As a further improvement of the present application, a pre-trained image recognition model is used to sequentially identify and segment the areas of calligraphy in each frame of a writing image in the order of acquisition to obtain a target feature image, including: inputting the writing image into a pre-trained image recognition model to identify a first area including the calligraphy and a second area including the hand and the pen in the writing image; performing image segmentation on the first area and the second area in the writing image, and then performing mask superposition processing on the second area to obtain a first feature image; based on image binarization, eliminating the second area in the first feature image and retaining the first area to obtain a target feature image.
[0008] As a further improvement of the present application, before inputting the writing image into a pre-trained image recognition model, it also includes: filtering shadow noise data in the writing image based on a first preset method.
[0009] As a further improvement of the present application, after obtaining the target feature image, it also includes: when the text in the target feature image is tilted, adjusting the direction of the tilted text in the target feature image to a preset direction based on an affine transformation.
[0010] As a further improvement of the present application, calligraphy style features are extracted from each frame of target feature image in turn, and the three-dimensional coordinates of the motion trajectory of the robot end effector are obtained based on the calligraphy style feature analysis, including: performing frame difference method on each two adjacent frames of target feature images in turn to obtain a writing trajectory image between each two adjacent frames of target feature images; obtaining the coordinates of the center point of the writing trajectory image to obtain the coordinate values in the X-axis and Y-axis directions; calculating the area of the writing trajectory in the writing trajectory image; based on a preset mapping method, obtaining the coordinate value of the robot end effector in the Z-axis direction according to area mapping; and obtaining three-dimensional coordinates based on the coordinate values in the X-axis and Y-axis directions and the coordinate value in the Z-axis direction.
[0011] As a further improvement of the present application, after obtaining the writing track image between each two adjacent frames of target feature images, it also includes: filtering the salt and pepper noise data in the writing track image based on a second preset method.
[0012] As a further improvement of the present application, the preset mapping method is expressed as: S=A×z, where S represents the area, z represents the coordinate value in the Z-axis direction, and A represents the preset parameter.
[0013] In order to solve the above technical problems, another technical solution adopted in this application is: to provide a calligraphy copying device for an intelligent robot, which includes: a shooting module, which is used to use a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image; a preprocessing module, which is used to use a pre-trained image recognition model to identify and segment the area of calligraphy writing in each frame of writing image in the order of acquisition to obtain a target feature image; an extraction module, which is used to extract calligraphy style features from each frame of target feature image in turn, and obtain the three-dimensional coordinates of the motion trajectory of the robot end effector based on the calligraphy style feature analysis; a control module, which is used to determine the motion control parameters of the robot manipulator according to each three-dimensional coordinate based on the inverse kinematic solution, and control the robot to copy calligraphy according to the motion control parameters.
[0014] In order to solve the above technical problems, another technical solution adopted in this application is: to provide a computer device, which includes a processor and a memory coupled to the processor, wherein program instructions are stored in the memory, and when the program instructions are executed by the processor, the processor executes the steps of any one of the above-mentioned calligraphy copying methods for intelligent robots.
[0015] In order to solve the above technical problems, another technical solution adopted in this application is: to provide a storage medium storing program instructions of a calligraphy copying method for an intelligent robot that can implement any of the above items. Beneficial effects
[0016] The beneficial effects of the present application are as follows: the calligraphy copying method for an intelligent robot of the present application shoots the writing image of the calligraphy writing process in real time, extracts the calligraphy style features from the continuous multi-frame writing images, and then extracts the three-dimensional coordinates of the motion trajectory of the robot end effector from the calligraphy style features, and then uses the kinematic inverse solution method to control the robot in real time to copy the photographed calligraphy according to the three-dimensional coordinates. It can flexibly display different calligraphy styles, and the copying method is not limited to the content taught in advance by the robot, and has higher practical value. Moreover, the real-time copying method copies in the order in which the writing images are acquired, thereby accurately copying the stroke order of the calligraphy and avoiding displaying the wrong calligraphy writing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] FIG1 is a schematic flow chart of a calligraphy copying method for an intelligent robot according to an embodiment of the present invention;
[0018] FIG2 is a schematic diagram of filtering shadow noise data according to an embodiment of the present invention;
[0019] FIG3 is a schematic diagram of extracting target image features using an image recognition model according to an embodiment of the present invention;
[0020] FIG4 is a schematic diagram of adjusting a tilted font using an affine transformation method according to an embodiment of the present invention;
[0021] FIG5 is a schematic diagram of filtering salt and pepper noise data according to an embodiment of the present invention;
[0022] FIG6 is a schematic diagram of the functional modules of a calligraphy copying device for an intelligent robot according to an embodiment of the present invention;
[0023] 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention;
[0024] FIG8 is a schematic structural diagram of a storage medium according to an embodiment of the present invention. Modes for Carrying Out the Invention
[0025] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0026] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features identified. Therefore, features identified as "first," "second," or "third" may explicitly or implicitly include at least one of such features. In the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined. All directional designations in the embodiments of this application (such as up, down, left, right, front, back, etc.) are intended only to illustrate the relative positional relationships and movement of components in a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional designations will also change accordingly. Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to such process, method, product, or apparatus.
[0027] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] FIG1 is a flow chart of a calligraphy copying method for an intelligent robot according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in FIG1 if substantially the same result is achieved. As shown in FIG1 , the calligraphy copying method for an intelligent robot includes the following steps:
[0029] Step S101: Using a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image.
[0030] It should be noted that the purpose of this embodiment is to copy calligraphy in real time, so it is necessary to use a pre-set camera to capture the calligraphy writing process. Furthermore, in this embodiment, the camera can be installed on a handheld terminal or a fixed terminal, such as a mobile phone, tablet computer, laptop computer, etc. The handheld terminal or fixed terminal can be connected to the robot via a wired network or a wireless network, so that the real-time calligraphy copying process can be achieved remotely. For example, the calligrapher can use a mobile phone to capture the calligraphy writing process and send the captured process to the robot in real time, and the robot will copy the calligraphy in real time based on the writing process.
[0031] Step S102: using a pre-trained image recognition model, sequentially identifying and segmenting the calligraphy areas in each frame of the writing image in the order of acquisition to obtain a target feature image.
[0032] It should be noted that when the camera captures the calligraphy writing process, it may capture the hand and pen, resulting in the inability to accurately obtain the calligraphy features from the writing image. Therefore, in this embodiment, after obtaining the writing image, the writing image is input into a pre-trained image recognition model to identify the areas in the image belonging to the hand and pen, as well as the areas belonging to the calligraphy writing. The calligraphy writing area is then segmented to obtain a target feature image containing the calligraphy. The image recognition model is implemented based on a deep neural network, such as a convolutional neural network, and the image recognition model is iteratively trained using pre-labeled sample data until the image recognition model reaches a preset accuracy.
[0033] Specifically, in this embodiment, the continuous frame writing images captured in real time are sequentially input into the image recognition model in the order of acquisition for processing, thereby obtaining the continuous frame target feature images.
[0034] Furthermore, step S102 specifically includes:
[0035] 1. Input the writing image into a pre-trained image recognition model to identify a first region including the writing calligraphy and a second region including the hand and the pen.
[0036] Specifically, the acquired writing image is input into the image recognition model to recognize the second area corresponding to the hand and the pen in the writing image.
[0037] Furthermore, before the step of inputting the writing image into a pre-trained image recognition model, the method further includes: filtering shadow noise data in the writing image based on a first preset method.
[0038] Specifically, when using a camera to capture calligraphy images, some noise interference is usually generated, which affects the accuracy of subsequent calligraphy copying. To prevent shadow noise in the calligraphy image from affecting the recognition accuracy of the image recognition model, in this embodiment, the shadow noise data in the calligraphy image is filtered before the calligraphy image is input into the image recognition model for recognition. Among them, the first preset method is preferably an image binarization method, which filters out the shadow noise in the calligraphy image through image binarization. For details, please refer to the example of filtering shadow noise data in Figure 2.
[0039] 2. Perform image segmentation on the first region and the second region in the writing image, and then perform mask superposition processing on the second region to obtain a first feature image.
[0040] 3. Based on the image binarization method, the second area in the first feature image is eliminated, the first area is retained, and the target feature image is obtained.
[0041] Specifically, as shown in Figure 3, this embodiment performs instance segmentation on the first area and the second area, then performs mask overlay processing on the second area to distinguish the first area from the second area, and then performs image binarization processing on the first feature image according to a pre-set threshold value, thereby eliminating the hand and pen in the second area, and obtaining a target feature image including the first area.
[0042] Furthermore, after obtaining the target feature image, the method further includes: when the text in the target feature image is tilted, adjusting the direction of the tilted text in the target feature image to a preset direction based on an affine transformation.
[0043] Specifically, when the camera is shooting the calligraphy writing process, its shooting angle is not vertical, causing the photographed text to appear tilted. In order to enable the subsequent accurate acquisition of the style characteristics of the calligraphy, as shown in Figure 4, this embodiment adjusts the direction of the text in the target feature image to an angle perpendicular to the camera shooting angle based on affine transformation when the text in the target feature image is tilted.
[0044] Step S103: extracting calligraphy style features from each frame of target feature image in turn, and obtaining the three-dimensional coordinates of the motion trajectory of the robot end effector based on the calligraphy style feature analysis.
[0045] Specifically, the calligraphy style features include the order of calligraphy strokes, the starting point of the strokes, etc. After obtaining the target feature image, the calligraphy style features are extracted from the target feature image, and then the three-dimensional coordinates of the motion trajectory of the robot end effector are obtained based on the calligraphy style feature analysis.
[0046] Furthermore, step S103 specifically includes:
[0047] 1. Perform frame difference method on each two adjacent frames of target feature images in turn to obtain the writing track image between each two adjacent frames of target feature images.
[0048] Specifically, this embodiment uses a frame difference method to perform a differential operation on two adjacent frames of target feature images to obtain the outline of the writing track between the two frames of target feature images, and uses the outline as the writing track image.
[0049] Furthermore, after the step of obtaining the writing track image between each two adjacent frames of target feature images, the method further includes: filtering salt and pepper noise data in the writing track image based on a second preset method.
[0050] Specifically, the frame difference method can cause salt and pepper noise to be generated near the current frame's trajectory. Therefore, this embodiment uses a second preset method to filter the salt and pepper noise data from the writing trajectory image. In this embodiment, the second preset method is image binarization. As shown in Figure 5, Figure 5 (A) shows a writing trajectory image including salt and pepper noise data, and Figure 5 (B) shows a writing trajectory image after the salt and pepper noise data has been filtered out.
[0051] 2. Get the coordinates of the center point of the writing track image and obtain the coordinate values in the X-axis and Y-axis directions.
[0052] Specifically, after obtaining the writing track image, the center point of the writing track in the writing track image is determined, and then the coordinates corresponding to the center point are obtained. It should be understood that the shooting interval between two adjacent frames of image is extremely short, and therefore the changes between the two adjacent frames of image are small. This embodiment constructs a minimum circular ring around the writing track, and then uses the center of the circular ring as the center point of the writing track, and then obtains the coordinate values of the center point in the pre-constructed rectangular coordinate system.
[0053] 3. Calculate the area of the writing track in the writing track image.
[0054] Specifically, after acquiring the writing track image, this embodiment calculates the area of the writing track in the writing track image.
[0055] 4. Based on the preset mapping method, the coordinate value of the robot end effector in the Z-axis direction is obtained according to the area mapping.
[0056] It should be noted that there are many ways to control the movement of the robot's end effector. One of them is to perform kinematic inverse solution based on the three-dimensional coordinates input by the user to obtain the motion control parameters of the robot's mechanical arm, and then control the robot's movement based on the motion control parameters. Generally, the thickness of the strokes of the robot's handwriting is related to the displacement of the robot's mechanical arm in the Z-axis direction. When the mechanical arm drives the brush to move a large distance toward the paper, the front end of the brush presses on the paper to a large extent, and the written strokes are thicker; when the mechanical arm drives the brush to move a small distance toward the paper, the front end of the brush presses on the paper to a small extent, and the written strokes are thinner. Based on this, this embodiment pre-constructs a mapping relationship between the area of the writing trajectory and the coordinate value of the robot's end effector in the Z-axis direction, so that after obtaining the area of the writing trajectory, the coordinate value of the robot's end effector in the Z-axis direction is obtained according to the area mapping.
[0057] Furthermore, the preset mapping method is expressed as: S=A×z, where S represents the area, z represents the coordinate value in the Z-axis direction, and A represents a preset parameter, which can be obtained through experiments.
[0058] 5. Obtain three-dimensional coordinates based on the coordinate values in the X-axis and Y-axis directions and the coordinate values in the Z-axis direction.
[0059] Specifically, after obtaining the coordinate values in the X-axis, Y-axis, and Z-axis directions, the coordinate values in the X-axis, Y-axis, and Z-axis directions are used as the three-dimensional coordinates of the robot end effector.
[0060] Step S104: Based on the inverse kinematics solution, the motion control parameters of the robot arm are determined according to each three-dimensional coordinate in turn, and the robot is controlled to copy calligraphy according to the motion control parameters.
[0061] Specifically, after obtaining the three-dimensional coordinates of the subsequent motion trajectory of the robot's end effector, the kinematic inverse solution is performed based on the three-dimensional coordinates to obtain the motion control parameters of the robot's manipulator arm, and then the robot's motion is controlled according to the motion control parameters to complete the calligraphy copying.
[0062] The calligraphy copying method for an intelligent robot in an embodiment of the present invention captures writing images of the calligraphy writing process in real time, extracts calligraphy style features from multiple consecutive frames of writing images, and then extracts the three-dimensional coordinates of the motion trajectory of the robot's end effector from the calligraphy style features. Then, the robot is controlled in real time to copy the captured calligraphy according to the three-dimensional coordinates using the inverse kinematics method. The method can flexibly display different calligraphy styles, and the copying method is not limited to the content taught in advance by the robot, and has higher practical value. Moreover, the real-time copying method copies in the order in which the writing images are acquired, thereby accurately copying the stroke order of the calligraphy and avoiding displaying the wrong calligraphy writing method.
[0063] Figure 6 is a functional module diagram of a calligraphy copying device for an intelligent robot according to an embodiment of the present invention. As shown in Figure 6 , the calligraphy copying device 20 for an intelligent robot includes a shooting module 21 , a pre-processing module 22 , an extraction module 23 and a control module 24 .
[0064] The shooting module 21 is used to use a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image;
[0065] A pre-processing module 22 is used to use a pre-trained image recognition model to sequentially identify and segment the calligraphy area in each frame of the writing image in the order in which it was acquired, thereby obtaining a target feature image;
[0066] An extraction module 23 is used to extract calligraphy style features from each frame of the target feature image in turn, and obtain the three-dimensional coordinates of the motion trajectory of the robot end effector based on the calligraphy style features;
[0067] The control module 24 is used to determine the motion control parameters of the robot arm according to each three-dimensional coordinate based on the inverse kinematic solution, and control the robot to copy calligraphy according to the motion control parameters.
[0068] Optionally, the preprocessing module 22 uses a pre-trained image recognition model to sequentially identify and segment the areas of calligraphy in each frame of the writing image in the order of acquisition to obtain a target feature image, specifically including: inputting the writing image into a pre-trained image recognition model to identify a first area including the calligraphy and a second area including the hand and the pen in the writing image; performing image segmentation on the first area and the second area in the writing image, and then performing mask superposition processing on the second area to obtain a first feature image; based on the image binarization method, eliminating the second area in the first feature image and retaining the first area to obtain a target feature image.
[0069] Optionally, before the pre-processing module 22 inputs the writing image into a pre-trained image recognition model, it is further configured to: filter shadow noise data in the writing image based on a first preset method.
[0070] Optionally, the preprocessing module 22 uses a pre-trained image recognition model to identify and segment the calligraphy areas in each frame of the writing image in the order of acquisition to obtain the target feature image, or performs an image binarization-based method to eliminate the second area in the first feature image and retain the first area to obtain the target feature image. It is also used to: when the text in the target feature image is tilted, adjust the direction of the tilted text in the target feature image to a preset direction based on an affine transformation.
[0071] Optionally, the extraction module 23 performs operations of extracting calligraphy style features from each frame of target feature image in turn, and obtaining the three-dimensional coordinates of the motion trajectory of the robot end effector based on the calligraphy style feature analysis, specifically including: performing frame difference method on each two adjacent frames of target feature images in turn to obtain the writing trajectory image between each two adjacent frames of target feature images; obtaining the coordinates of the center point of the writing trajectory image to obtain the coordinate values in the X-axis and Y-axis directions; calculating the area of the writing trajectory in the writing trajectory image; based on a preset mapping method, obtaining the coordinate value of the robot end effector in the Z-axis direction according to the area mapping; and obtaining the three-dimensional coordinates according to the coordinate values in the X-axis and Y-axis directions and the coordinate value in the Z-axis direction.
[0072] Optionally, after the extraction module 23 obtains the writing track image between each two adjacent frames of target feature images, it is further configured to filter salt and pepper noise data in the writing track image based on a second preset method.
[0073] Optionally, the preset mapping method is expressed as: S=A×z, where S represents the area, z represents the coordinate value in the Z-axis direction, and A represents the preset parameter.
[0074] For other details about the technical solutions for implementing each module in the calligraphy copying device for an intelligent robot in the above embodiment, please refer to the description of the calligraphy copying method for an intelligent robot in the above embodiment, which will not be repeated here.
[0075] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.
[0076] Please refer to Figure 7, which is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. As shown in Figure 7, the computer device 30 includes a processor 31 and a memory 32 coupled to the processor 31. The memory 32 stores program instructions. When the program instructions are executed by the processor 31, the processor 31 executes the steps of the calligraphy copying method for an intelligent robot described in any of the above embodiments.
[0077] The processor 31 may also be referred to as a CPU (Central Processing Unit). The processor 31 may be an integrated circuit chip with signal processing capabilities. The processor 31 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor may be a microprocessor or any conventional processor.
[0078] Refer to Figure 8, which is a schematic diagram of the structure of the storage medium of an embodiment of the present invention. The storage medium of the embodiment of the present invention stores program instructions 41 that can implement the above-mentioned calligraphy copying method for an intelligent robot, wherein the program instructions 41 can be stored in the above-mentioned storage medium in the form of a software product, including a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a computer device such as a computer, server, mobile phone, or tablet.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed computer devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0080] In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A calligraphy copying method for an intelligent robot, characterized in that: It includes: Using a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image; Using the pre-trained image recognition model, the calligraphy writing area in each frame of the writing image is identified and segmented in the order of acquisition to obtain the target feature image; Extracting calligraphy style features from each frame of the target feature image in turn, and obtaining the three-dimensional coordinates of the motion trajectory of the robot end effector according to the calligraphy style feature analysis; Based on the inverse kinematics solution, the motion control parameters of the robot arm are determined according to each three-dimensional coordinate in turn, and the robot is controlled to copy calligraphy according to the motion control parameters.
2. The calligraphy copying method for an intelligent robot according to claim 1, characterized in that: The method uses a pre-trained image recognition model to sequentially identify and segment the calligraphy writing area in each frame of the writing image in the order of acquisition to obtain a target feature image, including: Inputting the writing image into the pre-trained image recognition model to identify a first region including the writing calligraphy and a second region including the hand and the pen in the writing image; Performing image segmentation on the first region and the second region in the writing image, and then performing mask superposition processing on the second region to obtain a first feature image; Based on the image binarization method, the second area in the first feature image is eliminated, the first area is retained, and the target feature image is obtained.
3. The calligraphy copying method for an intelligent robot according to claim 2, characterized in that: Before inputting the written image into the pre-trained image recognition model, the method further includes: The shadow noise data in the writing image is filtered based on a first preset manner.
4. The calligraphy copying method for an intelligent robot according to claim 1 or 2, characterized in that: After obtaining the target feature image, the method further includes: When the text in the target feature image is tilted, the direction of the tilted text in the target feature image is adjusted to a preset direction based on an affine transformation.
5. The calligraphy copying method for an intelligent robot according to claim 1, characterized in that: The method sequentially extracts calligraphy style features from each frame of the target feature image, and obtains the three-dimensional coordinates of the motion trajectory of the robot end effector according to the calligraphy style feature analysis, including: Performing frame difference method on each two adjacent frames of target feature images in turn to obtain a writing track image between each two adjacent frames of target feature images; Obtain the coordinates of the center point of the writing track image to obtain the coordinate values in the X-axis and Y-axis directions; Calculating the area of the writing track in the writing track image; Based on a preset mapping method, the coordinate value of the robot end effector in the Z-axis direction is obtained according to the area mapping; The three-dimensional coordinates are obtained according to the coordinate values in the X-axis and Y-axis directions and the coordinate value in the Z-axis direction.
6. The calligraphy copying method for an intelligent robot according to claim 5, characterized in that: After obtaining the writing track image between each two adjacent frames of target feature images, the method further includes: The salt and pepper noise data in the writing trajectory image is filtered based on a second preset manner.
7. The calligraphy copying method for an intelligent robot according to claim 5, characterized in that: The preset mapping method is expressed as: S=A×z, where S represents the area, z represents the coordinate value in the Z-axis direction, and A represents the preset parameter.
8. A calligraphy copying device for an intelligent robot, characterized in that: It includes: A shooting module is used to shoot the calligraphy writing process in real time using a pre-set camera to obtain a writing image; A preprocessing module is used to use a pre-trained image recognition model to sequentially identify and segment the calligraphy writing area in each frame of the writing image in the order of acquisition to obtain a target feature image; An extraction module is used to extract calligraphy style features from each frame of the target feature image in turn, and obtain the three-dimensional coordinates of the motion trajectory of the robot end effector according to the calligraphy style feature analysis; The control module is used to determine the motion control parameters of the robot arm according to each three-dimensional coordinate in turn based on the inverse kinematics solution, and control the robot to copy calligraphy according to the motion control parameters.
9. A computer device, characterized in that: The computer device includes a processor and a memory coupled to the processor, wherein program instructions are stored in the memory. When the program instructions are executed by the processor, the processor executes the steps of the calligraphy copying method for an intelligent robot as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The device stores program instructions capable of implementing the calligraphy copying method for an intelligent robot as described in any one of claims 1-7.
Citation Information
Patent Citations
Stroke segmentation method based on writing video and calligraphy copying guiding method
CN108764070A
Robot multi-style calligraphy copy method based on force sense learning
CN109664300A
Hand-writing copying method and device for robot, and robot
CN111152234A
Aerial handwriting recognition system and method based on depth camera
CN111950514A
Calligraphy font and text content synchronous identification method and system
CN113408418A
Cited By
Semi-autonomous calligraphy copying implementation method of multi-degree-of-freedom calligraphy robot
CN119407808A
