Method, device, electronic device and storage medium for generating relief optical image
By performing grayscale processing, offset operations and curve fitting on the image, the embossed optical images are generated, which solves the problem that large areas of the image center area are prone to form, and better visual effects and anti-counterfeiting performance are achieved.
Patent Information
- Application Number
- CN202210344012.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-03-31
AI Technical Summary
After the existing relief technology, after holographic lithography, large-area gaps are easily formed in the central area of the image.
By obtaining the pixel matrix of the image to be processed, converting it into a grayscale image, adding it to the default value, performing offset operations, and combining multiple curve fittings to generate a relief optical image.
It avoids large areas of blank areas in the central area of the image after lithography, and improves the visual effect and anti-counterfeiting performance of the embossed optical images.
Smart Images

Figure CN114627105B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of holographic lithography, and in particular to a method, device, electronic equipment and storage medium for generating a relief optical image. Background Art
[0002] Holographic anti-counterfeiting technology evolved from holographic optics has been fully applied in today's packaging and printing field. Holographic optical patterns use optical phenomena such as reflection, transmission, refraction, interference and diffraction of light waves to bring a different visual impact from general printing, with colorful colors, unique textures and dynamics. Adding holographic optical patterns to product packaging can not only attract consumers' attention and promote consumption, but also achieve the purpose of anti-counterfeiting.
[0003] The relief technology can create a real or fake sense of convexity and concavity on a flat surface through the construction of a microstructure. When combined with a printed pattern, it can make the product appear three-dimensional. However, the optical image obtained based on the existing relief technology is prone to form a large blank area in the center of the image after holographic lithography. Summary of the invention
[0004] The purpose of the present invention includes, for example, providing a method, device, electronic device and storage medium for generating a holographic relief optical image, which can overcome the defect that a large area of blank space is easily formed in the central area of the image after holographic lithography.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for generating a relief optical image, which is applied to an electronic device, and the method includes:
[0007] Acquire a pixel matrix of the image to be processed; wherein the pixel matrix contains the pixel value of each pixel point in the image to be processed;
[0008] Converting the pixel value of each pixel in the pixel matrix into a grayscale value to obtain a grayscale image; wherein the grayscale image includes a pattern;
[0009] Adding the grayscale value of each pixel in the grayscale image to a default value to obtain a sub-target image; wherein the default value increases in steps of a preset multiple in a preset direction;
[0010] Performing an offset operation on the grayscale value of each pixel in the pattern to obtain a target pattern;
[0011] Combining the sub-target image with the target pattern to obtain the target image;
[0012] For the grayscale value of each pixel point of the pattern in the target image, an image having multiple curves is obtained; wherein the grayscale values of multiple pixel points on the same curve are the same;
[0013] A fitting operation is performed on the plurality of curves to obtain a relief optical image.
[0014] Furthermore, the step of performing an offset operation on the grayscale value of each pixel in the pattern to obtain a target pattern comprises:
[0015] Calculating the offset value corresponding to each pixel point according to the grayscale value of each pixel point in the pattern;
[0016] The target pattern is obtained by adding the grayscale value of each pixel in the pattern to the offset value corresponding to the pixel.
[0017] Furthermore, the step of converting the pixel value of each pixel in the pixel matrix into a grayscale value to obtain a grayscale image includes:
[0018] selecting a preselected area from the pattern;
[0019] Setting the pixel value of each pixel point in the preselected area to the maximum grayscale value;
[0020] The pixel value of each pixel outside the preselected area is converted into a corresponding grayscale value, so as to obtain the grayscale image; wherein, in order from inside to outside, the grayscale values of the pixel points outside the preselected area gradually decrease.
[0021] Furthermore, the step of obtaining an image having a plurality of curves for the grayscale value of each pixel of the pattern in the target image comprises:
[0022] Obtaining the grayscale value difference and the minimum value of the grayscale values of all pixels of the pattern;
[0023] Obtaining a gray value group according to the minimum value and the gray value difference;
[0024] A curve is obtained according to each gray value in the gray value group, thereby obtaining an image with multiple curves.
[0025] Furthermore, before the step of fitting the plurality of curves to obtain the relief optical image, the method further includes:
[0026] Setting the grayscale values of the pixels on the multiple curves to a maximum value, and setting the grayscale values of the pixels in the target pattern that are not on the multiple curves to zero;
[0027] The grayscale values of the pixels in the target image except the target pattern are set to the maximum value.
[0028] Furthermore, the step of performing a fitting operation on the multiple curves includes:
[0029] For a region between any two adjacent curves, the grayscale values of the pixels of the curves are used as a reference and the grayscale values of the pixels of the region are set to gradually decrease in a preset direction.
[0030] Furthermore, the width of the curve ranges from 2 to 3 um, and the width of the region ranges from 2 to 100 um.
[0031] In a second aspect, an embodiment of the present invention provides a device for generating a relief optical image, the device comprising:
[0032] An acquisition module, used to acquire a pixel matrix of an image to be processed; wherein the pixel matrix contains a pixel value corresponding to each pixel point in the image to be processed;
[0033] A gray value processing module, used for converting the pixel value of each pixel point in the pixel matrix into a gray value to obtain a gray image; wherein the gray image includes a pattern; adding the gray value of each pixel point in the gray image to a default value to obtain a sub-target image; wherein the default value increases in steps of a preset multiple in a preset direction; performing an offset operation on the gray value of each pixel point in the pattern to obtain a target pattern;
[0034] Combining the sub-target image with the target pattern to obtain the target image;
[0035] A curve acquisition module, for obtaining an image having a plurality of curves according to the grayscale value of each pixel point of the pattern in the target image; wherein the grayscale values of the plurality of pixel points on the same curve are the same;
[0036] The image determination module is used to perform a fitting operation on the multiple curves to obtain a relief optical image.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the method described in any one of the first aspects.
[0038] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method as described in any one of the first aspects are executed.
[0039] The beneficial effects of the embodiments of the present invention include, for example: obtaining a pixel matrix of an image to be processed, converting the pixel value of each pixel in the pixel matrix into a grayscale value, and obtaining a grayscale image. Wherein, the grayscale image includes a pattern. The grayscale value of each pixel in the grayscale image and the pattern is processed to obtain a target image. For the grayscale value of each pixel of the pattern in the target image, an image with multiple curves is obtained. Wherein, the grayscale values of multiple pixels on the same curve are the same. Fitting operations are performed on the multiple curves to obtain a relief optical image. Therefore, the image finally formed after photolithography based on the relief optical image will not form a large blank area in the central area. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention 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 creative work.
[0041] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0042] Figure 2 One of the flowchart diagrams of a method for generating a relief optical image provided by an embodiment of the present invention.
[0043] Figure 3 A schematic diagram of a target image visual effect provided by an embodiment of the present invention.
[0044] Figure 4 The second flowchart of a method for generating a relief optical image provided by an embodiment of the present invention. Figure 5 A third flow chart of a method for generating a relief optical image provided by an embodiment of the present invention.
[0045] Figure 6 A fourth flowchart of a method for generating a relief optical image provided by an embodiment of the present invention.
[0046] Figure 7 A schematic diagram of an image with multiple curves provided by an embodiment of the present invention.
[0047] Figure 8 A fifth flow chart of a method for generating a relief optical image provided by an embodiment of the present invention.
[0048] Fig. 9 A schematic diagram of an image after a fitting operation provided by an embodiment of the present invention.
[0049] Fig.10 A schematic diagram of a partial structure of an optical film provided by an embodiment of the present invention in a side view.
[0050] Fig.11 A schematic diagram of functional modules of a device for generating a relief optical image provided by an embodiment of the present invention.
[0051] Icon: 100 - electronic device; 110 - communication unit; 120 - memory; 130 - processor;
[0052] 200 - device for generating relief optical image; 210 - acquisition module; 220 - gray value processing module;
[0053] 230 - curve acquisition module; 240 - image determination module. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0055] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0057] In the description of the present invention, it should be noted that if the term "upper" appears, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the invention is usually placed when used. This is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.
[0058] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0059] To facilitate the understanding of photolithography, the entire photolithography process will be explained below. After obtaining the relief optical image, the relief optical image will be used for photolithography on the photoresist to obtain the photoresist plate, and then through a series of processes such as exposure, development, electroforming, and molding to obtain an optical film, which can be used for product packaging.
[0060] In actual applications, the inventors found that the embossed optical image obtained using the existing embossing technology leaves obvious marks on the photoresist plate due to the closed loop in the center of the embossed optical image, the wide lines near the closed loop, and the different widths of the lines, resulting in a large blank area in the center of the optical film obtained based on the photoresist plate.
[0061] The defects existing in the above schemes are the results obtained by the inventor after experiments and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of this application below for the above problems should be the contributions made by the inventor to this application during the invention process.
[0062] Please refer to Figure 1 , is a schematic diagram of a structure of an electronic device 100 according to an embodiment of the present invention. The electronic device 100 includes a memory 120 , a processor 130 and a communication unit 110 .
[0063] The memory 120, the processor 130 and the communication unit 110 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. At least one software function module of the holographic relief optical image generation method can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable module stored in the memory 120.
[0064] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction. The communication unit 110 is used to connect and communicate with an external system.
[0065] The processor 130 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0066] Based on the above electronic equipment, Figure 2 One of the flow charts of a method for generating a relief optical image provided by an embodiment of the present invention. Figure 2 shown.
[0067] Step S101: Obtain a pixel matrix of an image to be processed.
[0068] The pixel matrix contains the pixel value of each pixel in the image to be processed.
[0069] Step S102: convert the pixel value of each pixel in the pixel matrix into a grayscale value to obtain a grayscale image.
[0070] The grayscale image includes a pattern.
[0071] Step S103: Add the grayscale value of each pixel in the grayscale image to the default value to obtain a sub-target image.
[0072] The default value increases in steps of preset multiples in a preset direction.
[0073] Step S104: offset the grayscale value of each pixel in the pattern to obtain a target pattern.
[0074] Step S105: Combine the sub-target image with the target pattern to obtain the target image.
[0075] Step S106: Obtain an image with multiple curves for the grayscale value of each pixel of the pattern in the target image.
[0076] Among them, the grayscale values of multiple pixels on the same curve are the same.
[0077] Step S107: performing fitting operation on multiple curves to obtain a relief optical image.
[0078] The pixel matrix of the image to be processed is obtained, and the pixel value of each pixel in the pixel matrix is converted into a grayscale value to obtain a grayscale image including a pattern. The grayscale value of each pixel in the grayscale image and the pattern is processed to obtain a target image. For the grayscale value of each pixel of the pattern in the target image, an image with multiple curves is obtained. Among them, the grayscale values of multiple pixels on the same curve are the same. The multiple curves are fitted to obtain a relief optical image. Since there is no closed loop and the width of the lines is the same, the optical film finally prepared after holographic lithography based on the relief optical image will not form a large blank area in the central area.
[0079] Continue reading Figure 2 By performing different grayscale processing on the grayscale image and the pixel points of the pattern, it is avoided that the subsequent line cutting based on the target image is performed, and when multiple curves are obtained, no closed loop curve will appear. In this way, it is avoided that a large area of blank area appears in the center area of the optical film, and the relief effect of the final optical relief image is better, that is, the visual presentation effect is better.
[0080] Among them, the preset direction can be from top to bottom, from bottom to top, from left to right, etc., and can be set according to the actual application. The following is the same and will not be repeated. In some embodiments, the grayscale value of the pixel point in the holographic relief optical image can be characterized as a height attribute in the visual effect. For example, it can be understood that the larger the grayscale value of a pixel point, the higher the visual height of the pixel point in the image after holographic lithography. Based on the embossed optical image, the optical film prepared after holographic lithography has a strong convex and dynamic effect under the illumination of a point light source, which makes the anti-counterfeiting effect better.
[0081] In some embodiments, the optical film prepared by the above method embodiments can be used on the packaging or labels of products such as labels, logos, hangtags, daily chemical packaging, product packaging, etc. to achieve anti-counterfeiting effects. Among them, the optical film can be adhered to various objects through various bonding mechanisms, such as being transferred to the product packaging by hot stamping.
[0082] For ease of understanding, it should be noted that when the grayscale value of a certain pixel is 0, the pixel visually appears black, and when the grayscale value of a certain pixel is the maximum value, the pixel visually appears white. This will not be described in detail later.
[0083] In some embodiments, the target image may be a tiff file with a grayscale value of 16 bits. In a preset direction, the grayscale value of the image gradually decreases. This may make the target image appear as a pattern floating from an inclined surface in visual effect. Figure 3 , which is a schematic diagram of the visual effect of the target image.
[0084] The specific offset operation can be performed as follows: Figure 4 The second flow chart of a method for generating a relief optical image provided by an embodiment of the present invention, step S202 may be performed in the following manner:
[0085] Step S104a: Calculate the offset value corresponding to each pixel point according to the gray value of each pixel point in the pattern.
[0086] Step S104b: Add the grayscale value of each pixel in the pattern to the offset value corresponding to the pixel to obtain a target pattern.
[0087] In some embodiments, after the grayscale value of the grayscale image is set as a whole, the grayscale value of the pixel points corresponding to the pattern needs to be set to obtain a better relief effect. In a preferred embodiment, the value of the offset value can be in the range of 1%-10% of the original grayscale value, and the specific calculation method of the offset value can also be set according to the actual application.
[0088] When the pixel value of a pixel point is converted into a grayscale value, different grayscale images will be obtained due to different methods adopted, so that the effects of the optical film finally prepared are also different. Figure 5 The third flow chart of a method for generating a relief optical image provided by an embodiment of the present invention. Step S102 may be performed in the following manner:
[0089] Step S201: select a pre-selected area from the pattern.
[0090] Step S202: setting the pixel value of each pixel in the pre-selected area to the maximum grayscale value.
[0091] Step S203: convert the pixel value of each pixel outside the pre-selected area into a corresponding grayscale value, thereby obtaining a grayscale image.
[0092] Among them, in order from inside to outside, the grayscale values of pixels outside the pre-selected area gradually decrease.
[0093] From the pattern, a selected area, i.e., the preselected area, has a maximum grayscale value for the pixels in the area, i.e., the grayscale value can be 255 or 65535. Among them, the contour line of the preselected area can also be set to the maximum value. The grayscale values of the pixels outside the area are set to gradually decrease in order from the inside to the outside. As a result, the optical film finally prepared presents a flat raised relief feeling in visual effect. In terms of visual effect, it can be understood that the optical film presents a flat surface in the preselected area, the contour line of the preselected area is clear, and the preselected area presents a slowly raised state, thereby meeting the application requirements.
[0094] In some embodiments, the grayscale image obtained in step S102 may be an 8-bit bitmap image, i.e., the grayscale value of the pixel is in the range of 0-255, or a 16-bit bitmap image, i.e., the grayscale value of the pixel is in the range of 0-65535. The resolution of the image may be set to 2036 Dpi, or may be set according to actual application requirements.
[0095] In addition, the grayscale image can be obtained in the following way.
[0096] The first method is to set the grayscale value of the center of the pattern to be the maximum value or greater than the grayscale value of any pixel of the image to be processed. For the images to be processed except the center, the grayscale value is set to gradually decrease from the center to the outside.
[0097] In order to simplify the method, it has better effect. Figure 6 The fourth flow chart of a method for generating a relief optical image provided by an embodiment of the present invention, step S106 can be performed in the following manner:
[0098] Step S106a, obtaining the gray value difference and the minimum gray value of all pixels of the pattern.
[0099] Step S106b: Obtain a gray value group according to the minimum value and the gray value difference.
[0100] Step S106c: obtain a curve according to each gray value in the gray value group, thereby obtaining an image with multiple curves.
[0101] In some embodiments, the grayscale value difference and the minimum grayscale value of all pixel points of the pattern are obtained. The grayscale value difference can be manually selected and set, or can be preset in the above electronic device.
[0102] In some embodiments, a gray value group is obtained based on the difference between the minimum value and the gray value. In the gray value group, the difference between any two adjacent gray values is the gray value difference. For example, if the minimum value is 25 and the gray value difference is 10, then the gray values obtained are 25, 35, 45, etc. in sequence. The maximum value of the gray value in the gray value group may be no greater than the maximum value of all pixels of the pattern, or may be no greater than a preset value.
[0103] In some embodiments, an image having multiple curves in the pattern area may refer to Figure 7 , is a schematic diagram of an image with multiple curves, where the image with multiple curves can be based on a target image, and other images having a corresponding position relationship with the target image are obtained. The corresponding position can be a contour line of a pattern, etc.
[0104] It can also be obtained on the original target image by the following processing: setting the grayscale values of the pixels on the multiple curves to the maximum value, setting the grayscale values of the pixels in the target pattern that are not on the multiple curves to zero, and setting the grayscale values of the pixels in the target image other than the target pattern to the maximum value.
[0105] In order to make the optical film finally prepared by the embossed optical image have a three-dimensional effect, Figure 8 The fifth flow chart of a method for generating a relief optical image provided by an embodiment of the present invention, step S107 can be processed in the following manner:
[0106] Step S301: For a region between any two adjacent curves, the grayscale values of the pixels of the curves are used as a reference and the grayscale values of the pixels of the region are set to gradually decrease in a preset direction.
[0107] Based on the above step S301, a relief optical image is obtained, so that the optical film prepared by holographic lithography based on the relief optical image can have a strong convex and dynamic effect under the illumination of a point light source.
[0108] For example, based on the above Figure 7 , the image after the pattern fitting operation can be referred to Fig. 9 , is a schematic diagram of the image after the fitting operation.
[0109] In some embodiments, the grayscale value range of the pixel points in the above region can be set according to the recognition range of the lithography machine. For example, if the range of steps that the lithography machine can recognize is 256, then the grayscale value range of the pixel points in the above region is 0-255.
[0110] In some embodiments, the width of the curve may range from 2 to 3 um, and the width of the region may range from 2 to 100 um. Fig.10 , which is a schematic diagram of the partial structure of the optical film from a side view. It can be understood as a multi-step staircase, where the width of each step is in the range of 2-100um and the height of each step is 2-3um.
[0111] Fig.11 The present invention provides a functional module diagram of a device 200 for generating an embossed optical image. The basic principle and technical effects of the device are the same as those of the corresponding method embodiment described above. For the sake of brief description, the parts not mentioned in this embodiment can be referred to the corresponding contents in the method embodiment. Fig.11 As shown, the device includes an acquisition module 210 , a gray value processing module 220 , a curve acquisition module 230 and an image determination module 240 .
[0112] The acquisition module 210 is used to acquire a pixel matrix of the image to be processed, wherein the pixel matrix includes a pixel value corresponding to each pixel point in the image to be processed.
[0113] The grayscale value processing module 220 is used to convert the pixel value of each pixel in the pixel matrix into a grayscale value to obtain a grayscale image. The grayscale image includes a pattern. The grayscale value of each pixel in the grayscale image is added to a default value to obtain a sub-target image. The default value is increased in steps of a preset multiple in a preset direction. The grayscale value of each pixel in the pattern is offset to obtain a target pattern. The sub-target image is combined with the target pattern to obtain a target image.
[0114] The curve acquisition module 230 is used to obtain an image with multiple curves according to the grayscale value of each pixel point of the pattern in the target image, wherein the grayscale values of multiple pixels on the same curve are the same.
[0115] The image determination module 240 is used to perform a fitting operation on a plurality of curves to obtain a relief optical image.
[0116] The curve acquisition module 230 is also used to set the grayscale values of the pixels on the multiple curves to the maximum value, set the grayscale values of the pixels in the target pattern that are not on the multiple curves to zero, and set the grayscale values of the pixels in the target image other than the target pattern to the maximum value.
[0117] An embodiment of the present invention further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method embodiment are executed.
[0118] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0120] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: 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 codes.
[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0122] In summary, the embodiments of the present invention provide a method, device, electronic device and storage medium for generating a relief optical image, which processes the grayscale values of the pixels of an image and a pattern, obtains a final image of multiple curves, and performs a fitting operation on the image to obtain a relief optical image. The optical film prepared based on the relief optical image will not have a large blank area in the central area.
[0123] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for generating a relief optical image, applied to an electronic device, characterized in that: The method comprises: Acquire a pixel matrix of the image to be processed; wherein the pixel matrix contains the pixel value of each pixel point in the image to be processed; Converting the pixel value of each pixel in the pixel matrix into a grayscale value to obtain a grayscale image; wherein the grayscale image includes a pattern; Adding the grayscale value of each pixel in the grayscale image to a default value to obtain a sub-target image; wherein the default value increases in steps of a preset multiple in a preset direction; Performing an offset operation on the grayscale value of each pixel in the pattern to obtain a target pattern; Combining the sub-target image with the target pattern to obtain the target image; For the grayscale value of each pixel point of the pattern in the target image, an image having multiple curves is obtained; wherein the grayscale values of multiple pixel points on the same curve are the same; Performing a fitting operation on the plurality of curves to obtain a relief optical image; Among them, the step of offsetting the grayscale value of each pixel in the pattern to obtain the target pattern includes: calculating the offset value corresponding to each pixel according to the grayscale value of each pixel in the pattern, wherein the offset value corresponding to the pixel is the product of the grayscale value of the pixel and a preset ratio, and the preset ratio is within 1%~10%; adding the grayscale value of each pixel in the pattern to the offset value corresponding to the pixel to obtain the target pattern.
2. The method according to claim 1, characterized in that The step of converting the pixel value of each pixel point in the pixel matrix into a grayscale value to obtain a grayscale image comprises: selecting a preselected area from the pattern; Setting the pixel value of each pixel point in the preselected area to the maximum grayscale value; The pixel value of each pixel outside the preselected area is converted into a corresponding grayscale value, so as to obtain the grayscale image; wherein, in order from inside to outside, the grayscale values of the pixel points outside the preselected area gradually decrease.
3. The method according to claim 1, characterized in that The step of obtaining an image having a plurality of curves based on the grayscale value of each pixel of the pattern in the target image comprises: Obtaining the grayscale value difference and the minimum value of the grayscale values of all pixels of the pattern; Obtaining a gray value group according to the minimum value and the gray value difference; A curve is obtained according to each gray value in the gray value group, thereby obtaining an image with multiple curves.
4. The method according to claim 1, characterized in that: Before the step of fitting the plurality of curves to obtain the relief optical image, the method further comprises: Setting the grayscale values of the pixels on the multiple curves to a maximum value, and setting the grayscale values of the pixels in the target pattern that are not on the multiple curves to zero; The grayscale values of the pixels in the target image except the target pattern are set to the maximum value.
5. The method according to claim 4, characterized in that The step of performing a fitting operation on the multiple curves comprises: For a region between any two adjacent curves, the grayscale values of the pixels of the curves are used as a reference and the grayscale values of the pixels of the region are set to gradually decrease in a preset direction.
6. The method according to claim 5, characterized in that The width of the curve ranges from 2 to 3 um, and the width of the region ranges from 2 to 100 um.
7. A device for generating a relief optical image, characterized in that: The device comprises: An acquisition module, used to acquire a pixel matrix of an image to be processed; wherein the pixel matrix contains a pixel value corresponding to each pixel point in the image to be processed; A gray value processing module, used for converting the pixel value of each pixel point in the pixel matrix into a gray value to obtain a gray image; wherein the gray image includes a pattern; adding the gray value of each pixel point in the gray image to a default value to obtain a sub-target image; wherein the default value increases in steps of a preset multiple in a preset direction; performing an offset operation on the gray value of each pixel point in the pattern to obtain a target pattern; combining the sub-target image with the target pattern to obtain the target image; A curve acquisition module, for obtaining an image having a plurality of curves according to the grayscale value of each pixel point of the pattern in the target image; wherein the grayscale values of the plurality of pixel points on the same curve are the same; An image determination module, used for performing a fitting operation on the plurality of curves to obtain a relief optical image; Among them, the grayscale value processing module is specifically used to: calculate the offset value corresponding to each pixel point according to the grayscale value of each pixel point in the pattern, wherein the offset value corresponding to the pixel point is the product of the grayscale value of the pixel point and a preset ratio, and the preset ratio is within 1%~10%; add the grayscale value of each pixel point in the pattern and the offset value corresponding to the pixel point to obtain the target pattern.
8. An electronic device, characterized in that: include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein the program implements the method according to any one of claims 1 to 6 when executed by the processor.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Method of forming a synthetic hologram in a raster image
CN103136737A
Image processing apparatus, and image processing method and program
JP2013236180A