Tactile image automatic generation method and device and electronic equipment

By generating line images through edge recognition and contour extraction, the problem of adapting high-resolution color images to low-resolution tactile displays is solved, and efficient tactile image generation is achieved.

CN121330084APending Publication Date: 2026-01-13TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511411558.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing tactile display technologies struggle to effectively process high-resolution color images, making them unsuitable for direct use in low-resolution tactile displays, and lacking adaptation methods.

Method used

By acquiring the filled image, performing edge recognition and contour extraction, generating a line image, and then vectorizing it, a tactile image suitable for low-resolution tactile displays is finally generated.

Benefits of technology

It reduces computational load, improves image processing efficiency, and generates tactile images that are compatible with low-resolution tactile displays, avoiding the problem of poor recognition results caused by direct scaling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330084A_ABST
    Figure CN121330084A_ABST
Patent Text Reader

Abstract

The invention provides a tactile image automatic generation method and device and electronic equipment, and relates to the technical field of computers, and the method comprises the steps: obtaining a filling image; performing edge identification according to the filling image to extract the contour of the filling image; generating a corresponding line image based on the contour of the filling image; vectorization processing is carried out according to the line image to obtain a vector line image, sampling processing is carried out on the vector line image to generate a tactile image, and preprocessing can be carried out on a filling image to adapt to a low-resolution tactile display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus and electronic device for automatically generating tactile images. Background Technology

[0002] With the continuous development of technology, image processing technology has played an important role in assisting people with special needs in their lives. Especially for visually impaired individuals, traditional methods of acquiring visual information are limited, and touch, as an alternative sensory means, is gradually gaining attention. Existing tactile display technologies can convert two-dimensional images into a tactile form through changes in physical surfaces, thereby helping blind people understand image content. However, ordinary filled images, such as high-resolution color images, are not suitable for direct use in tactile display devices due to their complexity and large data volume, and currently, there is a lack of methods to preprocess filled images to adapt them to low-resolution tactile displays. Summary of the Invention

[0003] To address the problems existing in the prior art, the present invention provides a method, apparatus, and electronic device for automatically generating tactile images.

[0004] This invention provides a method for automatically generating tactile images, comprising: Get the filled image; Edge recognition is performed on the filled image to extract the contour of the filled image; Generate a corresponding line image based on the outline of the filled image; The line image is vectorized to obtain a vector line image, and the vector line image is sampled to generate a tactile image.

[0005] According to the present invention, an automated method for generating tactile images includes edge recognition based on the filled image, comprising: The filled image is converted to obtain the corresponding grayscale image, and the gradient of the pixels in the grayscale image is determined; Determine a first gradient threshold and a second gradient threshold to perform edge recognition on the grayscale image based on the first gradient threshold, the second gradient threshold, and the gradient of pixels in the grayscale image, to obtain a first-order recognition contour; and / or, The primary recognition contour is repaired using shape elements at a third resolution to obtain a secondary recognition contour; and / or, Extract the single-pixel-width main line of the secondary recognition contour to obtain the tertiary recognition contour.

[0006] According to the present invention, an automated method for generating tactile images extracts the contour of the filled image, comprising: When there are at least two identified contours in a single identification, the perimeter of each identified contour is determined, and the identified contours with a perimeter greater than a contour perimeter threshold are retained to obtain the contour of the filled image; or, When there are at least two secondary recognition contours, the perimeter of each secondary recognition contour is determined, and secondary recognition contours with a perimeter greater than a contour perimeter threshold are retained to obtain the contour of the filled image; or, When there are at least two three-dimensional recognition contours, the perimeter of each three-dimensional recognition contour is determined, and the three-dimensional recognition contours with a perimeter greater than the contour perimeter threshold are retained to obtain the contour of the filled image.

[0007] According to the haptic image automatic generation method provided by the present invention, before obtaining the fill image, the method further includes: If the size of the original image is greater than the image size threshold, the original image is cropped proportionally to obtain a cropped image. The cropped image is filtered based on spatial distance and similarity to obtain the filled image.

[0008] According to the haptic image automatic generation method provided by the present invention, after acquiring the original image, the method further includes: The complexity of the original image is determined, and the parameter values ​​of the spatial distance and the similarity are determined based at least on the complexity of the original image.

[0009] According to the present invention, an automated method for generating tactile images, wherein generating a corresponding line image based on the contour includes: A canvas of the same size as the image to be filled is constructed; the entire canvas is filled with white. The outline is drawn onto the canvas based on the black single-pixel line width to generate a corresponding line image.

[0010] According to the present invention, an automated method for generating tactile images includes sampling the vector line image to generate a tactile image, comprising: A first resolution of the tactile image is determined, and a second resolution is determined based on the first resolution; The vector line image is drawn using oversampling based on the second resolution to generate an intermediate tactile image; The intermediate tactile image is drawn by subsampling according to the first resolution to generate the tactile image.

[0011] The present invention also provides an automated tactile image generation device, comprising: The fill image acquisition module is used to acquire the fill image; A contour extraction module is used to perform edge recognition based on the filled image in order to extract the contour of the filled image; A line image generation module is used to generate a corresponding line image based on the outline of the filled image; The tactile image generation module is used to perform vectorization processing on the line image to obtain a vector line image, and to perform sampling processing on the vector line image to generate a tactile image.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the haptic image automatic generation method as described above.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the haptic image automatic generation method as described above.

[0014] The haptic image automated generation method, apparatus, and electronic device provided by this invention acquire a filled image, perform edge recognition based on the filled image to extract the contour of the filled image, and generate a corresponding line image based on the contour of the filled image. This can reduce the computational load of subsequent processing. The line image is vectorized to obtain a vector line image, and the vector line image is sampled to generate a haptic image. This facilitates the preprocessing of the filled image to obtain a haptic image adapted to low-resolution haptic displays. At the same time, the vector nature of the vector line image avoids the problem of poor recognition effect caused by directly scaling bitmaps. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating the automated tactile image generation method provided by the present invention.

[0017] Figure 2 This is one of the schematic diagrams illustrating an example of the haptic image automated generation method provided by the present invention.

[0018] Figure 3 This is a second example of the haptic image automatic generation method provided by the present invention.

[0019] Figure 4This is the third example of the haptic image automatic generation method provided by the present invention.

[0020] Figure 5 This is a schematic diagram of the structure of the tactile image automated generation device provided by the present invention.

[0021] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.

[0024] Figure 1 This is a flowchart illustrating the automated tactile image generation method provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps: Step 101: Obtain the filled image.

[0025] In this context, a filled image refers to a graphic where the internal areas of an image are completely filled with a fixed color or grayscale value, used to highlight the overall shape and regional characteristics of the image content. Figure 2 For example, the image content refers to a large tree.

[0026] It should be noted that there are many ways to obtain the fill image, such as obtaining the fill image input by the user, or automatically obtaining the fill image from a preset storage area, etc. This invention does not limit the methods.

[0027] The filled image can be Figure 2 The color image shown on the left can also be a grayscale image, etc., and this invention does not limit it.

[0028] Step 102: Perform edge recognition based on the filled image to extract the contour of the filled image.

[0029] It should be noted that after obtaining the fill image input by the user, the edge recognition of the fill image can be performed according to the edge recognition command input by the user, the outline of the fill image can be extracted, and the outline of the fill image can be displayed to the user through the graphical user interface, providing a reference for the user to input subsequent execution commands.

[0030] Step 103: Generate a corresponding line image based on the outline of the filled image.

[0031] Line images are images that use outline lines to represent the content of the image, and are used to highlight the edge details of the image content.

[0032] It should be noted that there are many ways to generate a corresponding line image based on the contour of a filled image, such as through edge detection algorithms, contour tracking algorithms, etc., and this invention does not limit this method.

[0033] Among them, line images can be Figure 2 The gray lines shown on the left can also be colored lines, etc., and this invention does not limit them.

[0034] Step 104: Vectorize the line image to obtain a vector line image, and sample the vector line image to generate a tactile image.

[0035] Among them, tactile images, also known as binary images, refer to graphics that use black and white pixels or black and white pixel blocks to represent image content, and are used for display on refreshable tactile displays.

[0036] A refreshable haptic display is a device whose surface is composed of a matrix of dots that can be raised and retracted. The changes in these dots can be controlled by a computer to transform tactile images into tactile graphics, allowing blind people to understand them through touch.

[0037] Vector line images, in particular, refer to line images based on paths and points that can be scaled without loss of quality while maintaining sharpness. Line graphics and their corresponding vector line images represent the same image content.

[0038] It should be noted that after generating the line image, the line image can be vectorized according to the user's input vectorization processing instructions to obtain an SVG format vector line image, which is then displayed to the user through a graphical user interface. According to the user's input sampling instructions, the vector line image is sampled to generate a tactile image, which is also displayed to the user through a graphical user interface, providing a reference for the user to input subsequent execution instructions.

[0039] Based on the characteristic that tactile images mainly reflect the outline of image content, the tactile image automatic generation method provided in this embodiment of the invention obtains a filled image, performs edge recognition on the filled image to extract the outline of the filled image, and generates a corresponding line image based on the outline of the filled image, which can reduce the amount of computation for subsequent processing. The line image is vectorized to obtain a vector line image, and the vector line image is sampled to generate a tactile image, which facilitates the preprocessing of the filled image to obtain a tactile image adapted to low-resolution tactile displays. At the same time, the vector nature of the vector line image avoids the problem of poor recognition effect caused by directly scaling bitmaps.

[0040] Based on the above embodiments, the edge recognition based on the filled image includes: converting the filled image to obtain a corresponding grayscale image, and determining the gradient of the pixels in the grayscale image; determining a first gradient threshold and a second gradient threshold, so as to perform edge recognition on the grayscale image based on the first gradient threshold, the second gradient threshold and the gradient of the pixels in the grayscale image, to obtain a first recognition contour.

[0041] In this context, a grayscale image is an image that contains only brightness information and not color information. For example, a grayscale image can be obtained by processing a color image using a weighted average method. In this embodiment, the content of the grayscale image and the filled image are the same; the only difference is whether or not color information is included.

[0042] It should be noted that edge detection algorithms, such as the Canny operator, can be used to determine the direction and intensity of the most drastic brightness changes at each pixel in a grayscale image by analyzing the gradient of the pixels in the image, thereby performing edge recognition on the grayscale image. For example, the Canny edge detection algorithm can be executed using the function CvInvoke.Canny from the Emgu CV library to perform edge recognition on the grayscale image and obtain a single recognized contour.

[0043] The first gradient threshold, also known as the high threshold, is used to identify strong edges in a grayscale image. The second gradient threshold, also known as the low threshold, is used to identify weak edges in a grayscale image.

[0044] The specific values ​​of the first gradient threshold and the second gradient threshold can be set according to actual needs, and this invention does not limit them.

[0045] In this embodiment, the first gradient threshold is greater than the second gradient threshold. Therefore, the gradient of the edge of the grayscale image identified by the first gradient threshold is greater than the gradient of the edge of the grayscale image identified by the second gradient threshold. Thus, the edge of the grayscale image identified by the first gradient threshold can be called a strong edge, and the edge of the grayscale image identified by the second gradient threshold can be called a weak edge.

[0046] In some embodiments, after identifying strong edges based on a first gradient threshold and the gradient of pixels in a grayscale image, and identifying weak edges based on a second gradient threshold and the gradient of pixels in a grayscale image, the method further includes detecting each weak edge; if a weak edge is connected to a strong edge, the weak edge is determined to be a component of an edge identified in a first step; if a weak edge is not connected to a strong edge, the weak edge is determined not to be a component of an edge identified in a first step.

[0047] In some embodiments, the edge recognition based on the filled image further includes: repairing the primary recognition contour using shape elements of a third resolution to obtain a secondary recognition contour.

[0048] It should be noted that, based on the closing operation, by constructing a 3×3 rectangular structuring element, small gaps in the first-order recognition contour can be filled and independent noise points can be removed, thereby improving the continuity of the first-order recognition contour and obtaining the second-order recognition contour.

[0049] For example, a secondary recognition contour can be obtained by executing MorphologyEx(edges,closed,MORPH_CLOSE), where edges is the primary recognition contour as input, MORPH_CLOSE refers to the closing operation, and closed is the secondary recognition contour as output.

[0050] Understandably, by bridging the edges through closing operations, problems such as edge breaks and noise interference that may exist in the first-order recognition contour obtained by edge recognition can be solved, providing a foundation for the subsequent generation of tactile images suitable for tactile displays.

[0051] In some embodiments, the edge recognition based on the filled image further includes: extracting the single-pixel-width backbone of the secondary recognition contour to obtain the tertiary recognition contour.

[0052] It should be noted that, based on skeletonization (Thinning), the thick edges of the secondary recognition contour can be shrunk to 1-pixel wide lines, and the single-pixel wide main lines of the secondary recognition contour can be extracted to obtain the tertiary recognition contour. Here, a thick edge refers to an edge with an edge pixel width greater than 1 pixel. For example, the `closed` parameter can be thinned using the `XImgproc.Zhang-Suen` algorithm to output a `skel`. Here, `skel` is the tertiary recognition contour output.

[0053] Understandably, by extracting single-pixel wide backbones through skeletonization, the amount of image data can be significantly compressed while preserving the original contour topology to the maximum extent, thereby reducing the storage and transmission overhead of contour recognition and providing a foundation for subsequent image processing.

[0054] The first-order recognition contour can be a black-and-white binary image, the second-order recognition contour is obtained by processing the first-order recognition contour, and the third-order recognition contour is obtained by processing the second-order recognition contour. Based on this, the second-order recognition contour and the third-order recognition contour are also black-and-white binary images.

[0055] It is understood that the recognition contours (first-order, second-order, or third-order recognition contours) obtained by edge recognition of the filled image include contours that are meaningful to the content of the image, and may also include fragmented noise that is meaningless to the content of the image, such as small, isolated pixel blocks. In order to separate the contours that are meaningful to the content of the image from the fragmented noise that is meaningless to the content of the image, based on any of the above embodiments, the contours of the filled image are extracted, including: when there are at least two first-order recognition contours, determining the perimeter of each first-order recognition contour, retaining the first-order recognition contours whose perimeter is greater than the contour perimeter threshold, and obtaining the contours of the filled image; or, when there are at least two second-order recognition contours, determining the perimeter of each second-order recognition contour, retaining the second-order recognition contours whose perimeter is greater than the contour perimeter threshold, and obtaining the contours of the filled image; or, when there are at least two third-order recognition contours, determining the perimeter of each third-order recognition contour, retaining the third-order recognition contours whose perimeter is greater than the contour perimeter threshold, and obtaining the contours of the filled image.

[0056] It should be noted that, in the case of obtaining only one recognition contour in the aforementioned embodiments, the contour of the filled image is obtained based on the one recognition contour; in the case of obtaining a second recognition contour in the aforementioned embodiments, the contour of the filled image is obtained based on the second recognition contour; and in the case of obtaining a third recognition contour in the aforementioned embodiments, the contour of the filled image is obtained based on the third recognition contour.

[0057] For example, CvInvoke.FindContours can be used to obtain all the recognized contours obtained from edge recognition based on the filled image, and the perimeter perim of each contour can be calculated by perim = ArcLength(contour, true), retaining only the recognized contours with perim ≥ minPerim. Here, minPerim is the set contour perimeter threshold, and the specific value of the contour perimeter threshold can be set according to the actual situation, which is not limited in this invention.

[0058] Based on any of the above embodiments, before obtaining the filling image, the method further includes: obtaining an original image; determining that the size of the original image is greater than an image size threshold; cropping the original image proportionally to obtain a cropped image; and filtering the cropped image based on spatial distance and similarity to obtain the filling image.

[0059] Here, the original image refers to the image input by the user. The specific value of the image size threshold can be set according to the actual situation of the refreshable haptic display, and this invention does not limit it.

[0060] If the size of the original image is not greater than the image size threshold, the original image is filtered based on spatial distance and similarity to obtain the filled image.

[0061] The similarity can be color similarity and / or spatial similarity.

[0062] It should be noted that the ResizeAndPad function can be used to proportionally crop the original image to a length or width of 512 pixels, resulting in a cropped image. The cropped image can then be subjected to bilateral filtering based on spatial distance, color similarity, and / or spatial similarity to obtain an intermediate filled image. This intermediate filled image is then displayed to the user through a graphical user interface, allowing for the reception of user input commands to adjust the parameters of spatial distance, color similarity, and / or spatial similarity, thereby adjusting the filtering effect and obtaining the final filled image.

[0063] Understandably, filtering the original or cropped image based on spatial distance and similarity can remove image noise, smooth textures, and obtain clearer edges. Specifically, spatial distance and similarity can determine the correlation between pixels in different regions of the original or cropped image, thereby smoothing the pixels within the same region while preserving edges between different regions. By working together to filter the original or cropped image, noise interference within the region is suppressed while edge sharpness is maintained, providing a foundation for subsequent contour extraction.

[0064] Based on any of the above embodiments, after obtaining the original image, the method further includes: determining the complexity of the original image, and at least determining the parameter values ​​of the spatial distance and the similarity based on the complexity of the original image.

[0065] It should be noted that the complexity of the original image can be determined based on its characteristics. For example, the complexity of the original image can be divided into three levels: Simple, Middle, and Complex, based on the number of details and contours, the number of irregular pixels in the image, and the complexity of lines and colors.

[0066] Among them, the initial parameter values ​​of spatial distance and similarity corresponding to the complexity of the original image can be determined in advance based on the prior debugging.

[0067] In addition, the parameter values ​​of the first gradient threshold and the second gradient threshold, as well as the parameter value of the contour perimeter threshold, can be determined in advance based on the complexity of the original image.

[0068] For example, to automate the processing of input images with different characteristics such as line and color complexity, the parameter values ​​corresponding to the complexity of the original image are shown in the table below:

[0069] Where d is the spatial distance, sigmaColor is the color similarity, sigmaSpace is the spatial similarity, threshold1 is the first gradient threshold, threshold2 is the second gradient threshold, and minPerim is the contour perimeter threshold.

[0070] It is understandable that original images of different complexities have different characteristics. By setting different table parameter values ​​for original images of different complexities and performing matching processing, it can be ensured that tactile images with clear outlines and easy tactile recognition can be output for all types of input images from simple to complex.

[0071] Based on any of the above embodiments, generating a corresponding line image based on the contour includes: constructing a canvas of the same size as the size of the filled image; filling the canvas entirely with white; and drawing the contour onto the canvas based on the black single-pixel line width to generate a corresponding line image.

[0072] It should be noted that a new digital image matrix can be created based on the size of the fill image. The canvas is obtained by filling each pixel of the digital image matrix with white values. The parameters of the graphics drawing function are determined by the outline of the fill image. The outline of the fill image is drawn onto the canvas using black lines with a single pixel width to generate a black and white binary line image, which can also be called a black and white sketch.

[0073] The canvas can be a three-channel SketchMat.

[0074] Based on any of the above embodiments, the step of sampling the vector line image to generate a tactile image includes: determining a first resolution of the tactile image and determining a second resolution based on the first resolution; drawing the vector line image with oversampling based on the second resolution to generate an intermediate tactile image; and drawing the intermediate tactile image with undersampling based on the first resolution to generate the tactile image.

[0075] It should be noted that the open-source tool potrace can be called through the ConvertSketch2SVG2PNG function to vectorize the line image to obtain a vector line image. The first resolution of the haptic image can be determined based on the resolution of the refreshable haptic display. The second resolution is determined to be 3-5 times the first resolution. The RenderWithSupersampling function is used to draw the vector line image with oversampling based on the second resolution to generate an intermediate haptic image. The intermediate haptic image is then drawn with high quality downsampling based on the first resolution using interpolation to generate the haptic image.

[0076] For example, the first resolution can be 60×60, and the second resolution is determined to be 4 times the first resolution. Then the second resolution is 240×240, and the size of the filled image is 512×512.

[0077] Among them, intermediate tactile images are also graphics that use black and white pixels to represent image content. The difference between intermediate tactile images and tactile images is that intermediate tactile images have higher resolution, smoother outlines, and richer details.

[0078] It is understandable that vectorizing a line image to obtain a vector line image facilitates the preservation of as much geometric shape information as possible during scaling. By oversampling the vector line image at a higher resolution, an intermediate tactile image is obtained. The intermediate tactile image provides high-quality pixel data. By downsampling the target resolution at a first resolution, high-quality pixel data is drawn to obtain the tactile image. This can minimize jagged edges or breaks and maintain the integrity, continuity, and smoothness of the original contour.

[0079] To illustrate the functionality of the haptic image automatic generation method provided in this implementation, a specific example is given below.

[0080] The original image is acquired. If the size of the original image is greater than an image size threshold, the original image is cropped proportionally to obtain a cropped image. The cropped image is then filtered based on spatial distance and similarity to obtain the filled image.

[0081] Obtain a filled image; convert the filled image to obtain a corresponding grayscale image, and determine the gradient of the pixels in the grayscale image; determine a first gradient threshold and a second gradient threshold, and perform edge recognition on the grayscale image based on the first gradient threshold, the second gradient threshold, and the gradient of the pixels in the grayscale image to obtain a primary recognition contour; repair the primary recognition contour using a shape element of a third resolution to obtain a secondary recognition contour; extract the single-pixel width backbone of the secondary recognition contour to obtain a tertiary recognition contour; when there are at least two tertiary recognition contours, determine the perimeter of each tertiary recognition contour, and retain the tertiary recognition contours whose perimeter is greater than the contour perimeter threshold to obtain the contour of the filled image.

[0082] A canvas of the same size as the filled image is constructed; the canvas is filled entirely with white; the outline is drawn onto the canvas based on the black single-pixel line width to generate a corresponding line image; the line image is vectorized to obtain a vector line image, a first resolution of the tactile image is determined, and a second resolution is determined based on the first resolution; the vector line image is drawn using oversampling based on the second resolution to generate an intermediate tactile image; the intermediate tactile image is drawn using downsampling based on the first resolution to generate the tactile image.

[0083] The automated tactile image generation method provided by this invention can achieve... Figure 2 , 3 As shown in Figure 4, the filled image on the left is converted into a black and white line drawing in the middle, and further processing is used to obtain the tactile image on the right.

[0084] The tactile image automatic generation device provided by the present invention is described below. The tactile image automatic generation device described below and the tactile image automatic generation method described above can be referred to in correspondence.

[0085] Figure 5 This is a schematic diagram of the structure of the tactile image automated generation device provided by the present invention, as shown below. Figure 1 As shown, the device includes the following modules.

[0086] The fill image acquisition module 510 is used to acquire the fill image.

[0087] The contour extraction module 520 is used to perform edge recognition based on the filled image in order to extract the contour of the filled image.

[0088] The line image generation module 530 is used to generate a corresponding line image based on the outline of the filled image.

[0089] The tactile image generation module 540 is used to perform vectorization processing on the line image to obtain a vector line image, and to perform sampling processing on the vector line image to generate a tactile image.

[0090] Based on any of the above embodiments, the contour extraction module 520 is specifically used to convert the filled image to obtain a corresponding grayscale image, and determine the gradient of the pixels in the grayscale image; determine a first gradient threshold and a second gradient threshold, so as to perform edge recognition on the grayscale image according to the first gradient threshold, the second gradient threshold and the gradient of the pixels in the grayscale image to obtain a primary recognition contour; and / or, repair the primary recognition contour by using a shape element of a third resolution to obtain a secondary recognition contour; and / or, extract the single-pixel-width backbone of the secondary recognition contour to obtain a tertiary recognition contour.

[0091] Based on any of the above embodiments, the contour extraction module 520 is specifically used to: determine the perimeter of each primary recognition contour when there are at least two primary recognition contours, retain the primary recognition contours whose perimeter is greater than the contour perimeter threshold, and obtain the contour of the filled image; or, when there are at least two secondary recognition contours, determine the perimeter of each secondary recognition contour, retain the secondary recognition contours whose perimeter is greater than the contour perimeter threshold, and obtain the contour of the filled image; or, when there are at least two tertiary recognition contours, determine the perimeter of each tertiary recognition contour, retain the tertiary recognition contours whose perimeter is greater than the contour perimeter threshold, and obtain the contour of the filled image.

[0092] Based on any of the above embodiments, the apparatus further includes a filling image generation module, configured to acquire an original image, and if the size of the original image is determined to be greater than an image size threshold, to crop the original image proportionally to obtain a cropped image; and to filter the cropped image based on spatial distance and similarity to obtain the filling image.

[0093] Based on any of the above embodiments, after acquiring the original image, the device further includes: determining the complexity of the original image, and at least determining the parameter values ​​of the spatial distance and the similarity based on the complexity of the original image.

[0094] Based on any of the above embodiments, the line image generation module 530 is specifically used to construct a canvas of the same size as the size of the filling image; the canvas is filled entirely with white; and the outline is drawn onto the canvas based on the black single-pixel line width to generate a corresponding line image.

[0095] Based on any of the above embodiments, the tactile image generation module 540 is specifically used to determine a first resolution of the tactile image, and determine a second resolution based on the first resolution; draw the vector line image using oversampling based on the second resolution to generate an intermediate tactile image; and draw the intermediate tactile image using downsampling based on the first resolution to generate the tactile image.

[0096] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute an automated tactile image generation method, which includes: filling an image; performing edge recognition based on the filled image to extract the contour of the filled image; generating a corresponding line image based on the contour of the filled image; performing vectorization processing on the line image to obtain a vector line image; and performing sampling processing on the vector line image to generate a tactile image.

[0097] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0098] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the tactile image automatic generation method provided by the above methods. The method includes: filling an image; performing edge recognition based on the filled image to extract the contour of the filled image; generating a corresponding line image based on the contour of the filled image; performing vectorization processing on the line image to obtain a vector line image; and performing sampling processing on the vector line image to generate a tactile image.

[0099] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the tactile image automatic generation method provided by the methods described above, the method comprising: filling an image; performing edge recognition based on the filled image to extract the contour of the filled image; generating a corresponding line image based on the contour of the filled image; performing vectorization processing on the line image to obtain a vector line image; and performing sampling processing on the vector line image to generate a tactile image.

[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for automatically generating tactile images, characterized in that, include: Get the filled image; Edge recognition is performed on the filled image to extract the contour of the filled image; Generate a corresponding line image based on the outline of the filled image; The line image is vectorized to obtain a vector line image, and the vector line image is sampled to generate a tactile image.

2. The method for automatically generating tactile images according to claim 1, characterized in that, The edge recognition based on the filled image includes: The filled image is converted to obtain the corresponding grayscale image, and the gradient of the pixels in the grayscale image is determined; Determine a first gradient threshold and a second gradient threshold to perform edge recognition on the grayscale image based on the first gradient threshold, the second gradient threshold, and the gradient of pixels in the grayscale image, to obtain a first-order recognition contour; and / or, The primary recognition contour is repaired using shape elements at a third resolution to obtain a secondary recognition contour; and / or, Extract the single-pixel-width main line of the secondary recognition contour to obtain the tertiary recognition contour.

3. The method for automatically generating tactile images according to claim 2, characterized in that, Extracting the contour of the filled image includes: When there are at least two identified contours in a single identification, the perimeter of each identified contour is determined, and the identified contours with a perimeter greater than a contour perimeter threshold are retained to obtain the contour of the filled image; or, When there are at least two secondary recognition contours, the perimeter of each secondary recognition contour is determined, and secondary recognition contours with a perimeter greater than a contour perimeter threshold are retained to obtain the contour of the filled image; or, When there are at least two three-dimensional recognition contours, the perimeter of each three-dimensional recognition contour is determined, and the three-dimensional recognition contours with a perimeter greater than the contour perimeter threshold are retained to obtain the contour of the filled image.

4. The method for automatically generating tactile images according to claim 1, characterized in that, Before obtaining the filled image, the method further includes: If the size of the original image is greater than the image size threshold, the original image is cropped proportionally to obtain a cropped image. The cropped image is filtered based on spatial distance and similarity to obtain the filled image.

5. The method for automatically generating tactile images according to claim 4, characterized in that, After acquiring the original image, the method further includes: The complexity of the original image is determined, and the parameter values ​​of the spatial distance and the similarity are determined based at least on the complexity of the original image.

6. The method for automatically generating tactile images according to claim 1, characterized in that, The step of generating a corresponding line image based on the contour includes: A canvas of the same size as the image to be filled is constructed; the entire canvas is filled with white. The outline is drawn onto the canvas based on the black single-pixel line width to generate a corresponding line image.

7. The method for automatically generating tactile images according to claim 1, characterized in that, The step of sampling the vector line image to generate a tactile image includes: A first resolution of the tactile image is determined, and a second resolution is determined based on the first resolution; The vector line image is drawn using oversampling based on the second resolution to generate an intermediate tactile image; The intermediate tactile image is drawn by subsampling according to the first resolution to generate the tactile image.

8. An automated tactile image generation device, characterized in that, include: The fill image acquisition module is used to acquire the fill image; A contour extraction module is used to perform edge recognition based on the filled image in order to extract the contour of the filled image; A line image generation module is used to generate a corresponding line image based on the outline of the filled image; The tactile image generation module is used to perform vectorization processing on the line image to obtain a vector line image, and to perform sampling processing on the vector line image to generate a tactile image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the haptic image automatic generation method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the haptic image automatic generation method as described in any one of claims 1 to 7.