Calligraphy copying method, device and equipment for intelligent robot and storage medium
Through real-time shooting and image recognition technology, calligraphy style features are extracted and the robotic arm is controlled, which solves the problems of existing calligraphy robots' inability to copy in real time and poor flexibility, and achieves flexible display and accurate copying of different calligraphy styles.
Patent Information
- Application Number
- CN202310439907.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2024-10-18
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.
The calligraphy writing process is captured in real time with a pre-set camera, and the pre-trained image recognition model is used to identify and segment the writing area, extract calligraphy style features, calculate the three-dimensional coordinates of the movement trajectory of the robot's end effector, and control the robotic arm to copy based on the inverse kinematics solution. .
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 CN118799768A_ABST
Abstract
Description
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 has a history of thousands of years, and countless famous calligraphers have left behind a large number of masterpieces. Calligraphy is not only a culture of the Chinese nation, but also a way of carrying the history of the Chinese nation. Nowadays, the excellent culture of the Chinese nation has received more and more attention, and the Ministry of Education plans to include calligraphy in primary and secondary school education and the high school entrance examination. However, Chinese calligraphy is ever-changing, and ordinary people need to spend a long time practicing to reach a good level of writing.
[0003] With the development of science and technology, robots have gradually entered people's lives. In robotics, many works are about robot imitation. With the miniaturization of robots, robots have been tried in the field of calligraphy writing and teaching. If you have a small calligraphy robot to imitate and demonstrate calligraphy, it can be more intuitive and greatly improve children's interest in writing. However, most of the current calligraphy robots are taught in advance, manually enter the trajectory of calligraphy, and then the robot copies the calligraphy entered in advance. The copying mode is fixed, and the style of calligraphy depends entirely on the calligraphy entered in advance. It cannot copy the writing process of calligraphy in real time, and has poor flexibility and low practical value. Summary of the invention
[0004] 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 the existing calligraphy robot cannot copy calligraphy in real time and has poor flexibility.
[0005] In order to solve the above technical problems, a technical solution adopted in the present 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 the calligraphy 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 kinematics solution, determining the motion control parameters of the robot manipulator arm according to each three-dimensional coordinate in turn, and controlling the robot to copy the calligraphy according to the motion control parameters.
[0006] 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 a hand and a 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 an image binarization method, eliminating the second area in the first feature image and retaining the first area to obtain a target feature image.
[0007] 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.
[0008] 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.
[0009] As a further improvement of the present application, calligraphy style features are extracted from each frame of the 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 the target feature image in turn to obtain a writing trajectory image between each two adjacent frames of the target feature image; 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 based on the coordinate values in the X-axis and Y-axis directions and the coordinate value in the Z-axis direction.
[0010] 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.
[0011] As a further improvement of the present application, the preset mapping method is expressed as: S=A×z, wherein S represents the area, z represents the coordinate value in the Z-axis direction, and A represents the preset parameter.
[0012] In order to solve the above technical problems, another technical solution adopted in the present 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 sequentially identify and segment the area of the calligraphy in each frame of the writing image in the order of acquisition to obtain a target feature image; an extraction module, which is used to extract the 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; a control module, which is used to determine the motion control parameters of the robot manipulator arm according to each three-dimensional coordinate based on the inverse kinematics solution, and control the robot to copy calligraphy according to the motion control parameters.
[0013] In order to solve the above-mentioned technical problems, another technical solution adopted in the present 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 an intelligent robot.
[0014] In order to solve the above technical problems, another technical solution adopted in the present application is: to provide a storage medium storing program instructions of the calligraphy copying method for an intelligent robot that can implement any of the above items.
[0015] The beneficial effect of the present application is that the calligraphy copying method for an intelligent robot of the present application captures 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 inverse kinematic 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, so it 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
[0016] Figure 1 It is a schematic diagram of a flow chart of a calligraphy copying method for an intelligent robot according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of filtering shadow noise data according to an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of extracting target image features using an image recognition model in an embodiment of the present invention;
[0019] Figure 4 is a schematic diagram of adjusting a tilted font by using an affine transformation method according to an embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of filtering salt and pepper noise data according to an embodiment of the present invention;
[0021] Figure 6 Schematic diagram of functional modules of a calligraphy copying device for an intelligent robot according to an embodiment of the present invention;
[0022] Figure 7 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;
[0023] Figure 8 It is a schematic diagram of the structure of the storage medium of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] The terms "first", "second", "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", "third" can expressly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the embodiments of this application, all directional indications (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the steps or units listed, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0026] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0027] Figure 1 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 if there are substantially the same results, the method of the present invention is not limited to the method of the present invention. Figure 1 The process sequence shown is limited. Figure 1 As shown, the calligraphy copying method for an intelligent robot comprises the following steps:
[0028] Step S101: Use a pre-set camera to shoot the calligraphy writing process in real time to obtain a writing image.
[0029] 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 shoot the calligraphy writing process. Further, in this embodiment, the camera can be installed on a handheld terminal or a fixed terminal, such as a mobile phone, a tablet computer, a laptop computer, etc. The handheld terminal or the fixed terminal can be connected to the robot through a wired network or a wireless network, so that the real-time calligraphy copying process can be realized remotely. For example, the calligrapher can shoot the calligraphy writing process through a mobile phone and send the shooting process to the robot in real time, and the robot will copy the writing process in real time.
[0030] Step S102: using a pre-trained image recognition model, 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.
[0031] It should be noted that when the camera captures the calligraphy writing process, it may capture the hand and the 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 the pen, as well as the areas belonging to the calligraphy writing, and then the calligraphy writing areas are segmented to obtain a target feature image containing the calligraphy. Among them, 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.
[0032] 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, so as to obtain continuous frame target feature images.
[0033] Furthermore, step S102 specifically includes:
[0034] 1. Input the writing image into a pre-trained image recognition model to identify a first area including the writing calligraphy and a second area including the hand and the pen in the writing image.
[0035] 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.
[0036] 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.
[0037] Specifically, in the process of using a camera to collect calligraphy images, some noise interference is usually generated, which will affect the accuracy of subsequent calligraphy copying. In order to prevent the shadow noise in the writing image from affecting the recognition accuracy of the image recognition model, in this embodiment, the shadow noise data in the writing image is filtered before the writing 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 writing image by image binarization. For details, please refer to Figure 2 An example of filtering shadow noise data in .
[0038] 2. Perform image segmentation on the first area and the second area in the writing image, and then perform mask superposition processing on the second area to obtain a first feature image.
[0039] 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.
[0040] Specifically, Figure 3 As shown, 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 preset threshold value, thereby eliminating the hand and pen in the second area, and obtaining a target feature image including the first area.
[0041] 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.
[0042] Specifically, when the camera shoots the calligraphy writing process, its shooting angle is not vertical, resulting in the photographed text being tilted. In order to accurately obtain the style characteristics of the calligraphy later, such as Figure 4 As shown, in this embodiment, when the text in the target feature image is tilted, the direction of the text in the target feature image is adjusted to an angle perpendicular to the shooting angle of the camera based on an affine transformation.
[0043] Step S103: 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.
[0044] 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 according to the calligraphy style feature analysis.
[0045] Furthermore, step S103 specifically includes:
[0046] 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.
[0047] 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.
[0048] 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.
[0049] Specifically, the frame difference method may cause salt and pepper noise near the current frame track. Therefore, this embodiment uses the second preset method to filter the salt and pepper noise data in the writing track image. In this embodiment, the second preset method is image binarization, such as Figure 5 As shown, Figure 5 (A) is a writing trajectory image including salt and pepper noise data. Figure 5 (B) is the writing trajectory image after filtering out the salt and pepper noise data.
[0050] 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.
[0051] Specifically, after obtaining the writing track image, confirm the center point of the writing track in the writing track image, and then obtain the coordinates corresponding to the center point. It should be understood that the shooting interval between two adjacent frames of images is extremely short, so the change between two adjacent frames of images is small. This embodiment constructs the smallest circle around the writing track, and then uses the center of the circle as the center point of the writing track, and then obtains the coordinate value of the center point in the pre-constructed rectangular coordinate system.
[0052] 3. Calculate the area of the writing track in the writing track image.
[0053] Specifically, after acquiring the writing track image, this embodiment calculates the area of the writing track in the writing track image.
[0054] 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.
[0055] It should be noted that there are many ways to control the movement of the robot end effector, one of which is to perform kinematic inverse solution based on the three-dimensional coordinates input by the user, obtain the motion control parameters of the robot mechanical arm, and then control the robot movement according to the motion control parameters. Generally, the thickness of the strokes of the robot writing font is related to the displacement of the robot mechanical arm in the Z-axis direction. When the mechanical arm drives the brush to move a large distance toward the paper surface, the front end of the brush presses on the paper surface 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 surface, the front end of the brush presses on the paper surface 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 end effector in the Z-axis direction, so that after obtaining the area of the writing trajectory, the coordinate value of the robot end effector in the Z-axis direction is obtained according to the area mapping.
[0056] Furthermore, the preset mapping method is expressed as: S=A×z, wherein 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.
[0057] 5. Obtain three-dimensional coordinates based on the coordinate values in the X-axis, Y-axis direction and the coordinate values in the Z-axis direction.
[0058] 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.
[0059] 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.
[0060] 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 mechanical arm, and then the robot's motion is controlled based on the motion control parameters to complete the copying of the calligraphy.
[0061] The calligraphy copying method for an intelligent robot in an embodiment of the present invention captures a writing image of the calligraphy writing process in real time, extracts calligraphy style features from multiple consecutive 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 photographed calligraphy according to the three-dimensional coordinates by using an inverse kinematic solution. Different calligraphy styles can be flexibly displayed, and the copying method is not limited to the content taught in advance by the robot, so it 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.
[0062] Figure 6 Schematic diagram of the functional modules of the calligraphy copying device for intelligent robots according to an embodiment of the present invention. Figure 6 As shown, the calligraphy copying device 20 for an intelligent robot includes a shooting module 21 , a preprocessing module 22 , an extraction module 23 and a control module 24 .
[0063] The shooting module 21 is used to shoot the calligraphy writing process in real time using a preset camera to obtain a writing image;
[0064] A preprocessing module 22 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;
[0065] 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 according to the calligraphy style feature analysis;
[0066] The control module 24 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.
[0067] 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 the 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, retaining the first area, and obtaining the target feature image.
[0068] Optionally, before the preprocessing module 22 performs the operation of inputting the writing image into a pre-trained image recognition model, it is also used to: filter shadow noise data in the writing image based on a first preset method.
[0069] 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 writing image in the order of acquisition to obtain a 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 for: 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.
[0070] Optionally, the extraction module 23 performs operations of 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, specifically including: performing frame difference method on each two adjacent frames of the target feature image in turn to obtain the writing trajectory image between each two adjacent frames of the target feature image; 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.
[0071] Optionally, after the extraction module 23 performs the operation of obtaining the writing track image between each two adjacent frames of target feature images, it is further configured to: filter the salt and pepper noise data in the writing track image based on a second preset manner.
[0072] Optionally, the preset mapping method is expressed as: S=A×z, wherein S represents the area, z represents the coordinate value in the Z-axis direction, and A represents the preset parameter.
[0073] For other details about the technical solutions for implementing each module in the calligraphy copying device for an intelligent robot in the above-mentioned embodiment, please refer to the description of the calligraphy copying method for an intelligent robot in the above-mentioned embodiment, which will not be repeated here.
[0074] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0075] See also Figure 7 , Figure 7FIG. 1 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 7 As shown, 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.
[0076] The processor 31 may also be referred to as a CPU (Central Processing Unit). The processor 31 may be an integrated circuit chip having 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 devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0077] See also Figure 8 , Figure 8 Schematic diagram of the structure of the storage medium of the 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 to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (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, a server, a mobile phone, or a tablet.
[0078] In the several embodiments provided in the present application, it should be understood that the disclosed computer equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, 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 interfaces, devices or units, which can be electrical, mechanical or other forms.
[0079] In addition, each functional unit in each embodiment 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 integrated unit 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 by using the contents of the specification and drawings of this application, or directly or indirectly used in other related technical fields, is 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; Obtaining 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, wherein 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: The 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
