# US 2018/0322356 A1 · Method and device for guiding users to restore rubik's cube

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0322356 A1
- Document ID: US20180322356A1
- Status: Published application
- Kind: A1
- Application number: 15/847,218
- Filed: 2017-12-19
- Published: 2018-11-08
- Earliest claimed: 2017-05-08
- Assignees: Shanghai Putao Technology Co., Ltd.
- Applicants: Shanghai Putao Technology Co., Ltd.
- Inventors: Letian Wang; Peng Du; Qingyun Li; Huan Chen; Mingying Gu
- Web page: https://patentgrep.com/patent/US20180322356A1

## CPC

- A63F 9/0842: {each group consisting of again a central element and a plurality of additional elements rotatable about three orthogonal axes at both ends, the additional elements being rotatable about at least two axes, e.g. Rubik's cube}
- G06T 7/13: Edge detection
- G06T 7/74: {involving reference images or patches}
- G06T 7/90: Determination of colour characteristics
- A63F 2009/2425: {Scanners, e.g. for scanning regular characters}
- G06T 2207/10024: Color image
- A63F: CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

The present disclosure relates to the technical field of computer visual detection processing, and provides a method for guiding users to restore Rubik's cubes. The method comprises step 1, acquiring arrangement information of colored blocks of the Rubik's cube; step 2, displaying restoration process of the Rubik's cube.

## Claims

### Claim 1

A method for guiding users to restore Rubik's cubes, comprising:
acquiring arrangement information of colored blocks of a Rubik's cube; and
displaying steps for restoring the Rubik's cube according to the arrangement information of the colored blocks of the Rubik's cube,
wherein, acquiring arrangement information of colored blocks of a Rubik's cube further comprises:
setting a scanning region of interest (ROI) in a software interface;
acquiring and adjusting the position of the Rubik's cube such that the Rubik's cube is located at the right position;
detecting the position of the Rubik's cube in an image; and
extracting colors of the Rubik's cube.

### Claim 2 (depends on 1)

The method for guiding users to restore Rubik's cubes according to claim 1, wherein displaying steps for restoring the Rubik's cube according to the arrangement information of the colored blocks of the Rubik's cube further comprises:
acquiring a restoring solution of the Rubik's cube; and
displaying the restoring steps of the Rubik's cube.

### Claim 3 (depends on 1)

The method for guiding users to restore Rubik's cubes according to claim 1, wherein detecting the position of the Rubik's cube in an image comprises:
graying the ROI;
extracting colored block outlines using an edge detection algorithm;
matching shapes; and
counting circle centers.

### Claim 4 (depends on 1)

The method for guiding users to restore Rubik's cubes according to claim 1, wherein extracting colors of the Rubik's cube comprises:
acquiring data from an acquisition device,
extracting color information of the Rubik's cube;
performing recognition six times in a certain fixed sequence;
determining if a total of 54 colored blocks exist, 9 colored blocks in each color;
if not, prompting users to perform recognition again with proper lighting;
if yes, acquiring the color arrangement information of 54 colored blocks.

### Claim 5 (depends on 2)

The method for guiding users to restore Rubik's cubes according to claim 2, wherein acquiring a restoring solution of the Rubik's cube comprises:
inputting the color arrangement information of the 54 colored blocks into a Two Phase algorithm;
determining if the Two Phase algorithm outputs solutions, and if the number of the solutions is smaller than 8;
if not, prompting users to scramble the Rubik's cube and performing recognition again;
if yes, operating each of the restored virtual Rubik's cubes by the reverse sequence of the corresponding one of the solutions, wherein the operation result may be the current state of the Rubik's cube of the user or includes a plurality of Rubik's cube states of the Rubik's cube currently in the hands of the user;
if the operation result includes a plurality of Rubik's cube states of the Rubik's cube currently in the hands of the user, prompting the user to select a virtual Rubik's cube which is in a state identical with the current state of the Rubik's cube in hands;
if the operation result is the current state of the Rubik's cube of the user, making the selected virtual Rubik's cube show the state of the Rubik's cube in hands of the user.

### Claim 6 (depends on 3)

The method for guiding users to restore Rubik's cubes according to claim 3, wherein graying the ROI comprises:
defining the image acquired by the acquisition device as the pixel value of a current coordinate position represented by R, G and B;
graying the ROI in a color image, wherein graying refers to converting the ROI in the color image into a gray image by using one of the following equations;
Gray(x,y)=0.2989×Rxy+0.5870×Gxy+0.1140×Bxy:
wherein, Gray (x,y) represents the gray image.

### Claim 7 (depends on 3)

The method for guiding users to restore Rubik's cubes according to claim 3, wherein extracting colored block outlines using an edge detection algorithm comprises:
quantitatively expressing the change degree of the gray value by using the gradient change between adjacent pixels, wherein the gradient is a two-dimensional equivalent expression of a first-order two-dimensional derivative, and the calculation process comprises:
calculating the difference between adjacent pixels by using the following equations:
Gx=f[i,j+1]−f[i,j]
Gy=f[i,j]−f[i+1,j]
wherein, Gx represents the difference of adjacent pixels in the direction x; Gy represents the difference of the adjacent pixels in direction y; f [i, j+1] represents the pixel value in array j+1 of row i in the image; f [i, j] represents the pixel value in array j of row i in the image; f [i+1, j] represents the pixel value of the array j in the row i+1 in the image;
calculating the gradient between adjacent pixels by using the following equation:
G

(
x
,
y
)
=
[
G
x
G
y
]
=
[
∂
f
∂
x
∂
f
∂
y
]
;
wherein, G(x,y) represents the gradient value at point (x,y) in the image;
∂
f
∂
x
represents the deviation of the pixel value in the direction x;
∂
f
∂
y
represents the deviation of the pixel value in the direction y;
calculating gradient amplitudes of edge points, wherein the set of the gradient amplitudes of all edge points is the edge outline extracted;
for the Rubik's cube to be detected, after conversion into the gray image,
defining outlines of red, yellow, blue, cyan, green and purple blocks as the edges of the current image because such six colored blocks are relatively greatly different from the ground color of a white Rubik's cube, and extracting the colored block outlines using an edge detection method.

### Claim 8 (depends on 7)

The method for guiding users to restore Rubik's cubes according to claim 7, wherein edge detection algorithm used in the edge detection method is selected from Sobel operator, Roberts operator, Prewitt operator, and Canny operator.

### Claim 9 (depends on 3)

The method for guiding users to restore Rubik's cubes according to claim 3, wherein matching shapes comprises:
for the extracted colored block outlines, screening binary outlines by using a shape matching method as described in the text concerning shapes, and calculating distances between outlines of shapes and an oval shape of the colored blocks of the Rubik's cube, wherein the distance value is calculated by using the following formula:
C
s
=
1
2

∑
k
=
1
K

[
g

(
k
)
-
h

(
k
)
]
2
g

(
k
)
+
h

(
k
)
;
Outline


shape


of


colored
block
=
{
Oval

C
s
<
M
Non

-

oval
C
s
≥
M
;
wherein, Cs represents the distance value between the outline of a standard oval shape and the shape of a colored block of the Rubik's cube; g(k) and h(k) respectively represent an outline point set of the standard oval shape and a shape to be detected; M represents a threshold distance value; k represents the kth element point in the outline point set; K represents the number of the elements in the outline point set; when Cs is smaller than M, it is determined that the outline shape of the current colored block is oval; and when Cs is greater than or equal to M, it is determined that the outline shape of the current colored block is not oval.

### Claim 10 (depends on 3)

The method for guiding users to restore Rubik's cubes according to claim 3, wherein counting circle centers comprises:
determining if the Rubik's cube is correctly placed by calculating the number of the oval outlines;
in the ROI, if 18 oval outlines are detected, determining that the Rubik's cube is correctly placed in a game scanning area; or, promoting the user to adjust the position of the Rubik's cube for re-testing.

### Claim 11 (depends on 4)

The method for guiding users to restore Rubik's cubes according to claim 4, wherein acquiring data from an acquisition device further comprises:
aligning acquisition devices such as cameras and scanning or photographing the six surfaces of the Rubik's cube to acquire all information of the Rubik's cube.

### Claim 12 (depends on 4)

The method for guiding users to restore Rubik's cubes according to claim 4, wherein acquiring data from an acquisition device further comprises:
scanning or photographing two surfaces of the Rubik's cube at the same time;
rotating the Rubik's cube and acquiring the image information of two of the remaining surface of the Rubik's cube; and
deducing the image information of the remaining surface by the image information of the four surfaces.

### Claim 13 (depends on 4)

The method for guiding users to restore Rubik's cubes according to claim 4, wherein acquiring data from an acquisition device further comprises:
scanning or photographing three surfaces of the Rubik's cube at the same time; and
rotating the Rubik's cube and acquiring the image information of the three remaining surface of the Rubik's cube.

### Claim 14

A device for guiding users to restore Rubik's cube:
an acquisition equipment that acquires the arrangement information of color blocks of a Rubik's cube;
a restore equipment that connects with the acquisition equipment and acquires a restoring solution and displays steps for restoring the Rubik's cube according to the arrangement information of the colored blocks of the Rubik's cube.

### Claim 15 (depends on 13)

The device of claim 13, wherein the restore equipment is: PAD, smart phone or computer.

### Claim 16 (depends on 13)

The device of claim 13, further comprising:
a stand and a bottom plate, the bottom plate is positioned on the bottom of the stand, the restore equipment is supported by the stand, the acquisition equipment is fixed on the top of the restore equipment; the bottom plate provides a game area and background for the cube, enabling the restoration simple, fast and accurate.
