Two-dimensional code background picture recognition method for scientific education and programming platform

By identifying and processing transparent pixel points in QR code pictures containing background elements, the problem of inaccurate QR code recognition is solved, the aesthetics and recognition rate of QR codes are improved, suitable for users to share and use, and processed on the web side, reducing costs and improving data security.

CN119862897APending Publication Date: 2025-04-22SHENZHEN DIANMAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411837647.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art often faces the problem of picture beautification and identification accuracy when identifying QR code pictures containing background elements, especially when dealing with complex backgrounds such as GIF multi-frame pictures, which affects the user experience and the accurate transmission of information.

Method used

By obtaining the original background image, QR code picture with background and QR code picture without background, traverse the pixel points of the original background image, identify transparent pixel points, and set the corresponding position to transparent on the QR code picture based on these transparent pixel points, and finally copy the processed QR code picture to the QR code picture without background.

Benefits of technology

It solves the problem of low QR code recognition rate caused by background element interference, improves the visual effect of background QR code, makes the QR code more beautiful, is suitable for users to share and use, and is processed on the web, reducing costs and improving data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862897A_ABST
    Figure CN119862897A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional code background picture recognition method for scientific education and a programming platform. The method comprises the steps that a first picture, a second picture and a third picture are acquired, the first picture is an original background picture containing background elements, the second picture is a two-dimensional code picture containing background elements, and the third picture is a two-dimensional code picture not containing background elements; traversing pixel points of the first picture, identifying transparent pixel points in the first picture, and setting corresponding positions on the second picture to be transparent based on the transparent pixel points to obtain the processed second picture; and copying the processed second picture to the third picture to obtain a final two-dimensional code picture. According to the invention, the technical problem of inaccurate recognition of a two-dimensional code picture containing background elements in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and a programming platform for two-dimensional code recognition background images for scientific education. Background Art

[0002] With the popularity of smartphones and mobile devices, QR codes have become an important way to exchange information. In modern Web development, processing QR code generation is a very common requirement. In Web QR code generation technology, it is sometimes necessary to identify the background image passed by the user and draw it in the QR code for use in certain scenarios. However, existing Web QR code generation technology often faces the problem of image beautification when identifying the background. When dealing with complex backgrounds such as multi-frame gif images, there will also be problems with recognition accuracy, which will affect the user experience and the accurate transmission of information.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiment of the present invention provides a method and a programming platform for two-dimensional code recognition background images for science education, so as to at least solve the technical problem of inaccurate recognition of two-dimensional code images containing background elements in the prior art.

[0005] According to one aspect of an embodiment of the present invention, there is provided a method for processing a two-dimensional code image for science education, comprising: obtaining a first image, a second image and a third image, wherein the first image is an original background image containing background elements, the second image is a two-dimensional code image containing background elements, and the third image is a two-dimensional code image that does not contain background elements; traversing the pixels of the first image, identifying transparent pixels in the first image, and based on the transparent pixels, setting the corresponding positions on the second image to transparent, to obtain the processed second image; and copying the processed second image to the third image, to obtain the final two-dimensional code image.

[0006] According to another aspect of an embodiment of the present invention, a two-dimensional code image processing device for science education is also provided, including: an acquisition module, configured to acquire a first image, a second image and a third image, wherein the first image is an original background image containing background elements, the second image is a two-dimensional code image containing background elements, and the third image is a two-dimensional code image that does not contain background elements; a processing module, configured to traverse the pixels of the first image, identify transparent pixels in the first image, and based on the transparent pixels, set the corresponding positions on the second image to transparent, so as to obtain the processed second image; a generation module, configured to copy the processed second image to the third image, so as to obtain the final two-dimensional code image.

[0007] In an embodiment of the present invention, a first picture, a second picture and a third picture are obtained, wherein the first picture is an original background picture containing background elements, the second picture is a two-dimensional code picture containing background elements, and the third picture is a two-dimensional code picture without background elements; the pixels of the first picture are traversed to identify transparent pixels in the first picture, and based on the transparent pixels, the corresponding positions on the second picture are also set to be transparent to obtain the processed second picture; the processed second picture is copied to the third picture to obtain the final two-dimensional code picture. Through the above scheme, the technical problem of inaccurate recognition of two-dimensional code pictures containing background elements in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0009] Figure 1 is a flow chart of a two-dimensional code image processing method for scientific education according to an embodiment of the present application;

[0010] Figure 2 is a flow chart of another two-dimensional code image processing method for scientific education according to an embodiment of the present application;

[0011] Figure 3 is an original background image including background elements according to an embodiment of the present application;

[0012] Figure 4 is an example diagram of a QR code image including background elements according to an embodiment of the present application;

[0013] Figure 5 is an example diagram of a QR code image according to an embodiment of the present application;

[0014] Figure 6is a flow chart of an improved transparent pixel identification method according to an embodiment of the present application;

[0015] Figure 7 is a structural diagram of a two-dimensional code image processing device for scientific education according to an embodiment of the present application;

[0016] Figure 8 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0019] According to an embodiment of the present invention, a method embodiment of a two-dimensional code image processing method for scientific education is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0020] The existing technology has the following shortcomings when processing QR codes with backgrounds: the background is not beautified, resulting in the generated QR codes with backgrounds not being beautiful enough, affecting user sharing and use. Background interference leads to a decrease in the QR code recognition rate. There is a lack of effective algorithms to distinguish the QR code from the background, resulting in a cumbersome recognition process.

[0021] In order to solve the above problems, the embodiment of the present invention provides a two-dimensional code image processing method for scientific education, such as Figure 1 As shown, the method comprises the following steps:

[0022] Step S102, obtaining a first picture, a second picture and a third picture, wherein the first picture is an original background picture containing background elements, the second picture is a QR code picture containing background elements, and the third picture is a QR code picture not containing background elements.

[0023] Create corresponding first canvas, second canvas and third canvas for the first picture, the second picture and the third picture respectively, and render the first picture, the second picture and the third picture onto the corresponding first canvas, the second canvas and the third canvas respectively; set the width and height of the first picture to the width and height of the second picture.

[0024] Step S104, traverse the pixels of the first image, identify transparent pixels in the first image, and based on the transparent pixels, set the corresponding positions on the second image to be transparent, so as to obtain the processed second image.

[0025] Pixels of the first picture in the first canvas are traversed to identify transparent pixels in the first canvas; and corresponding positions on the second picture on the second canvas are also set to be transparent based on the transparent pixels.

[0026] Step S106, copying the processed second image to the third image to obtain a final two-dimensional code image.

[0027] The second image on the second canvas is drawn onto the third canvas on which the third image is rendered, to obtain the final QR code image. A user scanning operation on the final QR code image is detected, and corresponding text is displayed in the graphical programming platform based on the setting of the final QR code image.

[0028] Figure 2 is another two-dimensional code image processing method for scientific education according to an embodiment of the present invention, such as Figure 2 As shown, the method comprises the following steps:

[0029] Step S202, loading pictures.

[0030] First, the first picture, the second picture, and the third picture uploaded by the user are loaded, wherein the first picture is the original background picture, for example, Figure 3 As shown in FIG. 1 , the image contains complex background elements and has certain interference. The second image is a QR code image containing background elements generated by the prior art, for example, Figure 4 As shown, the third picture is a pure QR code picture without background elements, for example Figure 5 The loading module will detect and pre-process the basic properties of the image, such as format, size, transparency, etc., for subsequent processing.

[0031] Step S204, creating a corresponding canvas and rendering the image.

[0032] For these three pictures, corresponding canvases are created respectively. The first canvas is used to display the first picture, i.e., the original background picture. The second canvas is used to display the second picture, i.e., the QR code picture with background. The third canvas is used to display the third picture, i.e., the pure QR code picture without background.

[0033] The first image, the second image and the third image are rendered onto the corresponding first canvas, the second canvas and the third canvas respectively. Afterwards, the width and height of the first image are set to be the same as the width and height of the second image to ensure the alignment of the canvases and the correspondence of transparent pixels in subsequent processing steps.

[0034] Step S206: background transparent pixel processing.

[0035] Start traversing each pixel of the first picture in the first canvas, and read the color value and transparency information of the pixel one by one to identify the transparent pixel in the first picture. Specifically, first, initialize the data structure to store possible transparent pixel information, including its position coordinates, color value, transparency value, etc. Then, read the color value and transparency information pixel by pixel. During the traversal process, for each pixel, the color value information of the pixel (usually including the three color channel values ​​of red, green, and blue) and the transparency value (usually the Alpha channel) are first extracted. The system records the relevant information for each pixel by reading these values ​​and storing them in the corresponding data structure. Then, after obtaining the color value and transparency information of each pixel, the transparent pixel is preliminarily screened according to the preset transparency threshold. Specifically, if the transparency of a pixel is lower than the predetermined threshold (for example, the transparency value is less than 50%), the pixel is regarded as a transparent candidate point, and the position information of the pixel is recorded for subsequent further screening. Finally, the transparent candidate points are stored. After the transparency condition screening, the transparent candidate points that meet the conditions will be stored in the initialized data structure. In some other embodiments, in order to more accurately identify transparent pixels, an improved transparent pixel identification method may be used for identification. The method will be described in detail below and will not be repeated here.

[0036] Then, based on the transparent pixel information in the first image, the pixel at the corresponding position of the second image on the second canvas is set to transparent. In this way, the recognizability of the QR code is enhanced by applying background transparency to the QR code image, and background elements are prevented from interfering with recognition.

[0037] By traversing the first canvas, each transparent pixel can be accurately identified and processed to ensure that the QR code area is retained in the final output while eliminating unnecessary background interference.

[0038] Step S208, generating a final QR code image.

[0039] The second image that has been made transparent is copied to the third image to obtain a final QR code image. That is, the second image that has been made transparent on the second canvas is drawn onto the third canvas on which the third image is rendered to generate a QR code image without a background.

[0040] Step S210, scan the code to detect and display text.

[0041] The system detects the user's scanning operation on the final QR code image. After the code is scanned successfully, the system displays the corresponding text content in the graphical programming platform based on the setting information of the final QR code image to provide visual operation feedback.

[0042] This method achieves accurate recognition and transparent processing of background images through traversal pixel and transparent pixel processing technology, solving the problem of low QR code recognition rate caused by background interference in the prior art. By making complex backgrounds transparent, this method improves the visual effect of QR codes with backgrounds, making the QR codes more beautiful and suitable for users to share and use. In addition, this method is completely processed on the Web side, without the need for additional operations on the server side, reducing processing costs and improving data security.

[0043] The following is a detailed description of the improved transparent pixel recognition method, which introduces multi-level transparency judgment conditions and dynamic feature screening mechanisms based on feature extraction and brightness judgment. Figure 6 As shown, the method comprises the following steps:

[0044] Step S602: extracting initialization features.

[0045] First, perform feature detection on each pixel p in the image. For each pixel p, read its brightness value I p , and dynamically set the brightness threshold T based on the brightness value g =0.15×I p The combination of the two thresholds can improve the hierarchical screening effect of transparent pixels to avoid missed detection caused by a single threshold.

[0046] Step S604: grouping and multi-level filtering the pixels in the area.

[0047] Taking pixel p as the center, select 16 pixels in a neighborhood with a radius of 3, and divide these pixels into four groups (4 pixels in each group) according to the brightness characteristics. The specific multi-level screening steps are as follows:

[0048] 1) Rapid preliminary screening.

[0049] Check the four pixels labeled (1, 5, 9, 13). If the brightness change of at least three pixels satisfies the condition |I pi -I p ∣>T g , then the pixel p may be a transparent candidate point, and proceed to the next step; if it does not meet the requirement, the pixel is directly excluded.

[0050] 2) Dynamic transparency detection.

[0051] For the transparent candidate points that have passed the preliminary screening, check the four pixels labeled (2, 6, 10, 14) again to determine whether there are more than three pixels that meet the condition |I pi -I p |>Tg′. If it is satisfied, then enter the further multi-level detection step, otherwise exclude the pixel.

[0052] 3) Local transparency accumulation judgment.

[0053] Among the transparent candidate pixels selected above, further local transparency accumulation judgment is performed to check the brightness accumulation value in the neighborhood and calculate the sum of brightness changes. If the brightness change accumulation value exceeds the preset transparency accumulation threshold T acc =0.3×∑Ip, the pixel can be determined as a transparent pixel; otherwise, the pixel is excluded.

[0054] In some other embodiments, after executing the above steps, in order to improve the efficiency and accuracy of feature extraction, an adaptive feature extraction algorithm may be further used to dynamically adjust the number and position of feature point extraction according to the distribution density of transparent pixels, as follows:

[0055] 1) Generate a transparency heatmap.

[0056] After initially detecting the transparent pixels in the image, a transparency heat map is generated by counting the distribution of these transparent pixels in the entire image. Specifically, the image is divided into several small areas, and the number of transparent pixels in each area is counted. According to the density of transparent pixels, different areas are divided into transparent dense areas and transparent sparse areas. The transparency heat map can mark the distribution density of transparent pixels for each area, and different densities directly affect the subsequent feature extraction processing method. This localized distribution information not only improves the accuracy of the algorithm, but also reduces unnecessary feature extraction steps in the entire image, avoiding processing redundancy.

[0057] 2) Strengthen the characteristics of densely populated areas.

[0058] In the transparent dense area marked by the transparency heat map, the density of feature extraction is automatically increased to capture more key feature points. Specifically, a smaller feature extraction window is selected in the dense area to more finely scan and extract the transparent pixel features in the area. The frequency of key point sampling is increased to make the feature extraction in the area more intensive, ensuring that enough feature points are captured to facilitate subsequent transparent pixel determination and analysis. In addition, by enhancing the accuracy of feature extraction, more recognizable feature information can be obtained in areas with higher transparency, ensuring the accuracy of the algorithm in transparent dense areas. The feature enhancement processing of dense areas in this application can improve the quality of feature expression in transparent areas, ensuring that richer feature information is obtained in areas with high transparency to support more complex subsequent processing and analysis steps.

[0059] 3) Feature dilution in sparse regions.

[0060] For areas with fewer transparent pixels in the transparency heat map, the frequency of feature extraction will be reduced accordingly to improve computing efficiency. Specifically, the dilution process includes: selecting a larger feature extraction window in the transparent sparse area, thereby reducing the number of feature point sampling. Adjust the sampling frequency to extract only a small number of key feature points in the sparse area to reduce unnecessary computing overhead. Through the feature dilution strategy in sparse areas, the present application achieves a reasonable allocation of computing resources without affecting the overall recognition effect of transparent pixels, thereby optimizing the operating efficiency of the system.

[0061] The transparent pixels extracted through the above steps may still contain a small number of false positives. Therefore, preferably, the transparent pixels may be further screened and optimized.

[0062] 1) Local pixel consistency detection.

[0063] First, calculate the local brightness similarity. For each transparent candidate pixel, the system calculates its brightness similarity with the adjacent transparent candidate points, and by comparing the brightness difference, screens out the false detection points with large brightness changes and not conforming to the characteristics of the transparent area. Next, using adaptive threshold filtering, the system sets an adaptive threshold for brightness similarity to ensure that the brightness difference of transparent pixels in the local area is within a reasonable range, thereby enhancing the coherence and consistency of the transparent area. Finally, optimize the brightness balance. For transparent pixels that pass the similarity detection, the system further adjusts their brightness balance to ensure that the final output transparent pixel area has a highly consistent visual effect in brightness. Through the local pixel consistency detection step, the system effectively filters out abnormal pixels that do not conform to the brightness characteristics of the transparent area, reduces false detections, and improves the reliability of transparent pixel recognition.

[0064] 2) Edge pixel correction.

[0065] First, detect the edge area. The system determines the spatial position of the transparent pixel to determine whether the point is close to the edge of the picture, ensuring that the screening step is mainly for pixels where the edge effect may be strong. Next, calculate the average brightness of the adjacent area. For transparent pixels located at the edge, the system further analyzes the average brightness of the surrounding area and excludes those pixels with small brightness changes and do not meet the transparent characteristics. Finally, perform edge smoothing: For edge points that meet the transparent pixel characteristics, smooth their brightness and transparency to reduce the impact of edge effects on the overall transparent area and ensure a natural transition of the transparent area boundary. Through edge pixel correction, the system effectively reduces the false detection caused by edge effects and ensures that the transparent area also has stable feature performance at the boundary.

[0066] 3) Feature fusion optimization.

[0067] Finally, an improved feature matching algorithm is used to cross-validate the features of transparent pixels and their surrounding areas, and possible false positives are screened out by optimizing the matching scores to ensure that only core pixels that meet the transparent characteristics are retained. Finally, the system establishes feature associations between transparent areas and surrounding non-transparent areas to enhance the distribution of transparent pixels, thereby improving the coherence and consistency of overall transparent pixel recognition.

[0068] Through the above method, the present application realizes efficient and accurate recognition of transparent pixels in a single image, and ensures the accuracy of the detection results through adaptive feature extraction and multi-level filtering steps.

[0069] The present application also provides a two-dimensional code image processing device for scientific education, such as Figure 7As shown, it includes: an acquisition module 72, configured to acquire a first picture, a second picture and a third picture, wherein the first picture is an original background picture containing background elements, the second picture is a two-dimensional code picture containing background elements, and the third picture is a two-dimensional code picture that does not contain background elements; a processing module 74, configured to traverse the pixels of the first picture, identify transparent pixels in the first picture, and based on the transparent pixels, set the corresponding positions on the second picture to be transparent, so as to obtain the processed second picture; a generation module 76, configured to copy the processed second picture to the third picture, so as to obtain the final two-dimensional code picture.

[0070] It should be noted that the virtual object rendering device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual object rendering device provided in the above embodiment and the virtual object rendering method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0071] Figure 8 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0072] like Figure 8 As shown, the electronic device includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0073] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0074] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A two-dimensional code image processing method for scientific education, characterized in that: include: Acquire a first picture, a second picture, and a third picture, wherein the first picture is an original background picture including background elements, the second picture is a QR code picture including background elements, and the third picture is a QR code picture not including background elements; Traversing the pixels of the first picture, identifying transparent pixels in the first picture, and setting corresponding positions on the second picture to be transparent based on the transparent pixels, so as to obtain a processed second picture; The processed second image is copied to the third image to obtain a final two-dimensional code image.

2. The method according to claim 1, characterized in that After acquiring the first picture, the second picture and the third picture, the method further includes: creating corresponding first canvas, second canvas and third canvas for the first picture, the second picture and the third picture respectively, and rendering the first picture, the second picture and the third picture onto the corresponding first canvas, the second canvas and the third canvas respectively.

3. The method according to claim 2, characterized in that After rendering the first picture, the second picture and the third picture onto the corresponding first canvas, the second canvas and the third canvas respectively, the method further includes: setting the width and height of the first picture to the width and height of the second picture.

4. The method according to claim 2, characterized in that: Traversing the pixels of the first picture, identifying transparent pixels in the first picture, and setting corresponding positions on the second picture to be transparent based on the transparent pixels, including: Traversing pixels of the first picture in the first canvas, and identifying transparent pixels in the first canvas; Based on the transparent pixel point, a corresponding position on the second picture on the second canvas is also set to be transparent.

5. The method according to claim 4, characterized in that Copying the processed second image to the third image to obtain a final two-dimensional code image includes: drawing the second image on the second canvas onto the third canvas on which the third image is rendered to obtain the final two-dimensional code image.

6. The method according to any one of claims 1 to 5, characterized in that After obtaining the final two-dimensional code image, the method further includes: detecting a user's scanning operation on the final two-dimensional code image, and displaying corresponding text in a graphical programming platform based on the setting of the final two-dimensional code image.

7. A two-dimensional code image processing device for scientific education, characterized in that: include: an acquisition module, configured to acquire a first picture, a second picture, and a third picture, wherein the first picture is an original background picture containing background elements, the second picture is a QR code picture containing background elements, and the third picture is a QR code picture not containing background elements; a processing module configured to traverse the pixels of the first image, identify transparent pixels in the first image, and set corresponding positions on the second image to be transparent based on the transparent pixels, so as to obtain a processed second image; The generating module is configured to copy the processed second image to the third image to obtain a final two-dimensional code image.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.

9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor is enabled to execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.