CN115496768A - Color block fragment generation method in pixel jigsaw game and related device - Google Patents

Color block fragment generation method in pixel jigsaw game and related device Download PDF

Info

Publication number
CN115496768A
CN115496768A CN202210988024.7A CN202210988024A CN115496768A CN 115496768 A CN115496768 A CN 115496768A CN 202210988024 A CN202210988024 A CN 202210988024A CN 115496768 A CN115496768 A CN 115496768A
Authority
CN
China
Prior art keywords
color
pixel
fragments
fragment
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210988024.7A
Other languages
Chinese (zh)
Inventor
余朝亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Divoom Technology Co ltd
Original Assignee
Shenzhen Divoom Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Divoom Technology Co ltd filed Critical Shenzhen Divoom Technology Co ltd
Priority to CN202210988024.7A priority Critical patent/CN115496768A/en
Publication of CN115496768A publication Critical patent/CN115496768A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F9/00Games not otherwise provided for
    • A63F9/06Patience; Other games for self-amusement
    • A63F9/10Two-dimensional jig-saw puzzles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The application discloses a color block fragment generation method in a pixel jigsaw game and a related device, comprising the following steps: determining an acquisition result by acquiring a reference picture and acquiring all pixel point information in the reference picture; determining the color value of the color lump fragment by combining the color lump division rule table and the acquisition result, and determining an initial pixel point in the reference picture after the color value of the color lump fragment is acquired; obtaining color lump fragments by traversing the initial pixel points under the condition of meeting the preset condition, and finally generating a color lump fragment set; the method comprises the steps of determining color values corresponding to color lump fragments according to an obtaining result obtained by scanning pixel point information and a color lump division rule table, matching initial points in a comparison picture through the color values, traversing around the initial pixel points to determine the size and the direction of the color lump fragments, finally generating a color lump fragment set, considering the color factor of a pixel picture, and further improving the reasonability of color lump fragment generation in a pixel jigsaw game.

Description

Color block fragment generation method in pixel jigsaw game and related device
Technical Field
The present application relates to the field of pixel image processing technologies, and in particular, to a method and a related apparatus for generating color block fragments in a pixel puzzle game.
Background
With the rise of the internet industry, the intelligence-developing game generated by means of the internet and related electronic equipment becomes an indispensable existence of people for children education and capability cultivation. The pixel jigsaw game is taken as the next popular early education game, the visual effect and the simple operation mode of the pixel jigsaw game become the core content of the early education of children. In the pixel jigsaw game, for the generation of fragments, or simply dividing the picture image equally, the object character image in the picture is simply divided, so that the logic of color is difficult to embody, and the aim of cultivating the visual sense is not achieved.
Therefore, how to reasonably generate the color block fragments in the pixel jigsaw becomes a technical problem to be solved urgently.
Disclosure of Invention
In order to reasonably generate color lump fragments according to the colors of pixel pictures, the application provides a color lump fragment generation method and a related device in a pixel jigsaw game.
In a first aspect, the present application provides a method for generating patch fragments in a pixel mosaic game, which adopts the following technical solution:
a color lump fragment generation method in a pixel jigsaw puzzle comprises the steps of obtaining a reference picture, and obtaining all pixel point information in the reference picture to generate an obtaining result; acquiring a color block division rule table, and confirming color block fragment color values according to the color block division rule table and the acquisition result; confirming initial pixel points in the comparison picture according to the color block fragment color values; traversing the periphery of the initial pixel point, stopping traversing and generating color lump fragments according to the obtained pixel point when a preset condition is met; and after traversing all the initial pixel points, collecting all the color block fragments in the comparison picture to generate a color block fragment set.
Optionally, the obtaining the color block division rule table further includes, before determining the color block fragment color value according to the color block division rule table and the obtaining result:
acquiring current jigsaw difficulty, and acquiring the corresponding color block division rule table according to the current jigsaw difficulty;
and confirming a color interval of pixel division according to the color block division rule table, wherein the color interval is represented by a red, green and blue three-primary color numerical value interval.
Optionally, the obtaining the color block division rule table, and determining the color block fragment color value according to the color block division rule table and the obtaining result includes:
acquiring a color block division rule table;
classifying corresponding pixel points in the color areas in the color block division rule table according to the obtained result;
calculating color values of all pixel points in the color interval to obtain an interval color average value;
and taking the interval color average value as the color block fragment color value.
Optionally, the traversing the periphery of the initial pixel point, and when a preset condition is met, stopping the traversing and generating color block fragments according to the obtained pixel point includes:
traversing the periphery of the initial pixel point, wherein the traversal rule is that the distance between the initial pixel point and the initial pixel point is from near to far, and the traversed pixel point is used as a peripheral pixel;
when the color value of the traversed peripheral pixel does not belong to the current color interval and/or the periphery has no pixel points, taking the current peripheral pixel as a boundary pixel and being incapable of traversing the pixel points around the boundary pixel;
and stopping traversing when more peripheral pixels cannot be acquired, and drawing all the current peripheral pixels into the corresponding color block fragments.
Optionally, after all the initial pixel points are traversed, after all the color block fragments in the reference picture are collected to generate a color block fragment set, the method further includes:
traversing all pixel points in the reference picture, and taking the pixel points which are not scratched into the color lump fragments as fixed pixel points;
and after an instruction for starting the jigsaw game is detected, keeping the position of the fixed pixel point still, and changing the pixel point belonging to the color block fragment into a preset color value.
Optionally, after traversing all the initial pixel points, acquiring all the color block fragments in the reference picture to generate a color block fragment set includes:
after traversing all the initial pixel points, marking the same mark on the pixel point belonging to the same color lump fragment and the corresponding color lump fragment according to the traversing time;
acquiring a preset splicing rule, and splicing target pixel points into color block fragments according to the preset splicing rule;
and collecting all the color block fragments in the comparison picture to generate a color block fragment set.
Optionally, the obtaining of the preset splicing rule includes: in the splicing process, pixel points which belong to the same color block but do not belong to the same identifier are not spliced;
splicing the target pixel points into color block fragments according to the initial pixel points and the preset splicing rule comprises the following steps:
and splicing the pixel points belonging to the same identifier to generate color lump fragments, wherein the color composition of the color lump fragments is formed by the color values of the pixel points belonging to the same identifier.
In a second aspect, the present application provides a patch fragment generating device in a pixel mosaic game, comprising:
the pixel scanning module is used for acquiring a reference picture and acquiring all pixel point information in the reference picture to generate an acquisition result;
the color block dividing module is used for acquiring a color block dividing rule table and confirming color block fragment color values according to the color block dividing rule table and the acquiring result;
the initial point confirming module is used for confirming an initial pixel point in the comparison picture according to the color block fragment color value;
the pixel traversal module is used for traversing the periphery of the initial pixel point, stopping traversal when a preset condition is met, and generating color lump fragments according to the acquired pixel point;
and the set generation module is used for collecting all the color block fragments in the comparison picture to generate a color block fragment set after traversing all the initial pixel points.
In a third aspect, the present application provides a patch fragment generating apparatus in a pixel mosaic game, the apparatus comprising: the device comprises a memory, a processor and a color block fragment generating program in a pixel jigsaw game, wherein the color block fragment generating program is stored on the memory and can run on the processor, and the color block fragment generating program in the pixel jigsaw game is configured to realize the color block fragment generating method in the pixel jigsaw game.
In a fourth aspect, the present application provides a storage medium, wherein the storage medium stores thereon a color-patch fragment generation program in a pixel mosaic game, and the color-patch fragment generation program in the pixel mosaic game realizes the color-patch fragment generation method in the pixel mosaic game as described above when executed by a processor.
In summary, the present application includes the following advantageous technical effects:
the method comprises the steps of obtaining a reference picture and obtaining all pixel point information in the reference picture to determine an obtaining result; determining color values of the color lump fragments by combining the color lump division rule table and the obtaining result, and determining initial pixel points in the reference picture after the color values of the color lump fragments are obtained; obtaining color lump fragments through traversal of initial pixel points under the condition that a color lump fragment set is finally generated; the method comprises the steps of determining color values corresponding to color lump fragments according to an obtaining result obtained by scanning pixel point information and a color lump division rule table, matching initial points in a comparison picture through the color values, traversing around the initial pixel points to determine the size and the direction of the color lump fragments, finally generating a color lump fragment set, considering the color factor of a pixel picture, and further improving the reasonability of color lump fragment generation in a pixel jigsaw game.
Drawings
Fig. 1 is a schematic structural diagram of a color block fragment generating device in a pixel mosaic game in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flowchart illustrating a method for generating color patch fragments in a pixel mosaic game according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for generating patch fragments in a pixel jigsaw puzzle according to the present invention;
FIG. 4 is a schematic flow chart of a third embodiment of a method for generating patch fragments in a pixel jigsaw puzzle according to the present invention;
FIG. 5 is a block diagram of the first embodiment of the device for generating patch fragments in a pixel mosaic game according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a color block fragment generating device in a pixel mosaic game in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the patch fragment generating apparatus in a pixel mosaic game may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in figure 1 does not constitute a limitation of the patch fragment generation apparatus in a pixel mosaic game, and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a patch fragment generation program in a pixel mosaic game may be included in the memory 1005, which is one of storage media.
In the patch fragment generation apparatus in the pixel mosaic game shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the color block fragment generation device in the pixel jigsaw game of the present invention may be disposed in the color block fragment generation device in the pixel jigsaw game, and the color block fragment generation device in the pixel jigsaw game calls the color block fragment generation program in the pixel jigsaw game stored in the memory 1005 through the processor 1001 and executes the color block fragment generation method in the pixel jigsaw game provided by the embodiment of the present invention.
The embodiment of the invention provides a method for generating color block fragments in a pixel jigsaw game, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for generating the color block fragments in the pixel jigsaw game.
In this embodiment, the method for generating patch pieces in a pixel puzzle game includes the following steps:
step S10: and acquiring the reference picture, and acquiring all pixel point information in the reference picture to generate an acquisition result.
It should be noted that the execution main body of the embodiment may be a computing service device with data processing, network communication and program running functions, such as a smart phone, a tablet computer, a personal computer, and the like, or may be other devices capable of implementing the above functions, which is not limited in the embodiment. The present embodiment and the following embodiments will be specifically described by taking a patch fragment generating apparatus in a pixel mosaic game as an example.
It can be understood that the comparison picture obtained in this embodiment is from a comparison picture library, in the pixel game, an administrator selects a network picture library to add pictures, and the obtained comparison picture is selected randomly or according to a first-in first-out rule, which is not limited herein.
It should be noted that, the pixel size of the reference picture is not limited in this embodiment, and the specification and the requirement of the picture are made by a system administrator according to actual requirements.
It should be noted that all pixel point information in the scanned graph is used to generate an obtaining result, where the pixel point information mainly includes a color value corresponding to a pixel and a position in the comparison graph.
In a specific implementation, acquiring a reference picture, acquiring information of all pixel points in the reference picture to generate an acquisition result refers to acquiring the reference picture from a preset position, where the preset position is a preset data acquisition interface or a designated picture set, traversing the pixel information on the whole picture after the reference picture is acquired, acquiring position information and corresponding color values of all the pixel points on the reference picture, and taking the traversal result as the acquisition result.
Step S20: and acquiring a color lump division rule table, and confirming the color lump fragment color value according to the color lump division rule table and the acquisition result.
It should be noted that the color block division rule table divides a color block into regions, defines a color value as a value formed by three RGB primary colors, and divides the RBG value into regions and can realize division of the color block.
It can be understood that the color value of a color patch refers to a representative value of the overall color of the color patch, and in a specific implementation, the color patch is formed by pixels belonging to a color interval of the color patch, so that the color of the color patch may be a gradient color or a pure color, which is not limited herein. The color value of a patch referred to herein is a color close to the color in the patch, and is used only for general reference.
In a specific implementation, obtaining a color lump division rule table, determining a color lump fragment color value according to the color lump division rule table and the obtaining result means that a specific numerical value of color division in a reference picture is grasped by obtaining the color lump division rule table, and all pixel points are divided according to the color lump division rule table in combination with the obtaining result of the reference picture. After the pixel division is completed, averaging is carried out in any color block fragment according to the RGB color values of all color blocks, and the color block fragment color value is obtained.
Step S30: and confirming initial pixel points in the comparison picture according to the color values of the color lump fragments.
It should be noted that the initial pixel point is a pixel point in the comparison map that has the same color value as any color patch. And if the color value of the color block fragment is obtained, pixels with the same numerical value as the color value of the color block fragment do not exist in the comparison picture, and the pixel point with the minimum absolute value of the subtraction result of the numerical value of the color value is taken as the corresponding initial pixel point of the fragment color block.
In specific implementation, the step of determining the initial pixel point in the reference picture according to the color value of the color block fragment means that a corresponding pixel point is found in the reference picture according to the color value corresponding to each color block fragment, and the pixel point is used as the initial pixel point.
It should be noted that, if the initial pixel points belonging to the same color block are separated by a certain distance, any one of the two pixel points may be used as the initial pixel point, and the specific separation distance is determined by the actual requirement, and may be set by a system administrator, for example: when the distance between the two initial pixel points is not more than 1 pixel point, the two initial pixel points are judged to be only one of the initial pixel points.
Step S40: and traversing the periphery of the initial pixel point, and stopping traversing and generating color lump fragments according to the obtained pixel point when the preset condition is met.
In specific implementation, for an initial pixel point, all areas around the initial pixel point are traversed to obtain information of surrounding pixel points, and whether the surrounding pixel points are in color block fragments corresponding to the initial pixel point is judged. If so, the traversed pixels are taken as peripheral small pixels of the initial pixel points, otherwise, the pixel points are taken as boundary pixels, and the traversal can be finished when the traversed boundary pixel points surround the initial pixels.
It should be noted that the preset condition refers to stopping traversal in the current direction when the traversed pixel reaches the boundary or the traversed pixel does not belong to the interval corresponding to the current patch fragment.
Step S50: and after traversing all the initial pixel points, collecting all the color block fragments in the reference picture to generate a color block fragment set.
It should be noted that the color block fragment set refers to a pixel fragment pool that can be selected by a user in a subsequent pixel jigsaw game, and the user selects fragments from the color block fragment set and fills the fragments in a preset curtain.
It is understood that the preset curtain refers to a background plate automatically created by the system during the playing of the pixel jigsaw game, and a player can fill the color block fragments in the background plate into the preset curtain.
In a specific implementation, after all the initial pixel points are traversed, collecting all the color block fragments in the reference picture to generate a color block fragment set means that after all the initial pixel points are finished, the color block fragments generated in the reference picture are extracted, the pixel points into which the color block fragments are drawn are replaced with corresponding color values at original positions, and meanwhile, the obtained color block fragments form the color block fragment set.
The embodiment determines the acquisition result by acquiring a reference picture and acquiring all pixel point information in the reference picture; determining the color value of the color lump fragment by combining the color lump division rule table and the acquisition result, and determining an initial pixel point in the reference picture after the color value of the color lump fragment is acquired; obtaining color lump fragments through traversal of initial pixel points under the condition that a color lump fragment set is finally generated; the method comprises the steps of determining color values corresponding to color lump fragments according to an obtaining result obtained by scanning pixel point information and a color lump division rule table, matching initial points in a comparison picture through the color values, traversing around the initial pixel points to determine the size and the direction of the color lump fragments, finally generating a color lump fragment set, considering the color factor of a pixel picture, and further improving the reasonability of color lump fragment generation in a pixel jigsaw game.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for generating patch fragments in a pixel mosaic game according to a second embodiment of the present invention.
Based on the first embodiment, before the step S20 of the method for generating patch pieces in a pixel mosaic game, the present embodiment further includes:
s200: and acquiring the current jigsaw difficulty, and acquiring a corresponding color block division rule table according to the current jigsaw difficulty.
It should be noted that, as an educational game, in order to satisfy children of different ages and provide more transformations, the pixel jigsaw puzzle in this embodiment may be set with different difficulty levels. The higher the difficulty, the more the number of patch pieces, and thus the more the inter-patch division areas in the corresponding patch division rule table. For example: in order to meet the simple teaching requirement of children of low ages, the lowest difficulty level can be set, namely, the color blocks in the color block division rule table are divided into basic three primary color combinations, so that the color block fragments are only 3, and the difficulty level of the game is greatly reduced.
S201: and confirming the color interval of pixel division according to the color block division rule table, wherein the color interval is represented by a red, green and blue three-primary-color numerical value interval.
Further, in order to more reasonably divide patch fragments according to pixel colors in a patch fragment generation process, the obtaining a patch division rule table, and the determining a patch fragment color value according to the patch division rule table and the obtaining result includes: acquiring a color block division rule table; classifying corresponding pixel points in color areas in the color block division rule table according to the obtained result; calculating color values of all pixel points in the color interval to obtain an interval color average value; and taking the interval color average value as the color block fragment color value.
Further, in order to make the generated color lump fragments more accurate, the traversing the periphery of the initial pixel point, and when a preset condition is met, stopping the traversing and generating the color lump fragments according to the acquired pixel point includes: traversing the periphery of the initial pixel point, wherein the traversal rule is that the distance between the initial pixel point and the initial pixel point is from near to far, and the traversed pixel point is used as a peripheral pixel; when the color value of the traversed peripheral pixel does not belong to the current color interval and/or the periphery has no pixel points, taking the current peripheral pixel as a boundary pixel and being incapable of traversing the pixel points around the boundary pixel; and stopping traversing when more peripheral pixels cannot be acquired, and drawing all the current peripheral pixels into the corresponding color block fragments.
In this embodiment, by obtaining the current puzzle difficulty, the corresponding color block division rule table is obtained according to the current puzzle difficulty; determining the color interval of pixel division according to the color block division rule table, wherein the color interval is represented by a red-green-blue three-primary-color numerical value interval, the precision degree of color block division can be conditioned according to the preset difficulty, the technical effect of flexibly adjusting the complexity degree of fragments according to the game difficulty is realized, and meanwhile, the pixel division interval corresponding to the color block division rule table can also be realized
Referring to FIG. 4, FIG. 4 is a schematic flowchart illustrating a method for generating patch fragments in a pixel mosaic game according to a third embodiment of the present invention.
Based on the first embodiment, step S50 of the method for generating patch fragments in a pixel mosaic game in this embodiment further includes:
step S500: and after traversing all the initial pixel points, marking the same mark on the pixel point belonging to the same color lump fragment and the corresponding color lump fragment according to the traversing time.
It should be noted that, according to each traversal, an identifier is marked on the traversed peripheral pixels, the content of the identifier is the time or moment of the traversal, and the specific traversal moment of the pixel point can be obtained by reading the identifier.
Step S501: and acquiring a preset splicing rule, and splicing the target pixel points into color block fragments according to the preset splicing rule.
Further, in order to avoid that pixels belonging to the same color value range of the color block but not belonging to the same initial pixel traversal range synthesize wrong color block fragments in the color block generation process, the obtaining of the preset stitching rule includes: in the splicing process, pixel points which belong to the same color block but do not belong to the same identifier are not spliced; splicing the target pixel points into color lump fragments according to the initial pixel points and the preset splicing rule comprises the following steps: and splicing the pixel points belonging to the same identifier to generate color lump fragments, wherein the color composition of the color lump fragments is formed by the color values of the pixel points belonging to the same identifier.
Step S502: all the color block fragments in the control picture are collected to generate a set of color block fragments.
In this embodiment, after all the initial pixel points are traversed, the same identifier is marked on the pixel point belonging to the same color block fragment and the corresponding color block fragment according to the traversal time; acquiring a preset splicing rule, and splicing target pixel points into color block fragments according to the preset splicing rule; collecting all the color block fragments in the comparison picture to generate a color block fragment set; a plurality of color lump fragments exist in the same pixel picture, the color lump fragments are marked according to the traversal time, the condition that pixels belonging to two initial pixel points are spliced into one color lump fragment in the process of splicing the color lump fragments is avoided, and the accuracy in the color lump fragment generation process is further improved.
In addition, the embodiment of the present invention further provides a storage medium, where a program for generating color block fragments in a pixel mosaic game is stored, and when the program for generating color block fragments in a pixel mosaic game is executed by a processor, the steps of the method for generating color block fragments in a pixel mosaic game as described above are implemented.
Referring to FIG. 5, FIG. 5 is a block diagram of a first embodiment of the device for generating patch fragments in a pixel mosaic game according to the present invention.
As shown in fig. 5, the apparatus for generating color block fragments in a pixel mosaic game according to an embodiment of the present invention includes:
the pixel scanning module 10 is configured to acquire a reference picture, and acquire information of all pixel points in the reference picture to generate an acquisition result;
a color block dividing module 20, configured to obtain a color block dividing rule table, and determine a color block fragment color value according to the color block dividing rule table and the obtaining result;
an initial point confirmation module 30, configured to confirm an initial pixel point in the comparison picture according to the color block fragment color value;
the pixel traversing module 40 is used for traversing the periphery of the initial pixel point, stopping traversing and generating color block fragments according to the obtained pixel point when a preset condition is met;
and a set generating module 50, configured to collect all the color block fragments in the reference picture after all the initial pixel points are traversed, so as to generate a color block fragment set.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited in this respect.
The embodiment determines the obtaining result by obtaining a reference picture and obtaining all pixel point information in the reference picture; determining the color value of the color lump fragment by combining the color lump division rule table and the acquisition result, and determining an initial pixel point in the reference picture after the color value of the color lump fragment is acquired; obtaining color lump fragments by traversing the initial pixel points under the condition of meeting the preset condition, and finally generating a color lump fragment set; the method comprises the steps of determining color values corresponding to color block fragments according to an acquisition result obtained by scanning pixel point information and a color block division rule table, matching an initial point in a comparison picture through the color values, traversing around the initial pixel point to determine the size and the direction of the color block fragments, and finally generating a color block fragment set.
In an embodiment, the color-block dividing module 20 is further configured to obtain a current jigsaw difficulty level, and obtain the corresponding color-block dividing rule table according to the current jigsaw difficulty level; and confirming the color interval of pixel division according to the color block division rule table, wherein the color interval is represented by a red, green and blue three-primary-color numerical value interval.
In an embodiment, the color-block dividing module 20 is further configured to obtain a color-block dividing rule table; classifying corresponding pixel points in the color areas in the color block division rule table according to the obtained result; calculating color values of all pixel points in the color interval to obtain an interval color average value; and taking the interval color average value as the color block fragment color value.
In an embodiment, the pixel traversal module 40 is further configured to traverse the periphery of the initial pixel point, where a traversal rule is that the distance from the initial pixel point is from near to far, and the traversed pixel point is used as a peripheral pixel; when the color value of the traversed peripheral pixel does not belong to the current color interval and/or the peripheral pixel does not exist, taking the current peripheral pixel as a boundary pixel and failing to traverse the peripheral pixel of the boundary pixel; and when no more peripheral pixels can be obtained, stopping traversing, and drawing all the current peripheral pixels into the corresponding color block fragments.
In an embodiment, the set generating module 50 is further configured to traverse all the pixel points in the comparison picture, and take the pixel points that are not drawn into the color block fragments as fixed pixel points; and after detecting an instruction for starting the jigsaw game, keeping the position of the fixed pixel points still, and changing the pixel points belonging to the color lump fragments into preset color values.
In an embodiment, the set generating module 50 is further configured to, after all the initial pixel points are traversed, mark the same identifier on the pixel point belonging to the same color block fragment and the corresponding color block fragment according to the traversal time; acquiring a preset splicing rule, and splicing target pixel points into color block fragments according to the preset splicing rule; and collecting all the color block fragments in the comparison picture to generate a color block fragment set.
In an embodiment, the set generating module 50 is further configured to splice, according to the initial pixel points and the preset splicing rule, target pixel points into color block fragments, and includes: and splicing the pixel points belonging to the same identifier to generate color block fragments, wherein the color composition of the color block fragments is formed by the color values of the pixel points belonging to the same identifier.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment can be referred to the method for generating color block fragments in the pixel jigsaw game provided in any embodiment of the present invention, and are not described herein again.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. a Read Only Memory (ROM)/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method of generating patch patches in a pixel mosaic game, comprising:
acquiring a reference picture, and acquiring all pixel point information in the reference picture to generate an acquisition result;
acquiring a color block division rule table, and confirming color block fragment color values according to the color block division rule table and the acquisition result;
confirming an initial pixel point in the comparison picture according to the color block fragment color value;
traversing the periphery of the initial pixel point, stopping traversing and generating color lump fragments according to the obtained pixel point when a preset condition is met;
and after traversing all the initial pixel points, collecting all the color block fragments in the reference picture to generate a color block fragment set.
2. The method of generating patch fragments in a pixel mosaic game according to claim 1, wherein said obtaining a patch division rule table, before confirming patch fragment color values according to the patch division rule table and the obtaining result, further comprises:
acquiring current jigsaw difficulty, and acquiring the corresponding color block division rule table according to the current jigsaw difficulty;
and confirming the color interval of pixel division according to the color block division rule table, wherein the color interval is represented by a red, green and blue three-primary-color numerical value interval.
3. The method of generating patch fragments in a pixel mosaic game according to claim 2, wherein said obtaining a patch division rule table, and confirming patch fragment color values according to the patch division rule table and the obtaining result comprises:
acquiring a color block division rule table;
classifying corresponding pixel points in the color areas in the color block division rule table according to the obtained result;
calculating color values of all pixel points in the color interval to obtain an interval color average value;
and taking the interval color average value as the color block fragment color value.
4. The method for generating color lump fragments in a pixel mosaic game according to claim 3, wherein traversing the periphery of the initial pixel point, and when a preset condition is satisfied, stopping the traversing and generating the color lump fragments according to the acquired pixel points comprises:
traversing the periphery of the initial pixel point, wherein the traversal rule is that the distance between the initial pixel point and the initial pixel point is from near to far, and the traversed pixel point is used as a peripheral pixel;
when the color value of the traversed peripheral pixel does not belong to the current color interval and/or the periphery has no pixel points, taking the current peripheral pixel as a boundary pixel and being incapable of traversing the pixel points around the boundary pixel;
and when no more peripheral pixels can be obtained, stopping traversing, and drawing all the current peripheral pixels into the corresponding color block fragments.
5. The method of claim 1, wherein after all the initial pixel points are traversed and all the color-block fragments in the reference picture are collected to generate a set of color-block fragments, the method further comprises:
traversing all pixel points in the reference picture, and taking the pixel points which are not scratched into the color lump fragments as fixed pixel points;
and after an instruction for starting the jigsaw game is detected, keeping the position of the fixed pixel point still, and changing the pixel point belonging to the color block fragment into a preset color value.
6. The method of claim 1, wherein the capturing all the color-block fragments in the reference picture to generate a set of color-block fragments after all the initial pixel points are traversed comprises:
after traversing all the initial pixel points, marking the same mark on the pixel point belonging to the same color lump fragment and the corresponding color lump fragment according to the traversing time;
acquiring a preset splicing rule, and splicing target pixel points into color block fragments according to the preset splicing rule;
and collecting all the color block fragments in the control picture to generate a color block fragment set.
7. The method of claim 6, wherein said obtaining the predetermined stitching rule comprises: in the splicing process, pixel points which belong to the same color block but do not belong to the same identifier are not spliced;
splicing the target pixel points into color lump fragments according to the initial pixel points and the preset splicing rule comprises the following steps:
and splicing the pixel points belonging to the same identifier to generate color lump fragments, wherein the color composition of the color lump fragments is formed by the color values of the pixel points belonging to the same identifier.
8. A patch fragment generation apparatus in a pixel mosaic game, characterized by comprising:
the pixel scanning module is used for acquiring a reference picture and acquiring all pixel point information in the reference picture to generate an acquisition result;
the color block dividing module is used for acquiring a color block dividing rule table and confirming color block fragment color values according to the color block dividing rule table and the acquiring result;
the initial point confirming module is used for confirming an initial pixel point in the comparison picture according to the color block fragment color value;
the pixel traversal module is used for traversing the periphery of the initial pixel point, stopping traversal when a preset condition is met, and generating color lump fragments according to the acquired pixel point;
and the set generation module is used for collecting all the color block fragments in the reference picture to generate a color block fragment set after traversing all the initial pixel points.
9. An apparatus for generating patch fragments in a pixel mosaic game, the apparatus comprising: a memory, a processor, and a color-block fragment generation program in a pixel mosaic game stored on the memory and executable on the processor, the color-block fragment generation program in a pixel mosaic game configured to implement the color-block fragment generation method in a pixel mosaic game according to any one of claims 1 to 7.
10. A storage medium, wherein a color-patch fragment generation program in a pixel mosaic game is stored thereon, and when the color-patch fragment generation program in the pixel mosaic game is executed by a processor, the method of generating color-patch fragments in the pixel mosaic game according to any one of claims 1 to 7 is implemented.
CN202210988024.7A 2022-08-17 2022-08-17 Color block fragment generation method in pixel jigsaw game and related device Pending CN115496768A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210988024.7A CN115496768A (en) 2022-08-17 2022-08-17 Color block fragment generation method in pixel jigsaw game and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210988024.7A CN115496768A (en) 2022-08-17 2022-08-17 Color block fragment generation method in pixel jigsaw game and related device

Publications (1)

Publication Number Publication Date
CN115496768A true CN115496768A (en) 2022-12-20

Family

ID=84466653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210988024.7A Pending CN115496768A (en) 2022-08-17 2022-08-17 Color block fragment generation method in pixel jigsaw game and related device

Country Status (1)

Country Link
CN (1) CN115496768A (en)

Similar Documents

Publication Publication Date Title
US6927874B1 (en) Image processing method, apparatus and storage medium therefor
KR102082766B1 (en) Method and apparatus for distinguishing objects
US9330447B2 (en) Image evaluation device, image selection device, image evaluation method, recording medium, and program
CN111124404A (en) Custom color display method and system
JP4339675B2 (en) Gradient image creation apparatus and gradation image creation method
CN115496768A (en) Color block fragment generation method in pixel jigsaw game and related device
CN109615583B (en) Game map generation method and device
CN109685861B (en) Picture compression method, device and equipment and computer readable storage medium
US6665451B1 (en) Image processing method and apparatus
US20220347554A1 (en) Collaborative image synthesis from three dimensional cubes
JP2003058880A (en) Method, device and program for processing cross filter and computer readable recording medium recording the same program
CN114527950A (en) Picture color adjusting method, device, equipment and storage medium
JP4334981B2 (en) Image processing apparatus and image processing method
CN105843972B (en) Product attribute information comparison method and device
CN108694031B (en) Identification method and device for three-dimensional display picture
US7587086B2 (en) Identifying selected pixels in a digital image
JP2013065164A (en) Image processing device, image processing method, and image processing program
JP6399808B2 (en) Image processing apparatus, image processing method, and program
CN112199068B (en) Graphics overlay processing method and device, storage medium and electronic device
EP4092600A1 (en) An ad fraud detection system and method
CN111540060B (en) Display calibration method and device of augmented reality equipment and electronic equipment
JP5248719B1 (en) Image evaluation apparatus, image selection apparatus, image evaluation method, recording medium, and program
CN112532866A (en) Information processing apparatus and recording medium
CN115760580A (en) Pixel coordinate calculation method, calculation device, equipment and medium
CN115640416A (en) Object display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination