AR-based calligraphy practicing auxiliary method and device, equipment and storage medium
By identifying and locating the target paper in the AR calligraphy auxiliary technology and using the camera to detect the calligraphy trajectory, the problem of high equipment requirements and complexity in the existing technology is solved, and the calligraphy auxiliary function on any camera projection device is realized. Improved usability and user experience.
Patent Information
- Application Number
- CN202310165846.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
Existing AR-based calligraphy assistance technology requires the additional use of dual cameras and LED infrared fill lights, and requires visible light filters when used, resulting in a complicated implementation process and poor practicality.
By identifying and locating the target paper in the projection area, using the camera to detect the user's calligraphy practice trajectory, and analyzing the trajectory and content to be practiced, the calligraphy auxiliary function is realized, reducing the requirements for equipment and avoiding the need for additional dual cameras and Demand for LED infrared fill light.
It simplifies the implementation complexity of calligraphy auxiliary technology, improves the practicality of the device, and can be applied on any projection device with a camera, providing better user experience and convenience.
Smart Images

Figure CN118550394A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to an AR-based calligraphy assistance method, device, equipment and storage medium. Background Art
[0002] Currently, projection equipment is becoming more and more portable and can be used for AR (Augmented Reality) related applications. For example, AR technology uses a camera to capture specific objects or images for superposition, and uses a computer to build a model and superimpose it on the real environment. In simple terms, it allows virtual things to be combined with real scenes and displayed on the screen synchronously.
[0003] In the prior art, there is a method of using projection equipment to assist in calligraphy practice based on AR technology. Demonstratively, dual cameras and LED (light-emitting diode) infrared fill lights are needed. With a visible light filter in front of the camera and the LED infrared fill light, a control menu is projected on a plane and gesture action images are captured in real time. Corresponding gesture control is performed according to the gesture action images, and a writing animation of the characters to be practiced is projected in the calligraphy practice area, and the characters written by the user are compared and analyzed with the animation to give a corresponding score.
[0004] However, using the existing technology requires the use of additional dual cameras and LED infrared fill lights and a visible light filter is required to perform the above subsequent steps. In actual applications, the overall implementation process is relatively complicated. Summary of the invention
[0005] The purpose of this application is to provide an AR-based calligraphy assistance method, device, equipment and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem of complex implementation of AR-based calligraphy assistance in the prior art.
[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0007] In a first aspect, the present application provides an AR-based calligraphy assistance method, the method comprising:
[0008] In response to the calligraphy practice instruction, identifying and locating a paper area of the target paper in the projection area;
[0009] Projecting the content to be practiced onto the paper area;
[0010] Detecting the user's calligraphy practice track on the target paper;
[0011] According to the calligraphy practice track and the content to be practiced, the analysis result of this calligraphy practice is obtained.
[0012] Optionally, in response to the calligraphy practice instruction, identifying and locating a paper area of the target paper in the projection area includes:
[0013] In response to the calligraphy practice instruction, calling a camera device to capture an image of the projection area;
[0014] Detecting, according to the image of the projection area, whether the projection area includes the target paper;
[0015] If the projection area includes the target paper, a paper area of the target paper in the projection area is identified and located.
[0016] Optionally, detecting whether the projection area includes the target paper according to the image of the projection area includes:
[0017] According to the image of the projection area, an edge detection algorithm and a contour extraction algorithm are used to determine whether there is a target paper in the image of the projection area;
[0018] If the target paper exists, detecting whether the color parameters of the target paper meet the preset conditions;
[0019] If the color parameter meets a preset condition, it is determined that the projection area includes the target paper, and the color parameter is recorded.
[0020] Optionally, if the projection area includes the target paper, identifying and locating a paper area of the target paper in the projection area includes:
[0021] If the projection area includes the target paper, obtaining the preset position coordinates of the edge of the paper area;
[0022] According to the preset position coordinates of the edge, the content to be practiced is projected onto the paper area.
[0023] Optionally, the step of determining whether the image of the projection area includes:
[0024] Using an edge detection algorithm to detect the edge of the paper in the image of the projection area;
[0025] If the edge of the paper is detected, the outline of the paper is extracted using the outline extraction algorithm;
[0026] If the paper outline is extracted, it is determined that the target paper exists in the image of the projection area.
[0027] Optionally, the method further includes:
[0028] Continuously detecting the preset position coordinates of the edge of the target paper;
[0029] If the edge preset position coordinates move, the projection area is adjusted according to the moved edge preset position.
[0030] Optionally, if the edge preset position coordinates move, adjusting the projection area according to the moved edge preset position includes:
[0031] If the preset edge position coordinates move, determine the area to be merged in which the similarity of the RGB color values in the projection area and the paper area meets the preset conditions according to the color parameters;
[0032] Merging the area to be merged in the projection area and the area to be merged in the paper area into a target area;
[0033] Locate the nearest neighbor relationship between the quadrilateral corner points of the target area and the edge preset position coordinates, and determine new edge preset position coordinates of the target paper;
[0034] The projection area is adjusted according to the new preset position coordinates of the edge of the target paper.
[0035] Optionally, after detecting whether the projection area includes the target paper according to the image of the projection area, the method further includes:
[0036] If the projection area includes the target paper, converting the image corresponding to the target paper into the same proportion as a preset template, wherein the preset template is a copybook template including the content to be practiced;
[0037] Detecting the content of the target paper in the image of the projection area, and recording the words and strokes of the content to be practiced;
[0038] The step of obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes:
[0039] The analysis result of this calligraphy practice is obtained according to the calligraphy practice track and the characters and strokes of the content to be practiced.
[0040] Optionally, the detecting of the user's calligraphy practice track on the target paper includes:
[0041] Calling a camera device to collect an image of the projection area;
[0042] According to the image of the projection area, detecting whether the image of the projection area changes;
[0043] If the image in the projection area changes, it is determined that the user starts practicing calligraphy, and the calligraphy practice trajectory is collected.
[0044] Optionally, obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes:
[0045] If no change in the image of the projection area is detected within a preset time period, it is determined that the user has finished practicing calligraphy, and an analysis result of this practice is obtained based on the calligraphy practice trajectory and the content to be practiced.
[0046] Optionally, projecting the content to be practiced onto the paper area includes:
[0047] Display at least one calligraphy practice mode;
[0048] In response to a user selection operation, determining a target calligraphy practice mode;
[0049] According to the projection strategy of the target calligraphy practice mode, projecting the content to be practiced onto the paper area;
[0050] The step of obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes:
[0051] The scoring standard corresponding to the target calligraphy practice mode is adopted, and the analysis result of this calligraphy practice is obtained according to the calligraphy practice trajectory and the content to be practiced.
[0052] Optionally, the target calligraphy practice mode is a devil practice mode;
[0053] The step of projecting the content to be practiced onto the paper area includes:
[0054] According to the devil practice mode, project the current text to the paper area in sequence;
[0055] After obtaining the result of the current calligraphy practice analysis by adopting the scoring standard corresponding to the target calligraphy practice mode and according to the calligraphy practice track and the content to be practiced, the method further includes:
[0056] If the result of the current character practice analysis meets the preset requirements, the next character is projected onto the paper area in sequence.
[0057] Optionally, after detecting whether the projection area includes the target paper according to the image of the projection area, the method further includes:
[0058] If it is detected that the target paper does not exist in the projection area, the voice is controlled to play prompt information, and the prompt information is used to remind the user to place the target paper.
[0059] Optionally, the method further includes:
[0060] If the computer is turned off during the calligraphy practice, the content of the target paper is collected after the computer is turned on again;
[0061] According to the content of the target paper, the practice content with the highest similarity in the historical calligraphy practice records is matched as the content to be practiced, and continues to be projected onto the paper area.
[0062] In a second aspect, the present application provides an AR-based calligraphy auxiliary device, the device comprising:
[0063] An identification and positioning module, for identifying and positioning a paper area of a target paper in a projection area in response to a calligraphy practice instruction;
[0064] The projection display module is used to: project the content to be practiced onto the paper area;
[0065] A visual detection module is used to: detect the user's calligraphy practice track on the target paper;
[0066] The result analysis module is used to obtain the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced.
[0067] Optionally, the identification and positioning module is specifically used for:
[0068] In response to the calligraphy practice instruction, calling a camera device to capture an image of the projection area;
[0069] Detecting, according to the image of the projection area, whether the projection area includes the target paper;
[0070] If the projection area includes the target paper, a paper area of the target paper in the projection area is identified and located.
[0071] Optionally, the identification and positioning module is further specifically used for:
[0072] According to the image of the projection area, an edge detection algorithm and a contour extraction algorithm are used to determine whether there is a target paper in the image of the projection area;
[0073] If the target paper exists, detecting whether the color parameters of the target paper meet the preset conditions;
[0074] If the color parameter meets a preset condition, it is determined that the projection area includes the target paper, and the color parameter is recorded.
[0075] Optionally, the identification and positioning module is further specifically used for:
[0076] If the projection area includes the target paper, obtaining the preset position coordinates of the edge of the paper area;
[0077] According to the preset position coordinates of the edge, the content to be practiced is projected onto the paper area.
[0078] Optionally, the identification and positioning module is further specifically used for:
[0079] Using an edge detection algorithm to detect the edge of the paper in the image of the projection area;
[0080] If the edge of the paper is detected, the outline of the paper is extracted using the outline extraction algorithm;
[0081] If the paper outline is extracted, it is determined that the target paper exists in the image of the projection area.
[0082] The result analysis module is specifically used for:
[0083] The analysis result of this calligraphy practice is obtained according to the calligraphy practice track and the characters and strokes of the content to be practiced.
[0084] Optionally, the visual detection module is specifically used for:
[0085] Calling a camera device to collect an image of the projection area;
[0086] According to the image of the projection area, detecting whether the image of the projection area changes;
[0087] If the image in the projection area changes, it is determined that the user starts practicing calligraphy, and the calligraphy practice trajectory is collected.
[0088] Optionally, the result analysis module is specifically used for:
[0089] If no change in the image of the projection area is detected within a preset time period, it is determined that the user has finished practicing calligraphy, and an analysis result of this practice is obtained based on the calligraphy practice trajectory and the content to be practiced.
[0090] Optionally, the projection display module is specifically used for:
[0091] Display at least one calligraphy practice mode;
[0092] In response to a user selection operation, determining a target calligraphy practice mode;
[0093] According to the projection strategy of the target calligraphy practice mode, projecting the content to be practiced onto the paper area;
[0094] The result analysis module is specifically used for:
[0095] The scoring standard corresponding to the target calligraphy practice mode is adopted, and the analysis result of this calligraphy practice is obtained according to the calligraphy practice trajectory and the content to be practiced.
[0096] Optionally, the target calligraphy practice mode is a devil practice mode;
[0097] The projection display module is specifically used for:
[0098] According to the devil practice mode, project the current text to the paper area in sequence;
[0099] After obtaining the result of the current calligraphy practice analysis by adopting the scoring standard corresponding to the target calligraphy practice mode and according to the calligraphy practice track and the content to be practiced, the method further includes:
[0100] If the result of the current character practice analysis meets the preset requirements, the next character is projected onto the paper area in sequence.
[0101] In a third aspect, the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the above-mentioned AR-based calligraphy assistance method.
[0102] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned AR-based calligraphy assistance method are executed.
[0103] The beneficial effects of the present application are: the present application can be applied to any projection device with a camera, the requirements for the device are relatively low, and the practicality is improved. The projection device detects the user's calligraphy practice track, and analyzes the user's calligraphy practice process according to the calligraphy practice track and the content to be practiced, which can improve the user's experience of use, and the present application does not require the use of additional dual cameras and LED infrared fill lights, reducing the complexity of technical implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0104] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0105] Figure 1 A schematic diagram showing an application scenario provided by an embodiment of the present application is shown;
[0106] Figure 2 A flowchart of an AR-based calligraphy assistance method provided in an embodiment of the present application is shown;
[0107] Figure 3 A flow chart of identifying and locating a target paper provided by an embodiment of the present application is shown;
[0108] Figure 4 A flow chart of identifying a target paper provided by an embodiment of the present application is shown;
[0109] Figure 5 A flow chart of locating a target paper provided by an embodiment of the present application is shown;
[0110] Figure 6 A flowchart of another method of identifying a target paper provided by an embodiment of the present application is shown;
[0111] Figure 7 A flow chart of repositioning a target paper provided by an embodiment of the present application is shown;
[0112] Figure 8 A flowchart of adjusting the projection area provided by an embodiment of the present application is shown;
[0113] Fig. 9 A flowchart of projecting and recording a calligraphy practice track on a target paper provided by an embodiment of the present application is shown;
[0114] Fig.10 A flow chart of detecting calligraphy practice content provided by an embodiment of the present application is shown;
[0115] Fig.11 A schematic diagram of a calligraphy practice content provided by an embodiment of the present application is shown;
[0116] Fig.12 A flowchart of projecting content to be practiced according to a calligraphy practice mode provided by an embodiment of the present application is shown;
[0117] Fig.13 A flowchart of matching historical copybooks provided in an embodiment of the present application is shown;
[0118] Fig.14 A schematic diagram of the structure of an AR-based calligraphy assistance device provided in an embodiment of the present application is shown;
[0119] Fig.15 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0120] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0121] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0122] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0123] The current method of using projection equipment to assist in calligraphy practice based on AR technology requires the additional use of dual cameras and LED infrared fill lights, and a visible light filter is required to project the control menu on the plane and capture the gesture action image in real time. The corresponding gesture control is performed according to the gesture action image, and the writing animation of the characters to be practiced is projected in the calligraphy practice area, and the characters written by the user are compared and analyzed with it to give a corresponding score.
[0124] However, the existing auxiliary calligraphy practice equipment needs to use dual cameras and infrared LED fill light, so its specific technical implementation is complex and its practicality is poor.
[0125] Based on the above problems, the present application proposes an AR-based calligraphy practice assistance method. In response to a calligraphy practice instruction, the content to be practiced is displayed on the projection interface and projected onto white paper. Then, the user's calligraphy practice trajectory is detected, and the user's calligraphy practice results are analyzed based on the calligraphy practice trajectory and the content to be practiced. The method of the present application can realize assisted calligraphy practice through a simple projection device, reduce the complexity of technical implementation, and improve the practicality of the assisted calligraphy practice device.
[0126] The method of the present application can be applied to a calligraphy auxiliary device, such as Figure 1 As shown, it is a schematic diagram of an application scenario provided by the present application, wherein the calligraphy auxiliary device 101 can be placed on a projection desktop 102, and a white paper 103 is placed on the projection desktop 102. The calligraphy auxiliary device 101 can locate the position of the white paper, align the projection image on the white paper and display the content to be practiced. The user practices calligraphy on the white paper according to the projected content to be practiced. The calligraphy auxiliary device 101 can detect the user's calligraphy practice status in real time, and score and analyze the user's calligraphy practice results. The calligraphy auxiliary device 101 can be a projection device with a visual detection module, and the visual detection module can be, for example, a camera.
[0127] Next, combine Figure 2 , the AR-based calligraphy auxiliary method of the present application is further described, and the execution subject of the method can be, for example, Figure 1 Auxiliary devices for practicing calligraphy, such as Figure 2 As shown, the method includes:
[0128] S201: In response to a calligraphy practice instruction, identifying and locating a paper area of a target paper in a projection area.
[0129] The calligraphy practice assisting device may include a display screen, and the display screen includes a plurality of operation controls or buttons for the user to operate through the input interface of the display screen. For example, the user may select the content, font, and practice mode of the copybook to be practiced on the input interface of the calligraphy practice assisting device, and the calligraphy practice assisting device may generate calligraphy practice instructions according to the content input by the user, display the content to be practiced on the projection interface, and project it onto the target paper in the projection area.
[0130] As another possible implementation, the projection screen of the calligraphy practicing auxiliary device can also be used as an input interface. The user can operate in the projection screen of the calligraphy practicing auxiliary device. The calligraphy practicing auxiliary device can recognize the user's selection operation in the projection screen and determine the content, font and practice mode of the copybook to be practiced.
[0131] The projection area may be a projection coverage area of the calligraphy auxiliary device on the desktop.
[0132] Optionally, the target paper may be any paper located in the projection area. If the projection area includes multiple papers, the paper with the highest overlap with the projection area may be identified, and the area where the paper is located may be located, and the area where the paper is located may be determined as the paper area of the target paper.
[0133] Reference Figure 1The user can place the calligraphy practicing auxiliary device on the desktop, and place calligraphy practicing paper, such as white paper, at the projection position of the calligraphy practicing auxiliary device on the desktop. The calligraphy practicing auxiliary device can respond to the user's calligraphy practicing instructions, first display the copybook, font, etc. selected by the user on the projection interface of the calligraphy practicing auxiliary device, and then project the content to be practiced on the target paper in the projection area according to the mode selected by the user.
[0134] S202: Projecting the content to be practiced onto the paper area;
[0135] Optionally, the content to be practiced may be characters, strokes, etc. in a copybook to be practiced input by the user. After the user determines the content to be practiced, the calligraphy auxiliary device may project the content to be practiced onto the paper area so that the user can practice calligraphy based on the content to be practiced.
[0136] S203: Detect the user's calligraphy practice track on the target paper.
[0137] Optionally, the calligraphy practice track of the user on the target paper may be words or strokes written by the user on the paper according to the content to be practiced.
[0138] Optionally, the calligraphy practice assisting device can capture the image of the target paper in the projection area in real time, and determine the change of the handwriting in the image based on the difference in the image, thereby detecting the user's calligraphy practice trajectory on the target paper.
[0139] S204: Obtain the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced.
[0140] As a possible implementation method, the calligraphy practice auxiliary device can perform real-time analysis during the user's calligraphy practice process based on the calligraphy practice trajectory and the content to be practiced.
[0141] As another possible implementation, the calligraphy practice assisting device may also analyze the user's calligraphy practice trajectory and the content to be practiced when the user completes calligraphy practice to obtain the user's calligraphy practice analysis result.
[0142] Optionally, the calligraphy practice analysis result may include a calligraphy practice score and calligraphy practice feedback information. The calligraphy practice score may be obtained by comparing and analyzing the user's calligraphy practice track and the content to be practiced, and the calligraphy practice feedback information may be real-time feedback from the calligraphy practice auxiliary device to the user during the user's calligraphy practice, such as prompt information on the user's stroke order and stroke position.
[0143] For example, when the calligraphy assistance device detects that the user's strokes are biased to the right during calligraphy practice, the calligraphy assistance device can send feedback information to the user to prompt the user to adjust the direction and position of subsequent strokes.
[0144] In an embodiment of the present application, the calligraphy auxiliary device responds to the user's calligraphy instruction, displays the content to be practiced on the projection interface and projects it onto the target paper in the projection area, then detects the user's calligraphy practice track on the target paper, and finally obtains the calligraphy practice analysis result according to the calligraphy practice track and the content to be practiced. Compared with the prior art, the method of the present application has lower requirements for the device and can be applied to any projection device with a camera, which improves practicality. The user's calligraphy practice track is detected by the projection device, and the user's calligraphy practice process is analyzed according to the calligraphy practice track and the content to be practiced. The present application does not require the additional use of dual cameras and LED infrared fill lights, which reduces the complexity of the specific technical implementation.
[0145] Next, in conjunction with a specific embodiment, the step of identifying and locating the paper area of the target paper in the projection area in response to the calligraphy instruction in the above S201 is described. Figure 3 As shown, the step includes:
[0146] S301: In response to a calligraphy practice instruction, a camera device is called to capture an image of the projection area.
[0147] Optionally, the camera device may be a camera on the calligraphy auxiliary device, and the calligraphy auxiliary device may capture an image of the projection area through the camera to identify whether the projection area includes the target paper and locate the position of the target paper.
[0148] S302: Detecting whether the projection area includes the target paper according to the image of the projection area.
[0149] Optionally, the target paper may be the paper used by the user for practicing calligraphy. When the projection area includes multiple sheets of paper, the calligraphy practicing auxiliary device may determine the paper with the highest overlap with the projection area as the target paper, or the user may select one of the multiple sheets of paper as the target paper.
[0150] Optionally, the calligraphy auxiliary device can detect the image of the projection area to determine whether the paper exists. Since there is a difference in color between the paper and the desktop, it can be determined whether the projection area contains the target paper by detecting the edge of the paper.
[0151] S303: If the projection area includes the target paper, identify and locate the paper area of the target paper in the projection area.
[0152] Optionally, the calligraphy auxiliary device may first project a paper reference position on the desktop, and then locate the paper area of the target paper in the projection area after the user places the paper on the paper reference position.
[0153] It is worth noting that since the paper sizes used by users may be different and the position of the white paper cannot be guaranteed to be completely aligned with the projection area, the calligraphy auxiliary device can first position the target paper after detecting the target paper in the projection area to align the projection area with the paper, and adjust the size and proportion of the paper to the size proportion corresponding to the projection interface.
[0154] The following is a further description of the above step S302, in which the projection area is detected according to the image of the projection area to see whether the projection area includes the target paper. Figure 4 As shown, the step includes:
[0155] S401: Based on the image of the projection area, an edge detection algorithm and a contour extraction algorithm are used to determine whether there is a target paper in the image of the projection area.
[0156] Optionally, the image of the projection area may be first preprocessed using Gaussian filtering to reduce the complexity of subsequent image detection.
[0157] For the preprocessed image, an edge detection algorithm can be used to detect the edge of the paper in the image, and then a contour extraction algorithm can be used to extract the contour of the paper. If the edge of the paper is not detected and the contour of the paper is not extracted, it means that no paper is placed in the projection area.
[0158] S402: If the target paper exists, detect whether the color parameters of the target paper meet the preset conditions.
[0159] Optionally, if the edge of the paper is detected by the edge detection algorithm and the paper region of the target paper is determined by the contour extraction algorithm, it can also be determined whether the paper region includes the target paper according to the color parameters of the target paper.
[0160] Optionally, a screening interval may be determined based on the RGB color values of the desktop and the paper, the determined screening interval may be used as a preset condition, and the color parameters of the paper area may be detected based on the preset condition.
[0161] The color parameter may be the RGB color value of the paper area. Assuming that the ratio of the RGB color values of the paper is within the screening interval (0.8, 1.2), the area that is screened out and meets the interval can be determined as the paper area, and the coordinates of the four corner points of the paper (w1, w2, w3, w4) are calculated. If no area that meets the above interval is screened out, it can be said that there is no paper in the projection area.
[0162] S403: If the color parameters meet the preset conditions, determine that the projection area includes the target paper, and record the color parameters.
[0163] Optionally, when the color parameters meet the preset conditions, it can be determined that the projection area contains the target paper, and the area where the target paper is located can be determined. The calligraphy auxiliary device can also record the color parameters of the paper to quickly locate the paper area according to the color parameters when the position of the paper changes later.
[0164] In the present application, by performing edge detection and contour extraction on the projection area image, the position of the paper can be located quickly and accurately. Even if the white paper moves, the paper can be repositioned through the recorded color parameters, thereby improving the accuracy and convenience of detecting the paper.
[0165] After identifying and locating the target paper, the application can display the content to be practiced on the projection interface and project it onto the paper area, such as Figure 5 As shown, the above step S303 includes:
[0166] S501: If the projection area includes the target paper, obtain the preset position coordinates of the edge of the paper area.
[0167] Optionally, the preset coordinate positions of the edge of the paper area may be the coordinates of the four corner points of the target paper. The calligraphy auxiliary device may project a marking image into the projection area to locate the position coordinates of the paper in the projection area.
[0168] Exemplarily, by projecting a marking image, the position coordinates (p1, p2, p3, p4) of the four corner points (w1, w2, w3, w4) of the target paper in the marking image can be determined, and then a mapping relationship between the position coordinates (p1, p2, p3, p4) and the four corner points of the projection interface of the calligraphy auxiliary device can be established. In this way, the screen conversion from the projection interface to the target paper can be achieved according to the mapping relationship.
[0169] S502: Projecting the content to be practiced onto the paper area according to the preset edge position coordinates.
[0170] Optionally, according to the preset edge position coordinates, the calligraphy practice auxiliary device can first display the content to be practiced on the projection interface, and then project the content to be practiced on the projection interface onto the target paper through the mapping relationship between the projection interface and the target paper.
[0171] It should be noted that this application only uses the coordinates of four corner points as an example to illustrate the edge preset position coordinates. In actual implementation, the edge preset position coordinates can also be four other non-collinear points on the target paper, such as the midpoints of each side of the target paper, the points dividing into three equal parts, etc. This application does not impose any restrictions on this.
[0172] In an embodiment of the present application, by detecting the target paper in the projection area and projecting the content to be practiced according to the preset position coordinates of the edge of the target paper, the content to be practiced in the projection interface can be accurately projected onto the target paper, achieving a reasonable projection effect.
[0173] Next, the step of using edge detection algorithm and contour extraction algorithm to determine whether there is a target paper in the image of the projection area in step S401 is described in conjunction with a specific embodiment. Figure 6 As shown, the step includes:
[0174] S601: Detecting paper edges in the image of the projection area using an edge detection algorithm.
[0175] Optionally, the edge detection algorithm may use a canny operator to perform morphological dilation on the edge of the paper through the edge detection algorithm to make the edge of the paper as closed as possible, and then use a contour extraction algorithm to extract the paper frame.
[0176] S602: If a paper edge is detected, a contour extraction algorithm is used to extract the paper contour.
[0177] Optionally, the implementation steps of the contour extraction algorithm may be: first, filter the paper contour according to a certain threshold, and perform convex hull fitting on it, filter the quadrilateral areas in the convex hull, leaving the quadrilateral areas, ensure that the ratio of the long side and the short side of the quadrilateral and the angle of the quadrilateral are greater than 70°, and then determine the largest quadrilateral among all quadrilaterals as the white paper area.
[0178] S603: If the paper outline is extracted, it is determined that the target paper exists in the image of the projection area.
[0179] If the edge of the paper is detected by the edge detection algorithm and the paper contour of the paper area is extracted by the contour extraction algorithm, it can be determined that the target paper exists in the image of the projection area. At this time, the calligraphy auxiliary device can record the color parameters of the current paper and continue to execute the above-mentioned S402 step.
[0180] During the process of practicing calligraphy, the position of the paper may move due to the user's adjustment of sitting posture or writing habits. At this time, the calligraphy auxiliary device not only needs to detect the position of the paper in real time, but also needs to readjust the projection area according to the position of the paper after the movement, such as Figure 7 As shown, the method of the present application also includes:
[0181] S601: Continuously detecting the preset position coordinates of the edge of the target paper.
[0182] Optionally, the calligraphy auxiliary device can detect the preset position coordinates of the edge of the target paper at a preset time interval, for example, detecting the position coordinates of the four corner points of the target paper once every 2 seconds to determine whether the target paper has moved.
[0183] S602: If the edge preset position coordinates move, adjust the projection area according to the moved edge preset position.
[0184] Optionally, if the currently detected edge preset position coordinates are changed compared with the previously detected edge preset position coordinates, then the above step S502 may be performed on the currently detected edge preset position coordinates to redefine the projection area.
[0185] In an embodiment of the present application, by continuously detecting whether the target paper moves and adjusting the projection area in real time according to the preset edge position of the target paper after the movement, the projection area can be adjusted in time even if the paper moves, thereby avoiding the failure of handwriting recognition caused by the movement of the paper and improving the user experience.
[0186] If the preset edge position coordinates of the target paper move, the application can also adjust the projection area according to the preset edge position after the move, such as Figure 8 As shown, the above step S702 includes:
[0187] S801: If the preset edge position coordinates move, determine, based on color parameters, a region to be merged whose RGB color value similarity in the projection region and the paper region meets a preset condition.
[0188] When the calligraphy auxiliary device performs real-time coordinate detection on the paper area, if it is found that the preset position coordinates of the edge of the paper area move, the area to be merged can be determined based on the most recent color parameters recorded in the aforementioned step S403.
[0189] Optionally, the area to be merged may be an area in the paper area that has a similar RGB color value to the paper area.
[0190] S802: Merge the area to be merged in the projection area and the area to be merged in the paper area into a target area.
[0191] Optionally, the area to be merged in the projection area may be an area with similar color parameters to the paper area, and the area to be merged in the paper area may be the paper area before the move. The original paper area and the area with similar color parameters in the projection area are merged to form the target area.
[0192] S803: Locate the nearest neighbor relationship between the quadrilateral corner points and the edge preset position coordinates of the target area, and determine the new edge preset position coordinates of the target paper.
[0193] Optionally, after the areas with similar RGB color values are merged into a large area through the above step S802, a convex hull fitting algorithm can be used to fit a quadrilateral, locate the coordinates of the quadrilateral corner points and the four corner points of the original target paper (w1, w2, w3, w4) and the nearest neighbor relationship, and the position of the new corner point is the closest, thereby re-determining the preset position coordinates of the edge of the target paper.
[0194] S804: Adjust the projection area according to the new preset position coordinates of the edge of the target paper.
[0195] After determining the new preset position coordinates of the edge of the target paper, the calligraphy practice assisting device may execute the above step S502 to project the content to be practiced onto the paper area of the target paper.
[0196] In order to ensure that the projection image of the calligraphy practicing auxiliary device will not change with the movement of the paper, a template can be pre-generated in the calligraphy practicing auxiliary device according to the content to be practiced. The size and proportion of the template can be fixed, so that the projection content of the calligraphy practicing auxiliary device will not change in size and proportion with the movement of the paper.
[0197] After the above S302 detects whether the projection area includes the target paper according to the image of the projection area, Fig. 9 As shown, the method of the present application also includes:
[0198] S901: If the projection area includes the target paper, converting the image corresponding to the target paper into the same proportion as a preset template, where the preset template is a copybook template including the content to be practiced.
[0199] Optionally, the preset template may be to project the entire content to be practiced onto a target paper, capture the displayed font content and strokes by a camera, and save the obtained image.
[0200] Exemplarily, the calligraphy practice assisting device may first prompt the user through voice to project the complete calligraphy practice content onto the target paper, then record the font content and strokes of the content to be practiced projected on the paper, and save the displayed font content, strokes, and shape and proportion of the paper as a preset template.
[0201] It should be noted that if the paper moves during the user's calligraphy practice, the camera shooting angle may change, and the original captured image will change from a standard rectangular white paper shape to a parallelogram, but the preset template will not change, that is, the preset template is still a standard rectangle. At this time, if you continue to use the white paper image with a changed shooting angle and the template that has not changed to compare and score, the scoring result will be inaccurate.
[0202] Based on this situation in the present application, the image of white paper captured after the white paper moves can be first converted to the same ratio as the preset template (such as A4 size ratio), and scoring and comparison can be performed based on two images of the same ratio to ensure the accuracy of the scoring results.
[0203] By setting a preset template, even if the paper moves, the projected content on the paper will not suddenly change proportions, thus improving the stability of the projection.
[0204] S902: Detect the content of the target paper in the image of the projection area, and record the text and strokes of the content to be practiced.
[0205] Optionally, the calligraphy practice auxiliary device may project each character in the content to be practiced onto the paper in sequence according to the order in the preset template, or may project all the content to be practiced onto the paper at once according to the format of the preset template.
[0206] After the content to be practiced is projected onto the target paper according to a preset template, the calligraphy practice auxiliary device can detect the content of the target paper in the image of the projection area and record the text and strokes of the content to be practiced.
[0207] Among them, according to the practice track and the content to be practiced, the analysis results of this practice are obtained, including:
[0208] The analysis result of this calligraphy practice is obtained based on the calligraphy practice trajectory and the characters and strokes of the content to be practiced.
[0209] Optionally, the characters and strokes in the content to be practiced may be the characters and stroke order of the characters projected according to a preset template, and the user's character practice trajectory may be compared with the preset template to obtain the user's character practice analysis result.
[0210] For example, the character practice analysis result may indicate the deviation of each character of the user compared to a preset template, and whether the stroke sequence of each character of the user is the same as the preset template.
[0211] The calligraphy practice auxiliary device can use the projection of the content to be practiced on the paper as a scoring template for the content to be practiced. When the user finishes practicing calligraphy, the analysis result of this calligraphy practice can be obtained based on the calligraphy practice trajectory and the scoring template of the content to be practiced.
[0212] Optionally, based on the user's writing practice trajectory and the characters and strokes of the content to be practiced, the writing practice auxiliary device can determine the stroke order of each character of the user, as well as the degree of overlap between the strokes of each character and the strokes of the projected text of the content to be practiced, and obtain the analysis results of this writing practice based on the overlap of each character and the overlap of the strokes.
[0213] When the user finishes practicing calligraphy, the calligraphy assistance device can capture the image of the paper area at the end of the practice, and compare it with the image of the paper area at the beginning of the practice, determine the difference area as the area where the user has written, and compare the written area with the template of the content to be practiced, and compare the proportion of overlapping areas. The higher the proportion of overlapping areas, the higher the score.
[0214] During the process of the user practicing calligraphy, the calligraphy auxiliary device can also provide real-time feedback on the user's calligraphy practice status, that is, generate prompt information according to the user's calligraphy practice trajectory.
[0215] For example, when the user's current writing trajectory is biased to the right, the writing assistance device can prompt the user to lean a little to the left by projecting an arrow. When the user's current writing trajectory is biased to the left, the writing assistance device can prompt the user to lean a little to the right by projecting an arrow.
[0216] After projecting the content to be practiced onto the target paper, the calligraphy practice auxiliary device can detect the calligraphy practice track of the user on the target paper, such as Fig.10 As shown, the above step S203 includes:
[0217] S1001: calling a camera device to capture images of the projection area.
[0218] Optionally, the calligraphy practice assisting device may call a camera to continuously collect images of the projection area. Exemplarily, the calligraphy practice assisting device may collect images of the projection area every 2 seconds and cache the images according to the image collection time.
[0219] It should be noted that the time interval for the camera device to capture images of the projection area can be determined based on the average time taken to write a stroke, that is, an image of the projection area can be captured every time the user completes writing a stroke, thereby enabling detection of the order in which the user's strokes are written.
[0220] S1002: Detecting whether the image of the projection area changes according to the image of the projection area.
[0221] Optionally, image detection and text recognition may be performed on the image of the projection area to detect whether the image of the projection area has changed, and the recognized text and strokes that the user has practiced may be recorded.
[0222] It is worth noting that when the user starts to practice writing, the writing traces will be superimposed on the projected font, so the color difference of the projection area can be detected to determine whether the image of the projection area has changed. When the difference between the projected font color and the font color written by the user is small, the projected font color can also be switched according to the font color written by the user to improve the accuracy of font track detection.
[0223] S1003: Determine whether the image in the projection area has changed. If it has, determine that the user has started practicing calligraphy and collect the calligraphy practice trajectory.
[0224] Optionally, if the image in the projection area has changed, that is, the text content on the target paper in the projection area at the current moment is different from that at the previous moment, or the image in the projection area at the current moment is different from the image at the previous moment. For example, if a user's hand appears in the image at the current moment, it can be determined that the user has started practicing calligraphy. At this time, the calligraphy practice assistance device can collect the calligraphy practice trajectory.
[0225] Exemplarily, assume that the images detected in the projection area at the 10th second and the 12th second are as Fig.11 shown. Based on these two images, it can be detected that the stroke practiced by the user is "乚". At this time, the calligraphy practice assistance device can record the two images according to the time and also record the detected calligraphy stroke of the user according to the detected time for analyzing the user's calligraphy practice process.
[0226] As another possible implementation manner, the above step of obtaining the calligraphy practice analysis result according to the calligraphy practice trajectory and the calligraphy practice content further includes:
[0227] If the change of the image in the projection area has not been detected for more than a preset duration, it is determined that the user has ended calligraphy practice. According to the calligraphy practice trajectory and the content to be practiced, obtain the analysis result of this calligraphy practice.
[0228] Optionally, if the change of the image in the projection area has not been detected for more than a preset duration, that is, the content on the paper in the image of the projection area has not changed and there are no moving objects in the image, it can be determined that the user has ended calligraphy practice. At this time, the calligraphy practice assistance device can score the user's calligraphy practice according to the calligraphy practice trajectory on the target paper and the content to be practiced to obtain the analysis result of this calligraphy practice.
[0229] It should be noted that the preset duration for detecting whether the user has ended here can be greater than the time interval for image detection of the projection area. Exemplarily, assume that during the process of the calligraphy practice assistance device detecting the image of the projection area, the text content and objects in the continuously detected images have not changed, and it can be considered that the user has ended calligraphy practice.
[0230] After confirming that the user has ended calligraphy practice, the current state of the calligraphy practice area can be collected through a camera and compared with the state of the picture before calligraphy practice to determine the difference between the two picture states and calculate the difference area, that is, the area where the user has written.
[0231] Next, the step of projecting the content to be practiced onto the paper area in the above S202 step will be described. As Fig.12 shown, the method of the present application further includes:
[0232] S1201: Display at least one calligraphy practice mode.
[0233] Optionally, different calligraphy practice modes may represent different calligraphy practice difficulties and calligraphy practice forms. The calligraphy practice modes may include: basic stroke training mode, basic font training mode, devil training mode, etc.
[0234] For example, the basic stroke training mode and the basic font training mode can be that the calligraphy training auxiliary device projects a copybook, and the user copies it according to the copybook, and decides when to start and when to end independently, without scoring and analysis. The devil training mode can be that the calligraphy training auxiliary device projects a word, and the user keeps copying the word on paper. At the same time, the calligraphy training auxiliary device continuously scores the word copied by the user until the score reaches the preset target, and the word is considered to have been copied. Then the next word will be displayed for the user to continue copying.
[0235] S1202: In response to a user selection operation, determining a target calligraphy practice mode.
[0236] Optionally, after determining the content to be practiced, the user can select a calligraphy practice mode, and the calligraphy practice auxiliary device can project the content to be practiced onto the target paper according to the mode.
[0237] S1203: Projecting the content to be practiced onto the paper area according to the projection strategy of the target calligraphy practice mode.
[0238] Optionally, the projection strategies may include: projecting characters one by one, projecting all characters, etc. Each target calligraphy practice mode may correspond to a projection strategy. For example, the basic stroke training mode and the basic font training mode may project all characters, and the devil training mode may project characters one by one, etc.
[0239] Among them, in the above step S204, according to the calligraphy practice track and the content to be practiced, the analysis result of this calligraphy practice is obtained, including:
[0240] Use the scoring criteria corresponding to the target calligraphy practice mode, and obtain the analysis results of this calligraphy practice based on the calligraphy practice trajectory and the content to be practiced.
[0241] Next, the devil training mode in the above-mentioned target calligraphy practice mode is further described. When the target calligraphy practice mode is the devil training mode, the above-mentioned step S202 includes:
[0242] According to the devil practice mode, project the current text to the paper area in sequence.
[0243] After the user finishes practicing calligraphy, and uses the scoring criteria corresponding to the devil training mode to determine the analysis results of this practice based on the practice track and the content to be practiced, it can also include:
[0244] If the result of the current character's calligraphy practice analysis meets the preset requirements, project the next character onto the paper area in sequence.
[0245] Exemplarily, assuming the current character is "国", the calligraphy practice assistance device can project this character onto the paper area. The user can practice writing the character "国" after the projected character on the target paper until the calligraphy practice assistance device confirms that the score of the character "国" written by the user meets the preset requirements, and then continue to project the next character of the content to be practiced onto the paper area.
[0246] Optionally, in this application, the calligraphy practice assistance device can not only determine the calligraphy practice mode, but also determine the content to be practiced in response to the user's selection operation on the content that can be practiced. Among them, the content that can be practiced includes: calligraphy models and / or fonts.
[0247] As a possible implementation manner, the calligraphy practice assistance device can display calligraphy models with a relatively high practice rate to the user on the input interface, and the user can select from these options to determine the content to be practiced.
[0248] As another possible implementation manner, the user can input the calligraphy model to be practiced and select the font type to be practiced. The calligraphy practice assistance device can determine the calligraphy model to be practiced according to the content input by the user, and present the calligraphy model to the user in the font type selected by the user to obtain the final content to be practiced.
[0249] After detecting whether the projection area contains the target paper according to the image of the projection area in the above step S302, the method of this application further includes:
[0250] If it is detected that the target paper does not exist in the projection area, control the voice to play a prompt message, and the prompt message is used to remind the user to place the target paper.
[0251] Optionally, if it is determined that there is no target paper in the projection area through the edge detection algorithm, contour extraction algorithm, and color parameters, the calligraphy practice assistance device can also control the voice module to play a prompt message to remind the user to place the paper in the projection area. Among them, the prompt message can be pre-configured, such as "Please place the paper", etc., and there is no limitation here.
[0252] For the scenario where the user has not finished copying a calligraphy model A, the calligraphy practice assistance device is powered off and then powered on again, and a white paper with the written part is placed, and the user wants to continue copying the calligraphy model A, as Fig.13 shown, the method of this application further includes:
[0253] S1301: If the device is powered off during the calligraphy practice process, after powering on again, collect the content of the target paper.
[0254] S1302: According to the content of the target paper, the practice content with the highest similarity in the historical calligraphy practice records is matched as the content to be practiced, and continues to be projected onto the paper area.
[0255] If the computer is turned off during calligraphy practice, when it is restarted, the calligraphy practice assistance device can not only assist the user to put the white paper into the corresponding projection area, but also capture the image of the paper, match the image of the paper with the historical copybooks that the user has practiced recently, take the copybook with the highest matching score as the target copybook, and project the target copybook, allowing the user to continue practicing based on the target copybook. This can avoid the user manually searching for the previous copybook that has not been practiced, thereby improving convenience.
[0256] The calligraphy assistance method of the present application can first respond to the user's selection instructions, determine the content that the user needs to practice, and determine the mode in which the user wants to practice. Then the calligraphy assistance device can project the content to be practiced selected by the user on the target paper according to the practice mode, and detect the user's calligraphy practice trajectory. Finally, score feedback is given according to the user's calligraphy practice trajectory and the content to be practiced, thereby achieving more convenient calligraphy assistance. In addition, the method of the present application can be applied to a projection device with a camera, and has lower requirements for the device, so it has better universality.
[0257] Based on the same inventive concept, the embodiment of the present application also provides an AR-based calligraphy assistance device corresponding to the AR-based calligraphy assistance method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned AR-based calligraphy assistance method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0258] Reference Fig.14 As shown, it is a schematic diagram of an AR-based calligraphy auxiliary device provided in an embodiment of the present application. The device may be the calligraphy auxiliary device mentioned above, and the device includes: an identification and positioning module 1401, a projection display module 1402, a visual detection module 1403, and a result analysis module 1404; wherein:
[0259] The identification and positioning module 1401 is used to identify and locate the paper area of the target paper in the projection area in response to the calligraphy practice instruction;
[0260] The projection display module 1402 is used to: project the content to be practiced onto the paper area;
[0261] The visual detection module 1403 is used to detect the writing trajectory of the user on the target paper;
[0262] The result analysis module 1404 is used to obtain the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced.
[0263] Optionally, the identification and positioning module 1401 is specifically used for:
[0264] In response to the calligraphy practice instruction, calling a camera device to collect an image of the projection area;
[0265] According to the image of the projection area, detecting whether the projection area contains the target paper;
[0266] If the projection area includes the target paper, a paper area of the target paper in the projection area is identified and located.
[0267] Optionally, the identification and positioning module 1401 is further specifically used for:
[0268] According to the image of the projection area, edge detection algorithm and contour extraction algorithm are used to determine whether there is target paper in the image of the projection area;
[0269] If the target paper exists, detect whether the color parameters of the target paper meet the preset conditions;
[0270] If the color parameters meet the preset conditions, it is determined that the projection area includes the target paper, and the color parameters are recorded.
[0271] Optionally, the identification and positioning module 1401 is further specifically used for:
[0272] If the projection area includes the target paper, the preset position coordinates of the edge of the paper area are obtained;
[0273] Project the content to be practiced onto the paper area according to the preset edge position coordinates.
[0274] Optionally, the identification and positioning module 1401 is further specifically used for:
[0275] An edge detection algorithm is used to detect the edge of the paper in the image of the projection area;
[0276] If the edge of the paper is detected, the contour extraction algorithm is used to extract the paper contour;
[0277] If the paper outline is extracted, it is determined that the target paper exists in the image of the projection area.
[0278] The result analysis module 1404 is specifically used for:
[0279] The analysis result of this calligraphy practice is obtained based on the calligraphy practice trajectory and the characters and strokes of the content to be practiced.
[0280] Optionally, the visual detection module 1403 is specifically used for:
[0281] Calling a camera device to collect images of the projection area;
[0282] According to the image of the projection area, detecting whether the image of the projection area changes;
[0283] If the image in the projection area changes, it is determined that the user starts practicing calligraphy, and the calligraphy practice trajectory is collected.
[0284] Optionally, the result analysis module 1404 is specifically used for:
[0285] If no change in the image in the projection area is detected within a preset time period, it is determined that the user has finished practicing calligraphy, and the analysis result of this practice is obtained based on the calligraphy practice trajectory and the content to be practiced.
[0286] Optionally, the projection display module 1402 is specifically used for:
[0287] Display at least one calligraphy practice mode;
[0288] In response to a user selection operation, determining a target calligraphy practice mode;
[0289] According to the projection strategy of the target calligraphy practice mode, the content to be practiced is projected onto the paper area;
[0290] The result analysis module 1404 is specifically used for:
[0291] Use the scoring criteria corresponding to the target calligraphy practice mode, and obtain the analysis results of this calligraphy practice based on the calligraphy practice trajectory and the content to be practiced.
[0292] Optional, the target calligraphy practice mode is the devil practice mode;
[0293] The projection display module 1402 is specifically used for:
[0294] According to the devil practice mode, project the current text to the paper area in sequence;
[0295] Using the scoring criteria corresponding to the target calligraphy practice mode, according to the calligraphy practice track and the content to be practiced, after obtaining the analysis results of this calligraphy practice, it also includes:
[0296] If the result of the current character practice analysis meets the preset requirements, the next character will be projected onto the paper area in sequence.
[0297] Optionally, the AR-based calligraphy auxiliary device further includes a repositioning module, a template conversion module, a voice prompt module, and a copybook matching module, which are used to:
[0298] Continuously detect the preset position coordinates of the edge of the target paper;
[0299] If the edge preset position coordinates move, the projection area is adjusted according to the moved edge preset position.
[0300] Optionally, the repositioning module is specifically used to:
[0301] If the preset edge position coordinates move, determine the area to be merged whose RGB color value similarity in the projection area and the paper area meets the preset conditions according to the color parameters;
[0302] Merge the area to be merged in the projection area and the area to be merged in the paper area into a target area;
[0303] Locate the nearest neighbor relationship between the quadrilateral corner points and the edge preset position coordinates of the target area, and determine the new edge preset position coordinates of the target paper;
[0304] Adjust the projection area according to the new preset position coordinates of the edge of the target paper.
[0305] Optionally, the template conversion module is specifically used for:
[0306] If the projection area includes the target paper, the image corresponding to the target paper is converted to the same proportion as the preset template, where the preset template is a copybook template including the content to be practiced;
[0307] Detect the content of the target paper in the image of the projection area, and record the words and strokes of the content to be practiced;
[0308] Optionally, the voice prompt module is specifically used for:
[0309] If the target paper does not exist in the detection projection area, the voice is controlled to play a prompt message, and the prompt message is used to remind the user to place the target paper.
[0310] Optionally, the copybook matching module is specifically used for:
[0311] If the computer is turned off during calligraphy practice, the content of the target paper will be captured after it is turned on again;
[0312] According to the content of the target paper, the practice content with the highest similarity in the historical calligraphy practice records is matched as the content to be practiced, and continues to be projected onto the paper area.
[0313] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0314] Compared with the prior art, the method of the embodiment of the present application has lower requirements for the device and can be applied to any projection device with a camera, which improves practicality. The projection device detects the user's calligraphy practice track and analyzes the user's calligraphy practice process based on the calligraphy practice track and the content to be practiced. The present application does not require the use of additional dual cameras and LED infrared fill lights, which reduces the complexity of the specific technical implementation.
[0315] The present application also provides an electronic device, such as Fig.151501, a schematic diagram of the electronic device structure provided by the embodiment of the present application, including: a processor 1501, a memory 1502 and a bus. The memory 1502 stores machine-readable instructions executable by the processor 1501 (for example, Fig.14 In the device, the identification and positioning module 1401, the projection display module 1402, the visual detection module 1403 and the execution instructions corresponding to the result analysis module 1404 are included. When the computer device is running, the processor 1501 communicates with the memory 1502 through the bus, and when the machine-readable instructions are executed by the processor 1501, the processing of the above-mentioned AR-based calligraphy assistance method is performed.
[0316] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned AR-based calligraphy assistance method are executed.
[0317] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules 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 through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0318] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0319] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A method for assisting calligraphy practice based on AR, characterized in that: include: In response to the calligraphy practice instruction, identifying and locating a paper area of the target paper in the projection area; Projecting the content to be practiced onto the paper area; Detecting the user's calligraphy practice track on the target paper; According to the calligraphy practice track and the content to be practiced, the analysis result of this calligraphy practice is obtained.
2. The method according to claim 1, characterized in that In response to the calligraphy practice instruction, identifying and locating a paper area of the target paper in the projection area comprises: In response to the calligraphy practice instruction, calling a camera device to capture an image of the projection area; Detecting, according to the image of the projection area, whether the projection area includes the target paper; If the projection area includes the target paper, a paper area of the target paper in the projection area is identified and located.
3. The method according to claim 2, characterized in that The detecting, based on the image of the projection area, whether the projection area includes the target paper includes: According to the image of the projection area, an edge detection algorithm and a contour extraction algorithm are used to determine whether there is a target paper in the image of the projection area; If the target paper exists, detecting whether the color parameters of the target paper meet the preset conditions; If the color parameter meets a preset condition, it is determined that the projection area includes the target paper, and the color parameter is recorded.
4. The method according to claim 3, characterized in that If the projection area includes the target paper, identifying and locating the paper area of the target paper in the projection area includes: If the projection area includes the target paper, obtaining the preset position coordinates of the edge of the paper area; According to the preset position coordinates of the edge, the content to be practiced is projected onto the paper area.
5. The method according to claim 3, characterized in that: The step of using an edge detection algorithm and a contour extraction algorithm to determine whether the image of the projection area contains a target paper comprises: Using an edge detection algorithm to detect the edge of the paper in the image of the projection area; If the edge of the paper is detected, the outline of the paper is extracted using the outline extraction algorithm; If the paper outline is extracted, it is determined that the target paper exists in the image of the projection area.
6. The method according to claim 4, characterized in that The method further comprises: Continuously detecting the preset position coordinates of the edge of the target paper; If the edge preset position coordinates move, the projection area is adjusted according to the moved edge preset position.
7. The method according to claim 6, characterized in that If the edge preset position coordinates are moved, adjusting the projection area according to the moved edge preset position includes: If the preset edge position coordinates move, determine the area to be merged in which the similarity of the RGB color values in the projection area and the paper area meets the preset conditions according to the color parameters; Merging the area to be merged in the projection area and the area to be merged in the paper area into a target area; Locate the nearest neighbor relationship between the quadrilateral corner points of the target area and the edge preset position coordinates, and determine new edge preset position coordinates of the target paper; The projection area is adjusted according to the new preset position coordinates of the edge of the target paper.
8. The method according to claim 2, characterized in that: After detecting whether the projection area includes the target paper according to the image of the projection area, the method further includes: If the projection area includes the target paper, converting the image corresponding to the target paper into the same proportion as a preset template, wherein the preset template is a copybook template including the content to be practiced; Detecting the content of the target paper in the image of the projection area, and recording the words and strokes of the content to be practiced; The step of obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes: The analysis result of this calligraphy practice is obtained according to the calligraphy practice track and the characters and strokes of the content to be practiced.
9. The method according to claim 1, characterized in that: The detecting of the user's calligraphy practice track on the target paper includes: Calling a camera device to collect an image of the projection area; According to the image of the projection area, detecting whether the image of the projection area changes; If the image in the projection area changes, it is determined that the user starts practicing calligraphy, and the calligraphy practice trajectory is collected.
10. The method according to claim 9, characterized in that The step of obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes: If no change in the image of the projection area is detected within a preset time period, it is determined that the user has finished practicing calligraphy, and an analysis result of this practice is obtained based on the calligraphy practice trajectory and the content to be practiced.
11. The method according to claim 1, characterized in that: The step of projecting the content to be practiced onto the paper area includes: Display at least one calligraphy practice mode; In response to a user selection operation, determining a target calligraphy practice mode; According to the projection strategy of the target calligraphy practice mode, projecting the content to be practiced onto the paper area; The step of obtaining the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced includes: The scoring standard corresponding to the target calligraphy practice mode is adopted, and the analysis result of this calligraphy practice is obtained according to the calligraphy practice trajectory and the content to be practiced.
12. The method according to claim 11, characterized in that The target calligraphy practice mode is a devil practice mode; The step of projecting the content to be practiced onto the paper area includes: According to the devil practice mode, project the current text to the paper area in sequence; After obtaining the result of the current calligraphy practice analysis by adopting the scoring standard corresponding to the target calligraphy practice mode and according to the calligraphy practice track and the content to be practiced, the method further includes: If the result of the current character practice analysis meets the preset requirements, the next character is projected onto the paper area in sequence.
13. The method according to claim 2, characterized in that After detecting whether the projection area includes the target paper according to the image of the projection area, the method further includes: If it is detected that the target paper does not exist in the projection area, the voice is controlled to play prompt information, and the prompt information is used to remind the user to place the target paper.
14. The method according to claim 1, characterized in that The method further comprises: If the computer is turned off during the calligraphy practice, the content of the target paper is collected after the computer is turned on again; According to the content of the target paper, the practice content with the highest similarity in the historical calligraphy practice records is matched as the content to be practiced, and continues to be projected onto the paper area.
15. An AR-based calligraphy auxiliary device, characterized in that: include: An identification and positioning module, for identifying and positioning a paper area of a target paper in a projection area in response to a calligraphy practice instruction; The projection display module is used to: project the content to be practiced onto the paper area; A visual detection module is used to detect the user's calligraphy practice track on the target paper; The result analysis module is used to obtain the analysis result of the current calligraphy practice according to the calligraphy practice track and the content to be practiced.
16. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the AR-based calligraphy assistance method as described in any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the AR-based calligraphy assistance method as described in any one of claims 1 to 14 are executed.
