[embodiment]
Below in conjunction with specific embodiment and accompanying drawing, technical scheme is described in detail.
In one embodiment, as shown in Figure 1, a kind of shortcut function method of realizing comprises the following steps:
Step S10 gathers the image that comprises marked region.
In the present embodiment, marked region is a zone in the image that gathers, and this zone can be formed by interactive device.
Concrete, in one embodiment, interactive device can be hand-held device, part or all of hand-held device can be set as color or the shape of appointment, gather the image of hand-held device, this designated color in the hand-held device in image or the part of shape form marked region.In addition, interactive device can also be the hand-held device of tape label, namely attach the mark (as reflectorized material) of designated color or shape on hand-held device, gather the image of hand-held device, on the hand-held device in image, the mark of incidental designated color or shape forms marked region.
In another embodiment, interactive device can also be human body (such as people's face, palm, arm etc.), gathers the image of human body, and the human body in image forms marked region.In addition, interactive device can also be the human body of tape label, namely attaches the mark (as reflectorized material) of designated color or shape on human body, and when gathering the image of human body, this designated color in image or the mark of shape form marked region.
Step S20, the attitude in identification marking zone.
Concrete, the image that collects is processed, extract the marked region in image, then produce the attitude of marked region according to the pixel coordinate of the pixel in marked region in the image coordinate system that builds.So-called attitude refers to marked region formed posture state in image.Further, in two dimensional image, attitude is marked region and the angle between predeterminated position, the i.e. attitude angle in two dimensional image; In 3-D view, attitude is the vector that marked region in two dimensional image and a plurality of attitude angle between predeterminated position form, i.e. the attitude vector." attitude that marked region produces " said in the present invention, " attitude of marked region ", " attitude " all refer to described attitude, namely the attitude angle of different embodiment and attitude vector.
Step S30 generates steering order corresponding to attitude.
In the present embodiment, preset the attitude of marked region and the mapping relations between steering order, and these mapping relations are stored in database.After identifying the attitude of marked region, can search the steering order corresponding with attitude from database according to the attitude that identifies.
Step S40 obtains the input instruction corresponding with steering order with the mapping relations of input instruction, and sends to instruction process system according to steering order, default steering order.
The input instruction is the instruction that operating system can be identified.For example, order line input instruction " dir/p " expression split screen is showed file and the sub-directory under current directory; The current file of choosing of the input instruction " deletion " of right button popup menu expression deletion after the mouse filesselected.
The mapping relations of steering order and input instruction are for presetting, and store with the form of key-value pair.After the steering order that gets generation, find the input instruction corresponding with this steering order according to this key-value pair, then send to instruction process system.
For example, shown the attitude of L when user's limb action, when having generated corresponding steering order A001, find corresponding with it input instruction and be " del*.txt " (deleting the file of all expansions txt by name) in default key-value pair, then " del*.txt " sent to instruction process system, instruction process system is carried out the file of all suffix of deletion txt by name by parsing.
The above-mentioned shortcut function method of realizing, go out according to the image recognition that comprises marked region that collects the attitude that marked region produces, and generate steering order corresponding to attitude, then the mapping relations according to default steering order and input instruction convert this steering order to input instruction that instruction process system can be identified.Owing to judging movement locus and the attitude of limb action by the image that obtains limb action, therefore, the user only need to make corresponding limb action just can complete quick input, need to not use keyboard or mouse input, and makes that the user's is more convenient to operate.
In one embodiment, after generating steering order corresponding to attitude, detect also whether the configuration-direct input is arranged; When the configuration-direct input having been detected, obtain the input instruction, and generate the mapping relations of steering order and input instruction according to steering order and input instruction; When the configuration-direct input not detected, execution in step S40.
Can pre-defined steering order and the mapping relations of inputting instruction.Obtain according to step S10, S20 and S30 steering order corresponding to attitude that consists of with user's limb action.Before execution in step S40, first judge whether to have detected the configuration-direct input.Whether configuration-direct is a switch order, be used for the expression configuration and begin.The user can trigger by the button on the devices such as telepilot, also can be by predetermined attitude action triggers.When the configuration-direct input having been detected, the steering order that expression is generated by step S10, S20 and S30 is used for arranging the mapping relations of steering order and input instruction; When not detecting, expression is used for searching the input instruction corresponding with this steering order by the steering order that step S10, S20 and S30 generate.
Further, show the visual configuration interface, obtain the input instruction by the visual configuration interface.
For example, user's limb action has been shown the attitude that opens arms, and then the steering order 002 that is then generated by step S10, S20 and S30 detects the user and whether triggering configuration-direct by pressing button default on telepilot or keyboard before.If the configuration-direct input detected, show visual input instruction input frame, can obtain the input instruction of character string type, also can obtain the cursor track type input instruction that in input frame, cursor movement forms, then with steering order 002 and the form storage of the input instruction that gets with key-value pair.
In one embodiment, the input instruction is many.When generating steering order and inputting the mapping relations of instruction, the input instruction is generated the input instruction sequence according to the time sequencing of inputting, and generation steering order and the mapping relations of inputting instruction sequence.
When obtaining the input instruction corresponding with steering order, obtain the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence, extract the input instruction by the time sequencing of inputting from the input instruction sequence.
For example, can obtain by the visual configuration interface many input instruction B001, B002, the B003......B00N of user input, and will input instruction and be arranged in the input instruction sequence according to the time sequencing of inputting.Then by steering order and input instruction sequence are generated the mapping relations of steering order and input instruction with the form storage of key-value pair.When configuration finishes, when obtaining the input instruction according to steering order, first obtain the input instruction sequence corresponding with it according to steering order, extract the input instruction and send to instruction process system by the time sequencing of inputting from the input instruction sequence, instruction process system namely carries out by the time sequencing of input the input instruction of inputting in instruction sequence.
Further, after the time sequencing generation input instruction sequence of input instruction according to input, also will input instruction sequence with the form storage of script.
When obtaining the input instruction sequence corresponding with steering order, obtain the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence from script.
Adopt script storage input instruction sequence, can facilitate the user to preserve and transmission configuration.On the user can upload onto the server the script that configures, and the synchronizeing of version on maintenance and server.When wishing on a plurality of equipment as the user to adopt identical configuration, can directly download this configuration on server, thereby the mapping relations that make the user avoid frequently configuring steering order and input instruction are more convenient to operate.
Further, script also comprises sequence control instruction, after getting the input instruction, also obtains order and describes instruction, describes instruction according to order and will input instruction and be arranged in the input instruction sequence.
When obtaining the input instruction sequence corresponding with steering order, describe instruction according to order and resolve script, then obtain the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence from script.
Order is described instruction and is comprised that looping discription instruction, branch describe instruction.For example, create fast 10000 files if wish by the limbs attitude, the filename of the file that creates is natural number to be arranged, and can limit the input instruction that creates file with the looping discription instruction, and the file name parameter that each circulation time will create in the input instruction of file adds 1.Added sequentially instruction is described after, the user carries out a plurality of input instructions when the mapping relations of configuration steering order and input instruction according to the order of appointment, facilitate the user to be configured, and simultaneously, has also expanded input instruction corresponding to steering order.
As shown in Figure 2, in one embodiment, the image that comprises marked region that collects is two dimensional image, and the detailed process of above-mentioned steps S20 comprises:
Step S202 extracts the pixel of mating with default color model in image, the pixel of obtaining is carried out connected domain detect, and extracts the marked region that detects in the connected domain that obtains.
Concrete, can comprise by camera acquisition the image of marked region, the image that obtains is the two-dimensional visible light image.Preferably, also can add infrared fileter before the camera lens of video camera, be used for elimination except other wave band light of infrared band, the image that gathers is the two-dimensional infrared image.In visible images, the object in scene can form the identification of marked region and disturb, and infrared image has been because having filtered out visible light information, disturbs lessly, so the two-dimensional infrared image more is conducive to extract marked region.
In the present embodiment, set up in advance color model.For example the color of marked region is red, sets up in advance red model, and in this model, the rgb value component of pixel can be between 200 to 255, and G, B component can be close to zero; Obtain the pixel that satisfies the rgb value of this redness model in the image of collection and be red pixel.In addition, when forming marked region by human body in the image that gathers, can obtain the pixel of mating with default complexion model in the image of collection.The pixel of obtaining is carried out connected domain detect, obtain a plurality of connected domains, if connected domain is the set that individual continuous pixel forms.
In the present embodiment, because the size and shape of marked region should be roughly changeless, the pixel of obtaining is being carried out connected domain when detecting, can calculate girth and/or the area of all connected domains in the pixel of obtaining.Concrete, the girth of connected domain can be the number of connected domain boundary pixel, and the area of connected domain can be the number of the whole pixels in connected domain.Further, the girth of the connected domain obtained and/or girth and/or the area of area and default marked region can be compared, obtain the girth that satisfies default marked region and/or the connected domain of area and be marked region.Preferably, also can with girth square with the ratio of area as judgment criterion, this ratio of connected domain satisfies this ratio of default marked region, this connected domain is marked region.
Step S204 obtains the pixel coordinate in marked region, produces the marked region attitude according to this pixel coordinate.
Concrete, in one embodiment, as shown in Figure 3, interactive device comprises portion of the handle and the mark that is attached to portion of the handle, wherein, mark can be the reflectorized material of elongate in shape, and is preferred, can be ellipse or rectangular shape.In other embodiments, interactive device also can be human body, and as face, palm, arm etc., the marked region in the image that collects is the zone of human body.
In the present embodiment, marked region is a continuum, the process that produces the attitude of marked region according to pixel coordinate is: the covariance matrix that calculates pixel coordinate, obtain covariance matrix eigenvalue of maximum characteristic of correspondence vector, produce the attitude of marked region according to proper vector, the attitude of this marked region is an attitude angle.
Concrete, as shown in Figure 4, build the two dimensional image coordinate system, for two the some A (u1, v1) on this coordinate system and B (u2, v2), the attitude angle of its formation is the arc tangent of slope, i.e. arctan ((v2-v1)/(u2-u1)).Concrete, in the present embodiment, calculate the covariance matrix of the pixel coordinate in the marked region that extracts, obtain covariance matrix eigenvalue of maximum characteristic of correspondence vector, the direction of this proper vector is the direction of marked region major axis place straight line.As shown in Figure 4, marked region major axis place rectilinear direction is the direction of A, 2 place straight lines of B, establishes proper vector and is [dir_u, dir_v]
T, wherein, the projection of direction on the u axle of the regional major axis of dir_u descriptive markup, its absolute value is proportional to the projection (be u2-u1) of vector on the u change in coordinate axis direction of pointing to B from A; The projection of direction on the v axle of dir_v descriptive markup zone major axis, its absolute value is proportional to the projection (be v2-v1) of vector on the v change in coordinate axis direction of pointing to B from A.If dir_u or dir_v less than 0, are modified to [dir_u ,-dir_v]
T, the attitude angle of marked region is: arctan (dir_v/dir_u).
In another embodiment, marked region comprises the first continuum and the second continuum, the detailed process that produces the attitude of marked region according to described pixel coordinate is: calculate the center of gravity of the first continuum and the center of gravity of the second continuum according to pixel coordinate, produce the attitude of marked region according to the pixel coordinate of the center of gravity of the pixel coordinate of the center of gravity of the first continuum and the second continuum.Concrete, in one embodiment, interactive device comprises portion of the handle and is attached to two marks of portion of the handle.As shown in Figure 5, be labeled as two, be attached to respectively the portion of the handle front end, the shape of mark can be ellipse or rectangle.Preferably, mark can be for being positioned at two round dots of handgrip part front end.As shown in Figure 6, mark can be arranged on the two ends of portion of the handle.In other embodiments, also mark can be arranged on human body, for example be arranged on people's face, palm or arm.Should be noted that two set marks can size, inconsistent on the feature such as shape, color.
In the present embodiment, the marked region of extraction comprises two continuums, is respectively the first continuum and the second continuum.Further, calculate the center of gravity of these two continuums according to pixel coordinate.Concrete, calculate the mean value of the whole pixel coordinates in the continuum, resulting pixel coordinate is the center of gravity of continuum.As shown in Figure 4, the center of gravity of two continuums that calculate is respectively A (u1, v1) and B (u2, v2), and the attitude angle of marked region is the arc tangent of slope, i.e. arctan ((v2-v1)/(u2-u1)).
In another embodiment, the image that gathers can be 3-D view.Concrete, can utilize traditional stereo visual system (being formed by two known video camera and Correlation method for data processing equipment in locus), structured-light system (a right video camera, light source and Correlation method for data processing equipment form) or TOF (time of flight, flight time) depth camera collection 3-D view (being the three dimensional depth image).
In the present embodiment, as shown in Figure 7, the detailed process of step S20 comprises:
Step S210 to Image Segmentation Using, extracts the connected domain in this image, calculates the property value of connected domain, and the property value of connected domain and default marked region property value are compared, and this marked region is the connected domain that meets this default marked region property value.
Concrete, when in the three dimensional depth image, two adjacent pixel depths differ less than predefined threshold value, for example 5 centimetres, think that two pixels are communicated with, whole image is carried out connected domain detect, can obtain comprising a series of connected domains of mark connected domain.
In the present embodiment, the property value of connected domain comprises the size and dimension of connected domain.Concrete, calculate the size/shape of connected domain, compare with the size/shape of mark on interactive device, the connected domain that obtains meeting the size/shape of mark is the connected domain (marked region) of marked region.Take rectangle marked as example, be to be rectangle in the image that is marked at collection on interactive device, the length of pre-set mark and width, calculate length and the width of physical region corresponding to connected domain, length and the width of this length and width and mark are more approaching, and connected domain is more similar to marked region.
Further, the length of the physical region that the calculating connected domain is corresponding and the process of width are as follows: calculate the covariance matrix of the three-dimensional coordinate of connected domain pixel, adopt following formula to calculate length and the width of physical region corresponding to connected domain:
Wherein, k is predefined coefficient, for example is made as 4, and when λ was the covariance matrix eigenvalue of maximum, l was the length of connected domain, and when λ was the second largest eigenwert of covariance matrix, l was the width of connected domain.
Further, also can preset the length breadth ratio of rectangle marked, for example length breadth ratio is 2, the length breadth ratio of physical region corresponding to connected domain is more close to the length breadth ratio of the rectangle marked of default settings, connected domain is more similar to marked region, concrete, adopt following formula to calculate the length breadth ratio of physical region corresponding to connected domain:
Wherein, r is the length breadth ratio of connected domain, λ
0Be the eigenvalue of maximum of covariance matrix, λ
1Second Largest Eigenvalue for covariance matrix.
Step S220 obtains the pixel coordinate in marked region, produces the attitude of marked region according to this pixel coordinate.
Concrete, in the present embodiment, the attitude of marked region is the attitude vector.As shown in Figure 8, build the 3-D view coordinate system, this coordinate is right-handed coordinate system.In this coordinate system, establish space vector OP, P is at the p that is projected as of plane X OY, and the attitude vector with polar coordinate representation vector OP is [α, θ]
T, α is angle XOp, and namely X-axis is to the Op angle, and span is 0 to 360 degree, and θ is angle pOP, i.e. the angle of OP and XOY plane, span be-90 to spend to 90 and spend.If 2 on the space ray in this coordinate system is A (x1, y1, z1) and B (x2, y2, z2), this attitude of 2 vector [α, θ]
TAvailable following formula is unique to be determined:
In the present embodiment, after extracting marked region, calculate the covariance matrix of the pixel coordinate in marked region, obtain covariance matrix eigenvalue of maximum characteristic of correspondence vector, and this proper vector is converted to the attitude vector.Concrete, establish the attitude vector that obtains and be [dir
x, dir
y, dir
z]
T, wherein, dir
xRepresent 2 distances on the x direction of principal axis, dir
yRepresent 2 distances on the y direction of principal axis, dir
zRepresent 2 distances on the z direction of principal axis.Can think has two points on the ray of this attitude vector description, namely (0,0,0) and
Be that ray triggers from initial point, point to (dir
x, dir
y, dir
z), attitude angle need satisfy above-mentioned formula (1) and (2), makes the x1=0 in above-mentioned formula (1) and (2), y1=0, z1=0, x2=dir
x, y2=dir
y, z2=dir
z, can obtain attitude vector [α, θ]
T
In one embodiment, marked region is a continuum, the process that produces the attitude of marked region according to pixel coordinate is: the covariance matrix that calculates pixel coordinate, obtain covariance matrix eigenvalue of maximum characteristic of correspondence vector, produce the attitude of marked region according to proper vector.As mentioned above, the attitude of this marked region is an attitude vector.
In another embodiment, marked region comprises the first continuum and the second continuum, the detailed process that produces the attitude of marked region according to described pixel coordinate is: calculate the center of gravity of the first continuum and the center of gravity of the second continuum according to pixel coordinate, calculate the attitude of marked region according to the pixel coordinate of the center of gravity of the pixel coordinate of the center of gravity of the first continuum and the second continuum.As shown in Figure 8, in the present embodiment, the pixel coordinate in marked region is three-dimensional coordinate, and is concrete, can produce the attitude of marked region according to the pixel coordinate of the center of gravity of two continuums that calculate, and this attitude is an attitude vector.
In one embodiment, also can comprise before the step of the attitude in identification marking zone: the image that judgement gathers is two dimensional image or the step of 3-D view.Concrete, if the image that gathers is two dimensional image, carry out above-mentioned steps S202 to step S204, if the image that gathers is 3-D view, carry out above-mentioned steps S210 to S220.
As shown in Figure 9, in one embodiment, the detailed process of above-mentioned steps S30 comprises:
Step S302 obtains the attitude of this marked region in current frame image.
As mentioned above, the attitude of obtaining in step S302 can be the attitude (being attitude angle) of the marked region in the two dimensional image of present frame, can be also the attitude (being the attitude vector) of the marked region in the three-dimensional dark image of present frame.In the present embodiment, the mapping relations between attitude and steering order have been preset.This attitude also can be described as absolute attitude.
Step S304, the steering order corresponding with this attitude with the mapping relations generation between steering order according to default attitude.
For example, steering order is left mouse button instruction and right button instruction.Take two dimensional image as example, the span of attitude angle is that-180 degree are to 180 degree.Can preset attitude angle in current frame image in the scope of (a, b), trigger the left button instruction, the attitude angle in current frame image triggers the right button instruction in the scope of (c, d).Wherein, a, b, c, d are predefined angle, satisfy a<b, c<d, and the common factor of set [a, b] and set [c, d] is empty.
In addition, in 3-D view, the attitude that identifies comprises two attitude angle, can obtain steering order with one of them attitude angle, also can obtain steering order with two attitude angle.Use Method And Principle and the two dimensional image of one of them attitude angle similar, repeat no more at this.When using two attitude angle, if two attitude angle can be set all in predefined instruction triggers scope the time, just trigger steering order.
As shown in figure 10, in another embodiment, the image that comprises marked region of collection is image sequence, and the detailed process of above-mentioned steps S30 comprises:
Step S310 obtains the relative attitude between the attitude of the attitude of this marked region in current frame image and this marked region in the previous frame image.
In the present embodiment, but the image sequence that Real-time Collection is comprised of a plurality of images that comprise marked region.As mentioned above, the attitude of obtaining in step S310 can be the attitude angle of the marked region in current frame image and previous frame image, can be also the attitude vector of the marked region in current frame image and previous frame image.Relative attitude between attitude in attitude in current frame image and previous frame image is both differences.
Step S320, the steering order corresponding with this relative attitude with the mapping relations generation between steering order according to default relative attitude.
For example, take two dimensional image as example, relative attitude is the relative attitude angle, the attitude angle that can preset current frame image is spent greater than 30 than the attitude angle increase of previous frame, be relative attitude angle when spending greater than 30, trigger the instruction that the roller of mouse rolls counterclockwise, the attitude angle of current frame image reduces when spending greater than 40 than the attitude angle of previous frame, be relative attitude angle when spending less than-40, trigger the instruction that the roller of mouse rolls clockwise.The principle of 3-D view is similar with it, repeats no more at this.
In 3-D view, the attitude that identifies comprises two attitude angle, can obtain steering order with one of them attitude angle, also can obtain steering order with two attitude angle.Use Method And Principle and the two dimensional image of one of them attitude angle similar, repeat no more at this.When using two attitude angle, change and all satisfy when pre-conditioned if two attitude angle can be set, for example first attitude angle changes greater than predefined first threshold, and second attitude angle changes greater than predefined Second Threshold, triggers steering order.
In one embodiment, as shown in figure 11, a kind of system that realizes shortcut function comprises image capture module 10, gesture recognition module 20, instruction generation module 30 and instruction transformation module 40, wherein:
Image capture module 10 is used for gathering the image that comprises marked region.
In the present embodiment, marked region is a zone in the image that gathers, and this zone can be formed by interactive device.Concrete, in one embodiment, interactive device can be hand-held device, part or all of hand-held device can be set as color or the shape of appointment, gather the image of hand-held device, this designated color in the hand-held device in image or the part of shape form marked region.In addition, interactive device can also be the hand-held device of tape label, namely attach the mark (as reflectorized material) of designated color or shape on hand-held device, gather the image of hand-held device, on the hand-held device in image, the mark of incidental designated color or shape forms marked region.
In another embodiment, interactive device can also be human body (such as people's face, palm, arm etc.), gathers the image of human body, and the human body in image forms marked region.In addition, interactive device can also be the human body of tape label, namely attaches the mark (as reflectorized material) of designated color or shape on human body, and when gathering the image of human body, this designated color in image or the mark of shape form marked region.
Gesture recognition module 20 is used for the attitude in identification marking zone.
Concrete, the image that collects is processed, extract the marked region in image, then obtain the attitude of marked region according to the pixel coordinate of the pixel in marked region in the image coordinate system that builds.So-called attitude refers to marked region formed posture state in image.Further, in two dimensional image, attitude is marked region and the angle between predeterminated position, the i.e. attitude angle in two dimensional image; In 3-D view, attitude is the vector that marked region in two dimensional image and a plurality of attitude angle between predeterminated position form, i.e. the attitude vector." attitude that marked region produces " said in the present invention, " attitude of marked region " all refers to described attitude, namely the attitude angle of different embodiment and attitude vector.
Instruction generation module 30 is used for generating steering order corresponding to attitude.
In the present embodiment, preset the attitude of marked region and the mapping relations between steering order, and these mapping relations are stored in the database (not shown).After identifying the attitude of marked region, the attitude that instruction generation module 30 can be used for identifying according to gesture recognition module 20 is searched the steering order corresponding with attitude from database.
Instruction transformation module 40 is used for obtaining the input instruction corresponding with steering order with the mapping relations of input instruction, and sending to instruction process system according to steering order, default steering order.
The input instruction is the instruction that operating system can be identified.For example, order line input instruction " dir/p " expression split screen is showed file and the sub-directory under current directory; The current file of choosing of the input instruction " deletion " of right button popup menu expression deletion after the mouse filesselected.
The mapping relations of steering order and input instruction are for presetting, and store with the form of key-value pair.After the steering order that gets generation, instruction transformation module 40 is used for finding the input instruction corresponding with this steering order according to this key-value pair, then sends to instruction process system.For example, shown the attitude of L when user's limb action, when having generated corresponding steering order A001, find corresponding with it input instruction and be " del*.txt " (deleting the file of all expansions txt by name) in default key-value pair, then " del*.txt " sent to instruction process system, instruction process system is carried out the file of all suffix of deletion txt by name by parsing.
The above-mentioned system that realizes shortcut function, go out according to the image recognition that comprises marked region that collects the attitude that marked region produces, and generate steering order corresponding to attitude, then the mapping relations according to default steering order and input instruction convert this steering order to input instruction that instruction process system can be identified.Owing to judging movement locus and the attitude of limb action by the image that obtains limb action, therefore, the user only need to make corresponding limb action just can complete quick input, need to not use keyboard or mouse input, and makes that the user's is more convenient to operate.
In one embodiment, as shown in figure 16, the system that realizes shortcut also comprises mapping configuration module 50, be used for after generating steering order corresponding to attitude, detect whether the configuration-direct input is arranged, when the configuration-direct input having been detected, obtain the input instruction, and generate the mapping relations of steering order and input instruction according to steering order and input instruction; When the configuration-direct input not detected, call instruction modular converter 40.
Mapping configuration module 50 can be used for the mapping relations of pre-defined steering order and input instruction.Mapping configuration module 50 generates steering order corresponding to attitude that consists of with user's limb action according to instruction generation module 30.Mapping configuration module 50 can be used for detecting whether the configuration-direct input is arranged.Whether configuration-direct is a switch order, be used for the expression configuration and begin.The user can trigger by the button on the devices such as telepilot, also can be by predetermined attitude action triggers.When mapping configuration module 50 had detected the configuration-direct input, the steering order that represents to be generated by instruction generation module 30 was for the mapping relations of steering order with the input instruction are set; When not detecting, expression is used for searching the input instruction corresponding with this steering order by the steering order that instruction generation module 30 generates.
Further, mapping configuration module 50 can be used for showing the visual configuration interface, obtains the input instruction by the visual configuration interface.
For example, user's limb action has been shown the attitude that opens arms, then generate steering order 002 by instruction generation module 30, mapping configuration module 50 can be used for detecting the user and whether is triggering configuration-direct by pressing button default on telepilot or keyboard before.When mapping configuration module 50 has detected the configuration-direct input, show visual input instruction input frame, obtain the input instruction of character string type, also can obtain the cursor track type input instruction that in input frame, cursor movement forms, then with steering order 002 and the form storage of the input instruction that gets with key-value pair.
In one embodiment, the input instruction is many.Mapping configuration module 50 also is used for inputting instruction and generates the input instruction sequence according to the time sequencing of inputting, and generates steering order and the mapping relations of inputting instruction sequence.
Instruction transformation module 40 also can be used for obtaining the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence, and then the time sequencing by input extracts the input instruction from the input instruction sequence.
For example, can obtain by the visual configuration interface many input instruction B001, B002, the B003......B00N of user input, and will input instruction and be arranged in the input instruction sequence according to the time sequencing of inputting.Then by steering order and input instruction sequence are generated the mapping relations of steering order and input instruction with the form storage of key-value pair.When configuration finishes, when obtaining the input instruction according to steering order, first obtain the input instruction sequence corresponding with it according to steering order, extract the input instruction and send to instruction process system by the order of inputting from the input instruction sequence, instruction process system namely carries out by the time sequencing of input the input instruction of inputting in instruction sequence.
Further, the mapping configuration module also can be used for the form storage of input instruction sequence with script.
Instruction transformation module 40 also is used for obtaining the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence from script when obtaining the input instruction sequence corresponding with steering order.
Adopt script storage input instruction sequence, can facilitate the user to preserve and transmission configuration.On the user can upload onto the server the script that configures, and the synchronizeing of version on maintenance and server.When wishing on a plurality of equipment as the user to adopt identical configuration, can directly download this configuration on server, thereby the mapping relations that make the user avoid frequently configuring steering order and input instruction are more convenient to operate.
Further, script also comprises sequence control instruction.Mapping configuration module 50 also is used for obtaining order and describes instruction, describes instruction according to order and will input instruction and be arranged in the input instruction sequence.
Instruction transformation module 40 is used for describing instruction according to order and resolves script, then obtains the input instruction sequence corresponding with steering order according to steering order, steering order with the mapping relations of input instruction sequence from script.
Order is described instruction and is comprised that looping discription instruction, branch describe instruction.For example, create fast 10000 files if wish by the limbs attitude, the filename of the file that creates is natural number to be arranged, and can limit the input instruction that creates file with the looping discription instruction, and the file name parameter that each circulation time will create in the input instruction of file adds 1.Added sequentially instruction is described after, the user carries out a plurality of input instructions when the mapping relations of configuration steering order and input instruction according to the order of appointment, facilitate the user to be configured, and simultaneously, has also expanded input instruction corresponding to steering order.
As shown in figure 12, in one embodiment, the image that image capture module 10 collects is two dimensional image, and gesture recognition module 20 comprises the first image processing module 202 and the first attitude generation module 204, wherein:
The first image processing module 202 is used for extracting image and the pixel that default color model mates, and the pixel of obtaining is carried out connected domain detect, and extracts the marked region that detects in the connected domain that obtains.
Concrete, image capture module 10 can be video camera, and its image that collects can be the two-dimensional visible light image.Preferably, also can add infrared fileter before the camera lens of video camera, be used for elimination except other wave band light of infrared band, the image of image capture module 10 collections is the two-dimensional infrared image.In visible images, the object in scene can form the identification of marked region and disturb, and infrared image has been because having filtered out visible light information, disturbs lessly, so the two-dimensional infrared image more is conducive to extract marked region.
Concrete, the first image processing module 202 is used for setting up in advance color model.For example the color of marked region is red, sets up in advance red model, and in this model, the rgb value component of pixel can be between 200 to 255, and G, B component can be close to zero; The first 202 of image processing modules are used for obtaining the pixel that two field picture satisfies the rgb value of this redness model and are red pixel.In addition, when forming marked region by human body in the image that gathers, the first 202 of image processing modules are for obtaining the pixel of image with default complexion model coupling.The first image processing module 202 is used for that also the pixel of obtaining is carried out connected domain and detects, and obtains a plurality of connected domains, if connected domain is the set that individual continuous pixel forms.
In the present embodiment, because the size and shape of marked region should be roughly changeless, the first image processing module 202 is carrying out connected domain when detecting to the pixel of obtaining, can calculate girth and/or the area of all connected domains in the pixel of obtaining.Concrete, the girth of connected domain can be the number of connected domain boundary pixel, and the area of connected domain can be the number of the whole pixels in connected domain.Further, the first image processing module 202 can be used for the girth of the connected domain that will obtain and/or girth and/or the area of area and default marked region compares, and obtains the girth that satisfies default marked region and/or the connected domain of area and is marked region.Preferably, the first image processing module 202 also can be used for girth square with the ratio of area as judgment criterion, this ratio of connected domain satisfies this ratio of default marked region, this connected domain is marked region.
The first attitude generation module 204 is used for obtaining the pixel coordinate of marked region, produces the attitude of marked region according to this pixel coordinate.
In the present embodiment, the attitude that marked region produces is attitude angle.In one embodiment, marked region is a continuum, the first attitude generation module 204 is used for calculating the covariance matrix of pixel coordinate, obtain covariance matrix eigenvalue of maximum characteristic of correspondence vector, produce the attitude of marked region according to proper vector, the attitude of this marked region is an attitude angle.
In another embodiment, marked region comprises the first continuum and the second continuum, the first attitude generation module 204 is used for calculating the center of gravity of the first continuum and the center of gravity of the second continuum according to pixel coordinate, calculates the attitude of marked region according to the pixel coordinate of the center of gravity of the pixel coordinate of the center of gravity of the first continuum and the second continuum.Concrete, calculate the mean value of the whole pixel coordinates in the continuum, resulting pixel coordinate is the center of gravity of continuum.
In another embodiment, the image that collects of image capture module 10 is 3-D view.Concrete, image capture module 10 can adopt traditional stereo visual system (being comprised of two known video camera and related softwares in control position), structured-light system (a right video camera, light source and related software form) or TOF (time of flight, flight time) depth camera to realize collection 3-D view (being the three dimensional depth image).
In the present embodiment, as shown in figure 13, gesture recognition module 20 comprises the second image processing module 210 and the second attitude generation module 220, wherein:
The second image processing module 210 is used for described Image Segmentation Using, extract the connected domain in image, and the property value of calculating connected domain, the property value of connected domain and default marked region property value are compared, and described marked region is the connected domain that meets described default marked region property value.
Concrete, the second image processing module 210 is used for when two adjacent pixel depths of 3-D view differ less than predefined threshold value, for example 5 centimetres, thinks that two pixels are communicated with, whole image is carried out connected domain detect, can obtain comprising a series of connected domains of mark connected domain.
In the present embodiment, the property value of connected domain comprises the size and dimension of connected domain.Concrete, the second image processing module 210 is used for calculating the size/shape of connected domain, compares with the size/shape of mark on interactive device, and the connected domain that obtains meeting the size/shape of mark is the connected domain (marked region) of marked region.Take rectangle marked as example, be to be rectangle in the image that is marked at collection on interactive device, the length of pre-set mark and width, the second 210 of image processing modules are used for calculating length and the width of physical region corresponding to connected domain, length and the width of this length and width and mark are more approaching, and connected domain is more similar to marked region.
Further, the second image processing module 210 is as follows for the process of the length of calculating physical region corresponding to connected domain and width: calculate the covariance matrix of the three-dimensional coordinate of connected domain pixel, adopt following formula to calculate length and the width of physical region corresponding to connected domain:
Wherein, k is predefined coefficient, for example is made as 4, and when λ was the covariance matrix eigenvalue of maximum, l was the length of connected domain, and when λ was the second largest eigenwert of covariance matrix, l was the width of connected domain.
Further, the second
image processing module 210 also can be used for presetting the length breadth ratio of rectangle marked, for example length breadth ratio is 2, the length breadth ratio of physical region corresponding to connected domain is more close to the length breadth ratio of the rectangle marked of default settings, connected domain is more similar to marked region, concrete, attribute matching module 234 is used for adopting following formula to calculate the length breadth ratio of physical region corresponding to connected domain:
Wherein, r is the length breadth ratio of connected domain, λ
0Be the eigenvalue of maximum of covariance matrix, λ
1Second Largest Eigenvalue for covariance matrix.
The second attitude generation module 220 is used for obtaining the pixel coordinate of marked region, produces the attitude of marked region according to described pixel coordinate.
In the present embodiment, the attitude of marked region is the attitude vector.In one embodiment, marked region is a continuum, the second attitude generation module 220 is used for calculating the covariance matrix of pixel coordinate, obtains covariance matrix eigenvalue of maximum characteristic of correspondence vector, produces the attitude of marked region according to proper vector.As mentioned above, the attitude of this marked region is an attitude vector.
In another embodiment, marked region comprises the first continuum and the second continuum, the second attitude generation module 220 is used for calculating the center of gravity of the first continuum and the center of gravity of the second continuum according to pixel coordinate, produces the attitude of marked region according to the pixel coordinate of the center of gravity of the pixel coordinate of the center of gravity of the first continuum and the second continuum.In the present embodiment, the pixel coordinate in marked region is three-dimensional coordinate, and is concrete, can produce the attitude of marked region according to the pixel coordinate of the center of gravity of two continuums that calculate, and this attitude is an attitude vector.
In one embodiment, gesture recognition module 20 also comprises the judge module (not shown), and the image that is used for the judgement collection is two dimensional image or 3-D view.Concrete, in the present embodiment, when the image that determines collection when judge module is two dimensional image, the marked region of notifying the first image processing module 202 to extract in two dimensional images, and then produce the attitude of these marked regions by the first attitude generation module 204.When the image that determines collection when judge module is two dimensional image, the marked region of notifying the second image processing module 210 to extract in 3-D views, and then produce the attitude of these marked regions by the second attitude generation module 220.Understandable, in the present embodiment, gesture recognition module 20 comprises judge module (not shown), the first image processing module 202, the first attitude generation module 204, the second image processing module 210 and the second attitude generation module 220 simultaneously.The present embodiment both can by the attitude in two dimensional image identification marking zone, can pass through again the attitude in two dimensional image identification marking zone.
As shown in figure 14, in one embodiment, instruction generation module 30 comprises that the first attitude acquisition module 302 and the first instruction search module 304, wherein:
The first attitude acquisition module 302 is used for obtaining from gesture recognition module 20 attitude of the described marked region current frame image.
Concrete, this attitude can be the attitude angle of the marked region in the two dimensional image of present frame, can be also the attitude vector of the marked region in the three dimensional depth image of present frame.In the present embodiment, the mapping relations between attitude and steering order have been preset.This attitude also can be described as absolute attitude.
The first instruction is searched module 304 and is used for the steering order corresponding with described attitude with the mapping relations generation between steering order according to default attitude.
In the present embodiment, the image that comprises marked region that gathers can be image sequence.The first attitude acquisition module 302 is also for the relative attitude between the attitude of the attitude of obtaining the marked region current frame image from gesture recognition module 20 and the marked region in the previous frame image.The first instruction is searched module 304 and also is used for the steering order corresponding with relative attitude with the mapping relations generation between steering order according to default relative attitude.
In another embodiment, the image that comprises marked region that gathers can be image sequence.As shown in figure 15, instruction generation module 30 comprises that the second attitude acquisition module 310 and the second instruction search module 320, wherein:
The second attitude acquisition module is for the relative attitude between the attitude of the attitude of obtaining the marked region current frame image from gesture recognition module 20 and the marked region in the previous frame image.
The second instruction is searched module 320 and is used for the steering order corresponding with relative attitude with the mapping relations generation between steering order according to default relative attitude.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.Should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.