A kind of man-machine interaction method of dividing based on color, computer vision and grid
Technical field
The present invention relates to the technical field of man-machine interaction, be specifically related to a kind of man-machine interaction method of dividing based on color, computer vision and grid.
Background technology
In the last few years, people's standard of living improves constantly, particularly for electron trades such as computing machines, requiring under the prerequisite of reliability and quality really up to the mark, start to focus on the ease for use of product, the electronic product often with the man-machine interaction method of excellent design, more easily obtains the approval in market, and apple is exactly a most typical example.
The develop rapidly of the electron trades such as computing machine, driven the innovation of human-computer interaction technology, novel human-computer interaction technology emerges in an endless stream, world Ge great electronics firm, all be devoted to study better human-computer interaction technology, thereby allow the product of oneself serve for user provides better more efficiently, the favor of obtaining user occupies one seat in the electronic market of competition excitation.
The present invention is a kind of man-machine interaction method of dividing based on color, computer vision and grid, by camera, obtain the environment in image pickup scope, convert picture to, and by the pixel of picture according to certain algorithm process, according to the result of processing, trigger user-defined event, carry out finishing man-machine interaction.
The invention provides a kind of man-machine interaction method of dividing based on color, computer vision and grid, refer in thering is the electronic equipment of image analysis ability, interactive interface is divided with grid, specify the color of trigger equipment response, and resolve the environment picture in the image pickup scope obtain by camera, according to certain algorithm, calculate the statistic of the pixel mating with designated color, according to the result of statistic, determine whether trigger equipment response, completing user customized event.
Summary of the invention
The technical problem to be solved in the present invention is: the invention provides a set of novel man-machine interaction method, can allow user not under the prerequisite of contacting electronic equipments, by limb control color stage property, complete mutual with electronic equipment.
The technical scheme that the present invention solves the problems of the technologies described above employing is: a kind of man-machine interaction method of dividing based on color, computer vision and grid, the method is in having the electronic equipment of image analysis ability, interactive interface is divided with grid, specify the color of trigger equipment response, and resolve the environment picture in the image pickup scope obtain by camera, according to certain algorithm, calculate the statistic of the pixel mating with designated color, according to the result of statistic, determine whether trigger equipment response, completing user customized event; This electronic equipment with image analysis ability comprises color settings module, and grid is divided module, and camera captures environment module, picture parsing module and grid Event triggered module; This electronic equipment with image analysis ability is computing machine, mobile phone or panel computer, and the required external unit of the method also comprises: color stage property and camera in external environment condition, and this color stage property is band color ball and/or cloth; Wherein:
Color settings module, for setting and trigger the color value of grid event and the pixel statistic of standard in the program with the electronic equipment of image analysis ability, described setting at least comprises program inner setting and reads environment set; Its Program inner setting, refers in the design process of electronic equipment program, in inner color value and the pixel statistic that triggers grid event of specifying of this program; Read environment set, refer in the operational process of electronic equipment program, resolve the external environment condition picture that comprises color stage property that camera obtains, according to color value, the statistic of the pixel of resolving, set color value and the pixel statistic that triggers grid event; Wherein color value refers to the rgb value of color; Pixel statistic refers to the summation of pixel number, and pixel rgb value is sued for peace, averages, asks variance, asks High Order Moment and/or asked analysis of spectrum statistic; Grid event refers at grid divides pixel statistic in the net region of Module Division while meeting the requiring of pixel statistic of the standard that color settings module sets, trigger event, the content of event can be by User Defined, be similar to mouse click event, this module provides normal data support for other module;
Grid is divided module, for the interactive interface with the electronic equipment of image analysis ability being divided into any piece grid according to user's demand, the type of each grid is triangle, the arbitrary polygon that quadrilateral is such, or circular, oval, the geometric figure of any enclosed that star is such, and record grid partitioning algorithm, wherein grid partitioning algorithm refers to the mathematical method that the grid that is divided into deviser and needs adopts, be about to interactive interface T according to fun(T.s, T.locarr, funtype) mathematical method is divided into n piece, be recorded as Tx={T1, T2 ... Tn}, T.s=T1.S+T2.S+ ... + Tn.s, wherein T.s is the area of interactive interface T, T.locarr is each coordinate points defining in T, funtype is the type (as quadrilateral) of each grid after dividing, fun() function is by User Defined.This module provides Meshing Method support for other module;
Camera captures environment module, be used for utilizing camera device, the external environment condition that comprises color stage property in Real-time Obtaining camera image pickup scope, and the byte stream obtaining is converted to the picture of Yi Zhengwei unit, transformation result is submitted to picture parsing module and use;
Picture parsing module, for camera being captured to the grid partitioning algorithm that picture that environment module provides divides module and provide according to grid, carry out net region division, and the pixel statistic of each net region after being divided according to matching algorithm calculating picture, and record this statistic, submit to grid Event triggered module, wherein matching algorithm refers to for a pixel, three color components of its rgb value are respectively RX, GY, BZ, three color components of the rgb value of the designated color that color designated module provides be respectively C ?RX, C ?GY, C ?BZ, if meet certain functional relation f (C ?RX, C ?GY, C ?ZB)=g (RX, GY, BZ), think that the color value of this pixel and the color value of designated color mate, this pixel is an element of calculating pixel point statistic, functional relation f(wherein) and g() by User Defined or preset,
Grid Event triggered module, the pixel statistic that refers to the standard that the statistic from picture parsing module and color settings module are provided compares, comparative approach is by User Defined or preset, if comparative result meets the demands, trigger grid event, otherwise, be left intact.
Further, the implementation procedure of described color settings module is as follows:
(A1), set to trigger the color value of grid event, three color components of its RGB are designated as C-RX, C-GY, C-BZ, color value can arrange a plurality of, method to set up at least comprises program inner setting and reads two kinds of methods of environment set;
(A2), program inner setting refers in the design process of electronic equipment program, in inner color value and the pixel statistic that triggers grid event of specifying of this program;
(A3), reading environment set refers in the operational process of electronic equipment program, resolve the external environment condition picture that comprises color stage property that camera obtains, according to color value, the statistic of the pixel of resolving, set color value and the pixel statistic that triggers grid event;
(A4), set to trigger the pixel statistic of the standard of grid event, be designated as S, this statistic can be pixel number and, pixel rgb value is sued for peace, averages, asks variance, asks High Order Moment and/or is asked analysis of spectrum;
(A5), for other module provides normal data support.
Further, the implementation procedure of described grid division module is as follows:
(B1), according to user's demand, the interactive interface with the electronic equipment of image analysis ability is divided into any piece grid, each grid is triangle or quadrilateral, or circular, ellipse or star, and record Meshing Method;
(B2), for other module provides Meshing Method support.
Further, the implementation procedure of described camera crawl environment module is as follows:
(C1) the external environment condition bytes of stream data that comprises color stage property, in camera Real-time Obtaining image pickup scope, and convert byte stream to picture;
(C2), picture being submitted to picture parsing module uses.
Further, the implementation procedure of described picture parsing module is as follows:
(D1), obtain from camera and capture the picture that environment module is submitted to;
(D2), according to grid, divide the Meshing Method of setting in module picture divided according to the corresponding grid of the interactive interface with electronic equipment, the grid number of division is designated as N;
(D3), successively the color of each pixel of the picture in N net region and the setting of color settings module is carried out to matching operation, three color components of the RGB of a pixel of the picture in note net region are RX, GY, BZ, operating function is respectively f(), g();
(D4) if meet f (C-RX, C-GY, C-BZ)=g (RX, GY, BZ) functional relation, the match is successful to show the color value of this pixel and the color value of color designated module appointment, and this pixel is an element of calculating pixel point statistic; If do not met, do not do any processing, C-RX wherein, C-GY, C-BZ is three color components of the RGB of the designated color that provides of color settings module;
(D5), all pixels of the picture in a net region all complete after matching operation, all pixels that meet the element that is calculating pixel point statistic are carried out to normalized set, the statistic of this statistic and color settings module is corresponding one by one, and records statistics;
(D6), circulation completing steps (D2) is to the process of step (D5), until the statistic of the picture of N net region has all been calculated and record;
(D7), the statistic result of the N of a record grid being submitted to grid Event triggered module uses.
Further, the implementation procedure of described grid Event triggered module is as follows:
(E1), obtain the statistic set from picture parsing module, be designated as Snx={S
1, S
2, S
3.S
n;
(E2), the pixel statistic of standard that each statistic in Snx and color settings module are provided compares, comparative approach can be size relatively, can be by User Defined;
(E3) if comparative result meets user-defined requirement, trigger grid event; Otherwise, be left intact.
The present invention's advantage is compared with prior art:
(1), the present invention improved existing man-machine interaction method, the man-machine interaction method of traditional dependence mouse and keyboard mutuality is improved to based on the mutual man-machine interaction method of body sense.
(2), the present invention is the man-machine interaction method based on body sense, compare with existing body sense exchange method, low to the hardware requirement of electronic equipment, do not need other special-purpose body sense checkout equipment (as kinect), as long as electronic equipment possesses camera and picture analytic ability, applicability is high.
(3), the present invention is the man-machine interaction method based on body sense, in completing mutual process, can play a protective role to the health of human body.
Accompanying drawing explanation
Fig. 1 is system framework figure of the present invention;
Fig. 2 is color designated module process flow diagram of the present invention;
Fig. 3 is that grid of the present invention is divided module process flow diagram;
Fig. 4 is that camera of the present invention captures environment module process flow diagram;
Fig. 5 is picture parsing module process flow diagram of the present invention;
Fig. 6 is grid Event triggered module process flow diagram of the present invention.
Embodiment
Below in conjunction with drawings and the specific embodiments, further illustrate the present invention.
As shown in Figure 1, a kind of man-machine interaction method of dividing based on color, computer vision and grid of the present invention, by color settings module, grid is divided module, and camera captures environment module, picture parsing module, grid Event triggered module forms.Its required external unit comprises: the color stage property in external environment condition (band color ball, cloth etc.), has the electronic equipment (computing machine, mobile phone, panel computer etc.) of image analysis ability, camera.Whole process implementation is as follows:
(1) color settings module, refers to set in the program of electronic equipment with image analysis ability and triggers the color value of grid event and the pixel statistic of standard, establishing method at least comprises program inner setting and reads environment set.Its Program inner setting, referring to can be in the design process of the program of electronic equipment, in inner color value and the pixel statistic that triggers grid event of specifying of this program; Read environment set, refer to and resolve the external environment condition picture that comprises color stage property that camera obtains, according to color value, the statistic of the pixel of resolving, set color value and the pixel statistic that triggers grid event.Wherein color value refers to the rgb value of color; Pixel statistic refers to the summation of pixel number, and pixel rgb value is sued for peace, averages, asks variance, asks High Order Moment, asked the statistics such as analysis of spectrum; Grid event refers at grid divides pixel statistic in the net region of Module Division while meeting the requiring of pixel statistic of the standard that color settings module sets, trigger event, the content of event can, by User Defined, be similar to mouse click event.This module provides normal data support for other module.
(2) grid is divided module, refer to according to user's demand the interactive interface with the electronic equipment of image analysis ability is divided into any piece grid, each grid can be the arbitrary polygons such as triangle, quadrilateral, also can be circular, oval, the geometric figure of any enclosed such as star, and record grid partitioning algorithm.Wherein grid partitioning algorithm refers to the mathematical method that the grid that is divided into user and needs adopts, be about to interactive interface T according to fun(T.s, T.locarr, funtype) mathematical method is divided into n piece, is recorded as Tx={T1, T2 ... Tn}, T.s=T1.S+T2.S+ ... + Tn.s, wherein T.s is the area of interactive interface T, T.locarr is each coordinate points defining in T, funtype is the type of each grid after dividing, and fun() function is by User Defined.This module provides Meshing Method support for other module.
(3) camera captures environment module, refer to and utilize camera device, the external environment condition that comprises color stage property in Real-time Obtaining camera image pickup scope, and the byte stream obtaining is converted to the picture of Yi Zhengwei unit, transformation result is submitted to picture parsing module and use.
(4) picture parsing module, refer to that camera is captured to picture that environment module provides to be divided according to grid the grid partitioning algorithm providing in module and carry out net region division, and the pixel statistic of each net region after being divided according to matching algorithm calculating picture, and record this statistic, submit to grid Event triggered module.Wherein matching algorithm refers to for a pixel, and three color components of its rgb value are respectively RX, GY, BZ, three color components of the rgb value of the designated color that color designated module provides be respectively C ?RX, C ?GY, C ?BZ, if meet certain functional relation f (C ?RX, C ?GY, C ?ZB)=g (RX, GY, BZ), think that the color value of this pixel and the color value of designated color mate, this pixel is an element of calculating pixel point statistic.Functional relation f(wherein) and g() can be by User Defined.
(5) grid Event triggered module, refers to that the pixel statistic of the standard that the statistic from picture parsing module and color settings module are provided compares, comparative approach can be size relatively etc., can be by User Defined.If comparative result meets the demands, trigger grid event, otherwise, be left intact.
The implementation procedure of above-mentioned each module is as follows:
1, the implementation procedure of color settings module is as follows:
(1) set the color value that triggers grid event, three color components of its RGB are designated as C-RX, C-GY, and C-BZ, color value can arrange a plurality of, and method to set up at least comprises program inner setting and reads two kinds of methods of environment set;
(2) program inner setting is exactly directly in program, to set color and the pixel statistic that triggers grid event, enters step (6);
(3) read environment set, first with camera, capture environment module and obtain the byte stream with the environment of color stage property, then convert byte stream to picture.Enter step (4);
(4) resolve each pixel in the region that comprises color stage property of picture, recording pixel point statistic and its corresponding rgb value, enter step (5);
(5) the meet certain requirements color of rgb value of (user can customize) of selected pixels point statistic is designated color, and the pixel statistic of this pixel statistic for setting, enters step (6);
(6) for other module provides Data support.
2, the implementation procedure of grid division module is as follows:
(1) to have the interactive interface of electronic equipment of image analysis ability be T to record, according to the Meshing Method fun(T.s of user's definition, T.locarr, funtype) divide, be divided into n piece grid, be recorded as Tx={T1, T2 ... Tn}, T.s=T1.S+T2.S+ ... + Tn.s, wherein in T and Tn, each element comprises three above attributes, be respectively area s, the coordinate points array locarr of definition, trellis-type funtype.(as rectangle interactive interface T being divided into nine grids by fun method, T.s is the area of rectangle interactive interface, and T.locarr is the array set of the coordinate that comprises four angles of rectangle interactive interface, T.locarr={ upper left corner coordinate, upper right corner coordinate, lower left corner coordinate, lower right corner coordinate ..., funtype is rectangle, through fun() function processing, T is divided into nine rectangular nodes, be recorded as Tx={T1, T2 ... T9}, grid has been divided.Enter step (2);
(2) for other module provides Meshing Method fun().
3, the implementation procedure of camera crawl environment module is as follows:
(1) the external environment condition bytes of stream data that comprises color stage property in Real-time Obtaining camera image pickup scope, enters step (2);
(2) convert byte stream to picture, and picture is submitted to picture parsing module and use, enter step (1).
4, the implementation procedure of picture parsing module is as follows:
(1) obtain from camera and capture the picture that environment module is submitted to, enter step (2);
(2) obtain grid and divide the Meshing Method fun(setting in module), use the method that picture P is divided according to the corresponding grid of the interactive interface with electronic equipment, carry out fun(P.s, P.locarr, funtype), picture P is divided into n piece, pictures after division completes are combined into Pset={P1, P2 ... Pn}, P=P1+P2+ ... + Pn, enters step (3);
(3) successively the color of each pixel in every pictures in Pset set and the setting of color settings module is carried out to matching operation, in note Pste set, three color components of the RGB of the pixel of picture are RX, GY, BZ, operating function is respectively f(), g(), enter step (4);
(4) if meet f (C-RX, C-GY, C-BZ)=g (RX, GY, BZ) functional relation, the match is successful to show the color value of this pixel and the color value of color designated module appointment, and this pixel is an element of calculating pixel point statistic; If do not met, do not do any processing, C-RX wherein, C-GY, C-BZ is three color components of the RGB of the designated color that provides of color settings module, enters step (5);
(5) all pixels of a certain pictures Px in Pset set all complete after matching operation, all pixels that meet the element that is calculating pixel point statistic are carried out to normalized set, the statistic of this statistic and color settings module is corresponding one by one, and statistic corresponding to recordable picture Px, be designated as Sx, enter step (6);
(6) judge whether all pictures in Pset set to complete the calculating of pixel statistic, if so, enter step (7); Otherwise, enter step (3);
(7) by the S set nx={S of the pixel statistic of the n pictures in the Pset set of record
1, S
2, S
3.S
nsubmit to grid Event triggered module and use.
5, the implementation procedure of grid Event triggered module is as follows:
(1) obtain the statistic set from picture parsing module, be designated as Snx={S
1, S
2, S
3.S
n, enter step (2);
(2) the pixel statistic of the standard successively each statistic in Snx and color settings module being provided compares, comparative approach can be size relatively etc., can, by User Defined, enter step (3);
(3) if comparative result meets the requirement of user-defined comparative approach, trigger grid event; Otherwise, be left intact, enter step (4);
(4) judge whether all pixel statistics in Snx to complete the comparison of the pixel statistic of the standard providing with color settings module, if it is this event completes; Otherwise enter step (2).
The content not being described in detail in instructions of the present invention belongs to the known prior art of professional and technical personnel in the field.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.