This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2011-171744, filed on Aug. 5, 2011; the entire contents of which are incorporated herein by reference.
Embodiments described herein relate generally to a command issuing apparatus, a command issuing method, and a computer program product.
There has been known a command issuing apparatus that issues a command according to a motion of a specific region (e.g., a hand) of a user. In such a command issuing apparatus there has been known a technique in which, when the current moving speed of the specific region exceeds a reference speed, the command issuing apparatus detects that the current motion of the specific region is a fast motion, and determines whether or not the current state of the specific region is a feeding action for issuing a predetermined command, from the relationship between the fast motion and a fast motion detected immediately before the current fast motion.
However, when an action (returning action) of moving the specific region in the direction reverse to the direction of the feeding action in which the user's hand moves in a predetermined direction so as to return the specific region to the original position is detected as the fast motion, a new command might be issued according to the returning action in the above-mentioned technique.
According to an embodiment, a command issuing apparatus includes an acquiring unit configured to acquire an image obtained by capturing a subject; a detector configured to detect a specific region of the subject from the image; a first setting unit configured to set a specific position indicating a position of the specific region; a second setting unit configured to set a reference position indicating a position that is to be a reference in the image; a first calculator configured to calculate a position vector directing toward the specific position from the reference position; a second calculator configured to calculate, for each of a plurality of command vectors respectively corresponding to predetermined commands, a first parameter indicating a degree of coincidence between the command vector and the position vector; and an issuing unit configured to issue the command based the first parameter.
Various embodiments will be described below with reference to the accompanying drawings.
The acquiring unit 10 sequentially acquires an image (each image is referred to as a “frame”) captured by an unillustrated imaging device at a predetermined interval (frame cycle). The imaging device can be configured by a CMOS image sensor, an infrared image sensor, a range image sensor, or a moving-image reproducing device, for example.
The detector 11 executes a detecting process for detecting a specific region of a subject (e.g., a user) from the frame acquired by the acquiring unit 10. The specific region is preferably detected, every time the frame is acquired. However, the specific region may be detected at regular intervals according to the processing capacity of the apparatus. In the first embodiment, a user's hand is employed as the specific region. However, the embodiment is not limited thereto. Any specific region may be set. For example, at least a part of a body of the user, such as a hand or leg, can be employed as the specific region. An object, whose pattern image is preliminarily registered, such as a controller that can be operated in air, or colored ball, can be employed as the specific region. Any method can be employed as the method of detecting the specific region, and various known techniques can be used. For example, a pattern recognition method, a background differencing technique, a skin-color detection method, or an inter-frame differential method, or a combination of these methods can be used.
The first setting unit 12 sets a specific position indicating a position of the detected specific region, every time the detector 11 detects the specific region. For example, the first setting unit 12 in the first embodiment sets a coordinate at the center of the specific region in the frame detected by the detector 11 as the specific position.
Every time the detector 11 detects the specific region, the second setting unit 13 sets a reference position indicating a position that is to be a reference in the current frame. In the first embodiment, a position of a user's shoulder is employed as the reference position. The second setting unit 13 detects the position of a user's face from the frame acquired by the acquiring unit 10, and specifies the position of the shoulder based upon the detected face position. The second setting unit 13 then sets the specified shoulder position as the reference position. Any method may be used as the method of detecting the user's face position and the method of detecting the user's shoulder position, and various known techniques can be employed.
Although the user's shoulder position is set as the reference position in the first embodiment, the embodiment is not limited thereto. Any reference position can be set. For example, a predetermined camera coordinate or a world coordinate can also be employed as the reference position. At least a part of a user's body, such as a hand or leg, can also be employed as the reference position. A position of an object, whose pattern image is preliminarily registered, such as a controller that can be operated in air, or colored ball, can be employed as the reference position. The position of the region where the specific region (e.g., user's hand) is first detected in the frame can also be employed as the reference position.
The first calculator 14 calculates a position vector directing toward the specific position from the reference position. More specifically, the first calculator 14 calculates a position vector by using the reference position and the specific position in the current frame, every time the detector 11 detects the specific region. For example, when a frame illustrated in
For each of a plurality of command vectors respectively corresponding to predetermined commands, the second calculator 15 calculates a first parameter indicating a degree of coincidence between the command vector and the position vector calculated by the first calculator 14. For example, an inner product of the command vector and the position vector is employed as the first parameter in the first embodiment, and therefore, the first parameter has a greater value, as the degree of coincidence between the command vector and the position vector is higher. However, the embodiment is not limited thereto. The first parameter may be any value, so long as it indicates the degree of coincidence between the command vector and the position vector. Every time the detector 11 detects the specific region, the second calculator 15 in the first embodiment calculates the first parameter of each command vector. In
Any method may be employed as the method of calculating the first parameter. For example, the first parameter can be calculated by using a non-linear function such as formula (1) below. Specifically, in this formula, if a distance x between the specific position and the reference position falls within a predetermined range c, the first parameter is set to be b that is a sufficiently low value, while if the distance x exceeds the predetermined range c, the first parameter is set to be a that is a sufficiently high value. In this case, the user can easily find at which position the specific region is to be present as viewed from the reference position in order to set the first parameter of the command vector, corresponding to the command that the user intends to issue, to have a sufficiently large value.
Ppos=a if x>c
Ppos=b otherwise (1)
In formula (1), Ppos indicates the first parameter.
The function for calculating the first parameter of each command vector may be a linear function. For example, the relationship between the distance x between the specific position and the reference position and the first parameter may be represented by a linear function. In this case, the value of the first parameter is proportional to the distance x. Alternatively, the relationship between the first parameter and the distance x may be represented by a linear function such as quadratic function, sigmoid function, exponential function, logarithm function, or kernel function (e.g., Gaussian kernel). In this case, as the distance x becomes larger, the value of the first parameter becomes larger, and further, the increasing rate becomes smoother. Therefore, compared to the case where the first parameter is obtained by using the non-linear function such as formula (1), the first parameter can be set to a value according to an intention of the user. For example, the relationship between the first parameter and the distance x can be represented by formula (2) below. Formula (2) is a combination of the functions described above.
Ppos=axd if x>c
Ppos=bxe otherwise (2)
For example, the relationship between the first parameter and the distance x can be represented by formula (3) below. Formula (3) is expressed by a non-linear function in which, as the value becomes larger in proportion to the distance x, and when the distance x becomes equal to or larger than a predetermined value, the increasing rate of the first parameter is changed.
Ppos=a log(dx) if x>c
Ppos=b log(ex) otherwise (3)
The first storage unit 16 illustrated in
The fourth calculator 18 calculates a second parameter indicating a degree of coincidence between the command vector and the motion vector calculated by the third calculator 17 for each command vector. For example, in the first embodiment, an inner product of the command vector and the motion vector is employed as the second parameter, and therefore, as the degree of coincidence between the command vector and the motion vector is higher, the second parameter has a larger value. The embodiment is not limited thereto. The second parameter may be any value, so long as it indicates the degree of coincidence between the command vector and the motion vector. Every time the detector 11 detects the specific region, the fourth calculator 18 in the first embodiment calculates the second parameter of each command vector in the current frame. In
The fifth calculator 19 illustrated in
Alternatively, for example, the value obtained by multiplying the first parameter and the second parameter can be used as the third parameter. In this case, the third parameter of the command vector has a large value only when the degree of coincidence between the command vector and the position vector is high and the degree of the coincidence between the command vector and the motion vector is high. Still alternatively, the smaller one of the first parameter and the second parameter can be calculated as the third parameter. Furthermore, the value obtained by combining the sum of the first parameter and the second parameter and the product of the first parameter and the second parameter can be calculated as the third parameter. In this case, if the second parameter, which indicates the degree of coincidence between the command vector corresponding to a predetermined command and the motion vector, has a large value due to the execution of the operation of issuing the predetermined command, the value of the third parameter of the command vector can be increased even if the specific position is near the reference position or the specific position is apart from the reference position.
The issuing unit 20 issues a command based upon the third parameter calculated by the fifth calculator 19. More specifically, when the value of the third parameter of each of the command vectors is equal to or larger than a threshold value, the issuing unit 20 issues a command corresponding to the command vector. The threshold value can be set to any value. In
It is supposed here that the user makes a returning action (the action of moving his/her hand in the direction reverse to the direction of the command vector Vd1 to return his/her hand to the original position) from the state in
Since the direction of the motion vector Vm2 in the frame in
Next, one example of a process operation performed by the command issuing apparatus 100 according to the first embodiment will be described.
After step S4, the first calculator 14 calculates the position vector in the frame acquired in step Si (step S5). Then, the second calculator 15 calculates the first parameter, indicating the degree of coincidence between the command vector and the position vector calculated in step S5, for each command vector (step S6).
After step S4, the third calculator 17 calculates a motion vector in the frame acquired in step Si from the specific position specified in step S3 and the previous specific position stored in the first storage unit 16 (step S7). The fourth calculator 18 calculates the second parameter, indicating the degree of coincidence between the command vector and the motion vector calculated in step S7, for each command vector (step S8).
Next, the fifth calculator 19 calculates the third parameter based upon the first parameter and the second parameter of the command vector for each command vector (step S9). As described above, in the first embodiment, the third parameter is calculated by adding up the first parameter and the second parameter of the command vector for each command vector. Then, the issuing unit 20 determines whether the third parameter calculated in step S9 is equal to or larger than a threshold value or not (step S10). More specifically, the issuing unit 20 determines for each command vector whether the value of the third parameter (the third parameter calculated in step S9) of the command vector is equal to or larger than the threshold value or not. When the value of the third parameter calculated in step S9 is equal to or larger than the threshold value (the result of step S10: YES), the issuing unit 20 issues a command corresponding to the command vector (step S11).
As described above, in the first embodiment, the third parameter represented by the sum of the first parameter, indicating the degree of coincidence between the command vector and the position vector, and the second parameter, indicating the degree of coincidence between the command vector and the motion vector, is calculated for each command vector, and a command is issued based upon the calculated third parameter. Therefore, when the degree of coincidence between the command vector and the position vector is low even if the degree of coincidence between the command vector and the motion vector is high, the command corresponding to the command vector is difficult to be issued. For example, when the user moves his/her hand in the direction of the command vector corresponding to a predetermined command so as to issue the predetermined command, and then, makes a returning action of returning his/her hand to the original position, the user's hand moves in the direction reverse to the direction of the command vector. With this, the degree of coincidence between the motion vector and the command vector in the direction reverse to the direction of the target command vector becomes high, however; if the degree of coincidence between the command vector in the direction reverse to the direction of the target command vector and the position vector is low, the command corresponding to the command vector in the direction reverse to the direction of the target command vector is difficult to be issued. Accordingly, the first embodiment can distinguish the feeding action from the action other than the feeding action, such as the returning action and preliminary action, thereby being capable of issuing a command on which the user's intention is reflected.
A second embodiment will next be described. The second embodiment is different from the first embodiment in that the third parameter calculated by the fifth calculator 19 is corrected based upon the previous third parameter. The same components as those in the first embodiment are identified by the same numerals and the description thereof will not be repeated.
Every time the third parameter is calculated by the fifth calculator 19, the first corrector 22 corrects the calculated third parameter by using the previous third parameters (a history of the third parameter) stored in the second storage unit 21. For example, when the third parameter is calculated by the fifth calculator 19, the first corrector 22 can correct the calculated third parameter by obtaining an average of the calculated third parameter and at least one of the third parameters (the previous third parameters stored in the second storage unit 21) during a predetermined period in the past, or by multiplying the calculated third parameter by at least one of the third parameters. This process can prevent the third parameter from having an unintentional value due to a detection error in the specific region or the reference position.
When the third parameter is calculated by the fifth calculator 19, the first corrector 22 adds a bias value according to the previous third parameters stored in the second storage unit 21 to the calculated third parameter. The calculated third parameter can also be corrected by adding the bias value. For example, when the value of the third parameter of a specific command vector has the highest value in a predetermined period in the past, the bias value by which the value of the third parameter of the specific command vector increases can be added to the third parameter calculated by the fifth calculator 19. With this process, the command corresponding to the specific command vector is easy to be issued. Specifically, it is easy for even a small hand waving action or a hand waving action near the reference position to issue the command corresponding to the specific command vector, whereby the user can more easily make a continuous scroll motion.
For example, the user moves his/her hand near the reference position to make the returning action, whereby the inner product between the position vector and the command vector in the direction reverse to the direction of the specific command vector is changed to a plus value. Even if the value of the first parameter of the command vector in the reverse direction is changed to a plus value, a bias value by which the value of the third parameter of the specific command vector increases is added to the calculated value of the third parameter of the command vector in the reverse direction. Specifically, the third parameter of each of the command vectors other than the command vector corresponding, to the specific command is corrected (is suppressed to be low) in order to prevent the third parameter from having a value equal to or larger than the threshold value, which prevents the returning action from being erroneously recognized as the command in the reverse direction.
A third embodiment will next be described. The third embodiment is different from the first embodiment in that the third parameter calculated by the fifth calculator 19 is corrected based upon the history of the commands issued in the past. The same components as those in the first embodiment are identified by the same numerals and the description will not be repeated.
Every time the third parameter is calculated by the fifth calculator 19, the second corrector 24 corrects the calculated third parameter by using the previous commands (a history of the commands) stored in the third storage unit 23. More specifically, when the third parameter is calculated by the fifth calculator 19, the second corrector 24 can correct the calculated third parameter in such a manner that the value of the third parameter of the command vector corresponding to the commands issued in the past increases. For example, the second corrector 24 adds, to the third parameter calculated by the fifth calculator 19, a bias value by which the value of the third parameter of the command vector corresponding to the command that is last issued increase, thereby being capable of correcting the calculated third parameter. Alternatively, the second corrector 24 adds, to the third parameter calculated by the fifth calculator 19, a bias value by which the value of the third parameter of each of the command vectors other than the command vector corresponding to the command that is last issued decrease, thereby being capable of correcting the calculated third parameter.
From the above, if a specific command is issued first in the case where the specific command is repeatedly issued, for example, the specific command is easy to be issued afterwards. Specifically, it is easy for even a small hand waving action or a hand waving action near the reference position to issue the specific command, whereby a continuous scroll motion can more easily be made.
For example, even when the user moves his/her hand near the reference position to make the returning action, whereby the inner product between the position vector and the command vector in the direction reverse to the direction of the specific command vector is changed to a plus value, a bias value by which the value of the third parameter of the command vector corresponding to the specific command (the command that is issued last) increases is added to the calculated value of the third parameter of the command vector in the reverse direction. Specifically, the third parameter of each of the command vectors other than the command vector corresponding to the specific command is corrected (is suppressed to be low) in order to prevent the third parameter from having a value equal to or larger than the threshold value, which prevents the returning action from being erroneously recognized as the command in the reverse direction.
Alternatively, the second corrector 24 adds a bias value according to the number of issuances of each command during the predetermined period in the past to the third parameter calculated by the fifth calculator 19, thereby being capable of correcting the calculated third parameter. For example, the second corrector 24 adds, to the third parameter calculated by the fifth calculator 19, a bias value by which the value of the third parameter of the command vector, corresponding to the command that is issued most during the predetermined period in the past, increase, thereby being capable of correcting the calculated third parameter. Still alternatively, the second corrector 24 adds, to the third parameter calculated by the fifth calculator 19, a bias value by which the value of the third parameter of each of the command vectors other than the command vector corresponding to the command that is issued most during the predetermined period in the past decreases, thereby being capable of correcting the calculated third parameter. With this process, the command that is issued many times is easy to be issued, while the other commands are difficult to be issued. Accordingly, when a specific command is repeatedly issued, for example, the specific command is easy to be issued (because this command is issued many times), while another command corresponding to the command vector in the direction reverse to the direction of the command vector of the specific command due to the returning action of the user is difficult to be issued.
The flowchart illustrating an example of the process operation performed by the command issuing apparatus 300 according to the third embodiment is the same as that illustrated in
The fourth embodiment will next be described. The fourth embodiment is different from the first embodiment in that an input state of a command according to the third parameter calculated by the fifth calculator 19 is displayed. The same components as those in the first embodiment are identified by the same numerals and the description will not be repeated in some cases.
Any method may be employed as the method of displaying the command input state. For example, a gauge may be increased or decreased according to the value of the third parameter as illustrated in
A display method illustrated in
Alternatively, a display method in which a cursor K displayed on the screen moves in a specific direction according to the input state of the command as illustrated in
The fourth embodiment described above can be combined with the second embodiment, or with the third embodiment. Specifically, the command issuing apparatus in each of the second and third embodiments can be provided with the display controller 25 described above.
Modifications
The embodiments described above have been presented by way of example only, and are not intended to limit the scope of the invention. Indeed, the novel embodiments may be embodied in a variety of other forms, and furthermore, a variety of omissions, substitutions, and changes in the form of the embodiments described herein may be made without departing from the scope of the present invention. The accompanying claims and their equivalents are intended to include such forms and modifications as would fall within the scope and spirit of the present invention. The modifications will be described below. Two or more of the following modifications may arbitrarily be combined.
(1) Modification 1
The type of the commands described above is arbitrary. For example, the command may be a feeding command for moving a cursor in a specific direction, or a feeding command for scrolling a screen in a specific direction. The command may also be the one for determining a specific selection item, or the one for canceling the specific selection item. The command may also be the one for executing a specific function such as audio or video playback. The command may also be the one for starting an application managing a multimedia, a television, or a TV program.
(2) Modification 2
In the third embodiment described above, the second corrector 24 corrects the calculated value of the third parameter by adding the bias value, by which the value of the third parameter of the command vector corresponding to the command (the command that is last issued, or the command that is issued most) issued in the past, to the third parameter calculated by the fifth calculator 19. Alternatively, the second corrector 24 can change the reference position in order that the value of the third parameter of the command vector corresponding to the command issued in the past increases. When the correction is to be made such that the value of the third parameter of the command vector Vd1 in FIG. 2 increases, for example, the second corrector 24 can shift the reference position in the direction reverse to the direction of the command vector Vd1. With this process, the position vector on the specific position with respect to the reference position increases more than that before the correction. Therefore, the value of the first parameter indicating the degree of coincidence between the command vector Vd1 and the position vector increases, whereby the value of the third parameter of the command vector Vd1 also increases. On the other hand, as for the command vector Vd2 in the direction reverse to the direction of the command vector Vd1, the value of the first parameter indicating the degree of the coincidence between the command vector Vd2 and the position vector decreases more than that before the correction, so that the value of the third parameter of the command vector Vd2 decreases.
(3) Modification 3
As illustrated in
Any value can be set as the correction value. For example, the area value of the specific region detected by the detector 11 can be set as the correction value. The area value of a predetermined region including the reference position set by the second setting unit 13 can also be set as the correction value, for example. When the shoulder position of the user in the frame is set as the reference position, the area value of the region including the shoulder width can be set as the correction value. When the face position of the user in the frame (e.g., the center coordinate in the face region) is set as the reference position, the area value of the user's face region can be set as the correction value.
For example, the correction value may also be set variable according to the area value of the specific region detected by the detector 11 and the shape of the specific region. More specifically, the area value of the specific region is corrected according to the shape of the specific region detected by the detector 11, and the corrected area value can be set as the correction value. For example, when the specific region is a user's hand, and the detected hand is an open hand (the palm is visible), the area value of the specific region may be corrected to be larger than the actual value (the correction value may be set to be large). When the detected hand is a first (the hand is closed), the area value of the specific region may be corrected to be smaller than the actual value (the correction value may be set to be small). This process can prevent the calculated third parameter from having a different value according to the current shape of the hand, when the user makes the same operation. Similarly, the correction value may be set variable according to the area value of the predetermined region including the reference position set by the second setting unit 13 and the shape of this region.
(4) Modification 4
For example, it may be configured such that the command is issued only based upon the degree of coincidence between the command vector and the position vector without considering the degree of the coincidence between the command vector and the motion vector.
Hardware Configuration and Program
The command issuing apparatus of each of the above-mentioned embodiments and modifications includes a control device such as a CPU (Central Processing Unit), a storage device such as ROM or RAM, an external storage device such as HDD or SSD, a display device such as a display, an input device such as a mouse or keyboard, and a communication device such as a communication I/F, which means the command issuing apparatus has a general hardware configuration utilizing a computer. The CPU of the command issuing apparatus develops and executes a program, stored in the ROM, on the RAM, whereby the functions of the acquiring unit 10, the detector 11, the first setting unit 12, the second setting unit 13, the first calculator 14, the second calculator 15, the third calculator 17, the fourth calculator 18, the fifth calculator 19, the issuing unit 20, the first corrector 22, the second corrector 24, the display controller 25, and the third corrector 26 can be realized. The invention is not limited thereto. At least some of these functions can be realized by an individual circuit (hardware). The first storage unit 16, the second storage unit 21, and the third storage unit 23 are elements realized by the hardware, and included in the storage device or in the external storage device.
A program executed in the command issuing apparatus in each of the embodiments and modifications may be stored on a computer connected to the network such as the Internet, and provided as being downloaded through the network. The program executed in the command issuing apparatus in each of the embodiments and modifications may be provided or distributed through the network such as the Internet. The program executed in the command issuing apparatus in each of the embodiments and modifications may be provided as being installed on the ROM beforehand. So long as the command issuing apparatus according to each of the embodiments described above includes a control device such as a CPU and a storage device, and processes an image acquired from an imaging device, it can be applied not only to a PC (Personal Computer) but also to a TV.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
Number | Date | Country | Kind |
---|---|---|---|
2011-171744 | Aug 2011 | JP | national |