A method for resolving two-dimensional cube stacking diagrams into three dimensions
By using automated data acquisition and BlockNet network recognition technology, two-dimensional cube stacking diagrams are analyzed into three dimensions, solving the difficulties in teaching solid geometry and improving students' understanding and teaching effectiveness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2026-04-03
AI Technical Summary
In traditional mathematics teaching, solid geometry knowledge is difficult to analyze from two-dimensional images into three-dimensional representations, students lack spatial imagination, and existing technology lacks effective teaching methods.
An automated data acquisition module was used to collect data on stacked cubes, and the BlockNet network was used to identify geometric targets. The results were then dynamically displayed using an AR device.
It realizes the analysis of 2D cube stacking diagrams into 3D geometric objects, enhances students' understanding of geometric objects and improves the teaching interest. By balancing the frequency of small cubes in the dataset, it improves the training effect of the BlockNet network.
Smart Images

Figure CN116188672B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition and relates to a method for resolving a two-dimensional cube stacking diagram into a three-dimensional one. Background Technology
[0002] Traditional primary and secondary school mathematics geometry teaching faces many difficulties. Geometry is a relatively important component of mathematical knowledge, and solid geometry has difficulties such as complexity, abstraction and systematicity.
[0003] For example, regarding such Figure 1 The middle school math problem shown asks students to draw various views from a geometric solid made up of small cubes. Many students lack spatial imagination, and it is difficult to implement general verbal explanations in solid geometry. Currently, there is no method to analyze a two-dimensional image of a cube stack into a three-dimensional image for teaching and demonstration. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method for analyzing a two-dimensional cube stacking diagram into a three-dimensional one. A teaching mode that combines this method with a display device can deepen students' understanding of geometric shapes and increase the interest of teaching.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for resolving a two-dimensional cube stacking diagram into a three-dimensional form includes the following steps:
[0007] S1: Use the automated data acquisition module to collect data on the cube stacking diagram, form a dataset, and automatically generate a label file;
[0008] S2: Train a geometric object recognition module based on the BlockNet network using the dataset;
[0009] S3: Take a picture of the cube stacking diagram to be analyzed, and use the trained geometric object recognition module to analyze the geometric structure of the cube stacking.
[0010] S4: Send the obtained geometric structure to the AR device for dynamic display.
[0011] Furthermore, the automated data acquisition module described in step S1 acquires the virtual data required for training in the 3D simulation software; in the 3D simulation software, the positions of the small cubes are encoded into 216 numbers from (0,0,0) to (5,5,5) using a three-dimensional coordinate system. The label file uses 216 numbers to indicate whether the corresponding 216 small cubes exist. The number 0 indicates that the small cube at the corresponding position does not exist, and the number 1 indicates that the small cube at the corresponding position exists.
[0012] Furthermore, the 3D simulation software randomly selects small cubes from coordinates (0,0,0) to (5,5,5). The requirement is that the number of small cubes at coordinates x=a, y=b is c. Therefore, the values from (a,b,0) to (a,b,c-1) are all 1, indicating the presence of a small cube at that position. Simultaneously, the number and position of small cubes across the entire geometry must be determined through unique reasoning from the image. This unique reasoning is ensured by ray detection in the 3D simulation software as follows:
[0013] If there are multiple small cubes at the position x = a, y = b, then the topmost small cube must be detectable by ray. If there are no small cubes at the position x = a, y = b, then if we assume there is a small cube, that cube can be detected by ray.
[0014] When the entire geometry is uniquely inferable, the geometry image is cropped and written to a tag file as data.
[0015] Furthermore, the data acquisition process of the automated data acquisition module is as follows:
[0016] Creating an array map[a][b] = c indicates that there are c small cubes at the coordinates x = a, y = b.
[0017] Set the 216 blocks from (0,0,0) to (5,5,5) to an inactive state, so that they are disabled in the 3D simulation;
[0018] Starting from i=0, record the distribution of the i-th layer of blocks map[i][0], map[i][1], map[i][2], map[i][3], map[i][4], map[i][5], and generate 6 random numbers between 0 and 6;
[0019] Perform the following operations on the cube distribution on map[i][1-5]: if map[i][0] = k, then the small cubes on (0,i,0) to (0,i,k-1) will be activated and the operation will take effect.
[0020] Determine if the distribution of layers 0-i is valid. If a small cube is activated at position (a,b) with x,y, then the ray emitted from the camera must hit the topmost active small cube. If no small cube is active at position (a,b) with x,y, then the small cube at position (a,b,0) is activated, and the ray emitted from the camera must hit this small cube.
[0021] If the distribution is determined to be valid, the value of the map array is retained, and the above steps are repeated until i = N. If the distribution is determined to be invalid, i is kept unchanged and regenerated.
[0022] This process is repeated N times, capturing images to complete one virtual data collection, and writing the map values to a file for use as image tag files.
[0023] Furthermore, the automatically collected data is added to multiple stacking diagrams of various small cubes at specific locations, so that the frequency difference of small cubes appearing at each location in the dataset is minimized. Specifically, this includes:
[0024] First, enable all small cubes in the current layer;
[0025] Then, the bottommost cube of the current layer is set to active status;
[0026] Finally, starting from the first column of the current layer, make the small cubes effective column by column, and make the small cubes in other columns ineffective. Collect multiple images and add them to the dataset.
[0027] Finally, enable all small cubes in the first layer and collect multiple images to add to the dataset;
[0028] Repeat the above operation layer by layer until the complete stack of small cubes is collected.
[0029] Furthermore, the BlockNet network takes a 512*512 3-channel image as input, first passes it through a convolution, then through 6 BasicBlock layers, and finally through a fully connected layer and a sigmoid function to output the image.
[0030] For the BasicBlock module of the BlockNet network, the backbone consists of a normalization layer, an activation function, and a convolution operation.
[0031] The branches of the BlockNet network fall into three categories:
[0032] If the number of channels and the size of the data after passing through the BasicBlock trunk remain unchanged, the input and trunk output are directly added together.
[0033] If the number of channels before and after the data from the BasicBlock backbone remains unchanged, but the size becomes half of the original, then the input data is first max-pooled to reduce the size to half of the original size, and then added to the output of the backbone.
[0034] If the number of channels after passing through the BasicBlock backbone doubles while the size remains the same, a clone operation is performed on the input data, copying it onto the channel and overlaying it, then adding it to the output of the backbone.
[0035] The beneficial effects of this invention are: this invention enables the analysis of images of geometric shapes composed of stacked cubes;
[0036] The teaching mode that combines this method with a display device can deepen students' understanding of geometric solids and increase the fun of teaching. In order to balance the problem of uneven frequency of small cubes in the collected data, the present invention will add multiple stacking diagrams of various small cubes in special positions to the automatically collected data, so that the frequency difference of small cubes in each position in the dataset is as small as possible.
[0037] This invention improves BlockNet by adopting a one-to-one correspondence between convolutions and branches, changing the traditional practice of using convolutions for shortcut branches. It avoids the use of convolutions in all three cases, resulting in a positive growth pattern in the performance of the trained model over time.
[0038] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0039] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0040] Figure 1 This is an example of a primary and secondary school mathematics geometry teaching system in the background technology;
[0041] Figure 2 A schematic diagram of a geometric solid made up of stacked cubes;
[0042] Figure 3 This refers to the coordinate system used in this method;
[0043] Figure 4 This is a schematic diagram of the BlockNet network structure;
[0044] Figure 5 This is a flowchart illustrating the overall process framework of the present invention. Detailed Implementation
[0045] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0046] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0047] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0048] This invention provides a method for parsing images of stacked cubes, including a geometric encoding method for the stacked cube image, an automated data acquisition method, and a geometric recognition method for the stacked cubes.
[0049] like Figure 2 The geometric solid shown can be formed by stacking multiple small cubes according to certain rules. One type of solid can be uniquely deduced from the image by considering the number and position of the small cubes. This method is mainly for analyzing images of this type of geometric solid.
[0050] This method specifies the use of a coordinate system, such as... Figure 3 As shown, the positions of the small cubes are encoded from (0,0,0) to (5,5,5), a total of 216. The tag file uses 216 numbers to indicate whether the corresponding 216 small cubes exist. The number 0 indicates that the small cube at the corresponding position does not exist, and the number 1 indicates that the small cube at the corresponding position exists.
[0051] Automated data acquisition module:
[0052] (1) Virtual data for training is collected in 3D simulation software. Small cubes from coordinates (0,0,0) to (5,5,5) are randomly generated. The requirement is that the number of small cubes at coordinates x=a, y=b is c. Therefore, the values from (a,b,0) to (a,b,c-1) are all 1, indicating the presence of a small cube at that position. Simultaneously, the number and position of the small cubes in the entire geometry must be determined through unique inference from the image. The unique inference of the geometry can be guaranteed by ray casting in the 3D simulation software as follows: if multiple small cubes exist at position x=a, y=b, the topmost small cube must be detectable by ray casting; if no small cube exists at position x=a, y=b, then if a small cube is assumed to exist, it must be detectable. When the entire geometry is uniquely inferable, the geometry image is cropped and written to a tag file as data.
[0053] Data acquisition process:
[0054] The `map[][]` array is used to record the number of cubes at the x, y coordinates. For example, `Map[a][b] = c` means that there are c small cubes at the coordinates x = a, y = b. Figure 2 The geometry shown has map[0][0]=0, map[1][0]=4, map[2][0]=4, map[3][0]=1, map[0][1]=3, map[1][1]=1, map[2][1]=2, map[3][1]=1, map[0][2]=1, map[1][2]=0, map[2][2]=1, map[3][2]=0.
[0055] The logical flow is as follows:
[0056] 1. Deactivate the 216 blocks from (0,0,0) to (5,5,5) to disable them in the 3D simulation.
[0057] 2. Repeat the following process N times to obtain M images of the geometric layers of each layer of small cubes stacked together.
[0058] 3. Repeat the following process M times to capture M images.
[0059] 3.1 Repeat the following process N times to generate a geometry diagram with N layers.
[0060] 3.1.1 Starting from i = 0, record the distribution of the i-th layer of blocks using map[i][0], map[i][1], and map[i][2].
[0061] map[i][3], map[i][4], map[i][5], generate 6 random numbers between 0 and 6.
[0062] 3.1.2 If map[i][0] = k, then the small cubes from (0,i,0) to (0,i,k-1) are activated and the operation is applied. This operation is repeated for all cubes distributed on map[i][1-5].
[0063] 3.1.3 Determine if the distribution of layers 0-i is valid. For example, if a small cube is activated at position x, y = (a, b), then the ray emitted from the camera must hit the topmost activated small cube.
[0064] If no small cube is active at position (a,b), then the small cube at position (a,b,0) is activated, ensuring that any rays emitted from the camera must touch this small cube.
[0065] 3.1.4 If the distribution is determined to be valid, the value of the map array is retained, and i = i + 1 is used to proceed to the next level until i = N. If the distribution is determined to be invalid, i remains unchanged and is regenerated.
[0066] The process is repeated 3.2N times to capture images, completing one virtual data collection cycle. The map values are then written to a file to be used as the image's tag file.
[0067] To balance the uneven frequency of small cubes appearing in the collected data, multiple stacking images of various small cubes at specific locations will be added to the automatically collected data, so that the frequency difference of small cubes appearing at each location in the dataset is as small as possible.
[0068] For example:
[0069] First, enable all small cubes in the current layer;
[0070] Then, the bottommost cube of the current layer is set to active status;
[0071] Finally, starting from the first column of the current layer, make the small cubes effective column by column, and make the small cubes in other columns ineffective. Collect multiple images and add them to the dataset.
[0072] Finally, enable all small cubes in the first layer and collect multiple images to add to the dataset;
[0073] Repeat the above operation layer by layer until the complete stack of small cubes is collected.
[0074] A geometric target recognition module composed of stacked cubes:
[0075] The server uses the BlockNet network to train the automated data acquisition module to parse the geometric structure of stacked cubes. The network structure is as follows: Figure 4 As shown.
[0076] BlockNet takes a 512*512 3-channel image as input, first passes it through a convolution, then through 6 BasicBlock layers, and finally through a fully connected layer and a sigmoid function to output the image.
[0077] To ensure the dataset consistently improves accuracy during training, a special design was implemented for the BasicBlock module. The core of the BasicBlock module consists of a normalization layer (bnating layer), an activation function (ReLU), and a convolution operation (conv).
[0078] There are three types of shortcuts:
[0079] (1) If the number of channels and the size of the data after passing through the BasicBlock backbone remain unchanged, then the input and the backbone output are directly added together.
[0080] (2) If the number of channels before and after the data through the BasicBlock trunk remains unchanged, but the size becomes half of the original, then the input data is first maxpooled to reduce the size to half of the original size, and then added to the output of the trunk.
[0081] (3) If the number of channels before and after the data of the BasicBlock trunk becomes twice the original, while the size remains unchanged, then a clone operation is performed on the input data, a copy is made on the channel and superimposed, and then added to the output of the trunk.
[0082] BlockNet adopts a one-to-one approach for convolutions, changing the traditional practice of using convolutions for shortcut branches. It avoids using convolutions in all three cases, resulting in a positive growth pattern in the performance of the trained model over time.
[0083] The trained BlockNet network object recognition module is used to identify geometric stacking diagrams on geometry exam papers or textbooks, and the analysis results are dynamically displayed in the dynamic display module of an AR device. The process framework is as follows: Figure 5 As shown.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for resolving a two-dimensional cube stacking diagram into a three-dimensional form, characterized in that: Includes the following steps: S1: The automated data acquisition module collects data on the cube stacking diagram, forms a dataset, and automatically generates a label file; the data acquisition process of the automated data acquisition module is as follows: Create an array map[a][b]=c to represent that there are c small cubes at the coordinates x=a, y=b; Set the 216 blocks from (0,0,0) to (5,5,5) to an inactive state, so that they are disabled in the 3D simulation; Starting from i=0, record the distribution of the i-th layer of blocks map[i][0], map[i][1], map[i][2], map[i][3], map[i][4], map[i][5], and generate 6 random numbers between 0 and 6; Perform the following operation on the cube distribution on map[i][1-5]: if map[i][0]=k, then the small cubes on (0, i, 0) to (0, i, k-1) will be activated and the operation will take effect. Determine if the distribution of layers 0-i is valid. If a small cube is activated at position (a,b) with x,y, then the ray emitted from the camera must hit the topmost active small cube. If no small cube is active at position (a,b) with x,y, then the small cube at position (a,b,0) is activated, and the ray emitted from the camera must hit this small cube. If the distribution is determined to be valid, the value of the map array is retained, and the above steps are repeated until i=N. If the distribution is determined to be invalid, i is kept unchanged and regenerated. This process is repeated N times, capturing images to complete one virtual data collection, and writing the map values to a file for use as image tag files; S2: Train a geometric object recognition module based on the BlockNet network using the dataset; S3: Take a picture of the cube stacking image to be analyzed, and use the trained geometric object recognition module to analyze the geometric structure of the cube stacking; S4: Send the obtained geometric structure to the AR device for dynamic display.
2. The method for resolving a two-dimensional cube stacking diagram into a three-dimensional form according to claim 1, characterized in that: The automated data acquisition module described in step S1 collects the virtual data required for training in the 3D simulation software. In the 3D simulation software, the positions of the small cubes are encoded into 216 numbers from (0,0,0) to (5,5,5) using a three-dimensional coordinate system. The label file uses 216 numbers to indicate whether the corresponding 216 small cubes exist. The number 0 indicates that the small cube at the corresponding position does not exist, and the number 1 indicates that the small cube at the corresponding position exists.
3. The method for resolving a two-dimensional cube stacking diagram into a three-dimensional form according to claim 1, characterized in that: The 3D simulation software randomly selects small cubes from coordinates (0,0,0) to (5,5,5). The requirement is that the number of small cubes at coordinates x=a, y=b is c. Therefore, the values from (a,b,0) to (a,b,c-1) are all 1, indicating the presence of a small cube at that position. Simultaneously, the number and position of small cubes across the entire geometry must be determined through unique reasoning from the image. This uniqueness reasoning is ensured by ray casting in the 3D simulation software using the following detection: If there are multiple small cubes at the position x=a, y=b, then the topmost small cube must be detectable by ray. If there are no small cubes at the position x=a, y=b, then if we assume there is a small cube, that cube can be detected by ray. When the entire geometry is uniquely inferable, the geometry image is cropped and written to a tag file as data.
4. The method for resolving a two-dimensional cube stacking diagram into a three-dimensional form according to claim 1, characterized in that: The automatically collected data is added to multiple stacking images of various small cubes at specific locations to minimize the frequency difference of small cubes at each location in the dataset. Specifically, this includes: First, enable all small cubes in the current layer; Then, the bottommost cube of the current layer is set to active status; Finally, starting from the first column of the current layer, make the small cubes effective column by column, and make the small cubes in other columns ineffective. Collect multiple images and add them to the dataset. Finally, enable all small cubes in the first layer and collect multiple images to add to the dataset; Repeat the above operation layer by layer until the complete stack of small cubes is collected.
5. The method for resolving a two-dimensional cube stacking diagram into a three-dimensional form according to claim 1, characterized in that: BlockNet network uses 512 The 512 three-channel image is used as input, first passed through a convolution, then through 6 BasicBlock layers, and finally through a fully connected layer and a sigmoid function for output; For the BasicBlock module of the BlockNet network, the backbone consists of a normalization layer, an activation function, and a convolution operation. The branches of the BlockNet network fall into three categories: If the number of channels and the size of the data after passing through the BasicBlock trunk remain unchanged, the input and trunk output are directly added together. If the number of channels before and after the data from the BasicBlock backbone remains unchanged, but the size becomes half of the original, then the input data is first max-pooled to reduce the size to half of the original size, and then added to the output of the backbone. If the number of channels after passing through the BasicBlock backbone doubles while the size remains the same, a clone operation is performed on the input data, copying it onto the channel and overlaying it, then adding it to the output of the backbone.