Line drawing method, line drawing apparatus, electronic device, and computer readable storage medium
AssigneeShenzhen Hitevision Technology Co., Ltd.
InventorsLisen Zhu, Hongwei Sun, Peiqi Zhang
Life of this patent
Estimating the term…
Abstract
The embodiments of the present application disclose a line drawing method, a line drawing apparatus, a device, and a storage medium. Under a condition that at least one of an abscissa transformation value and an ordinate transformation value is not less than a first set threshold, a corresponding line is drawn according to an association relationship among the abscissa transformation value, the ordinate transformation value, a preconfigured transformation value coefficient, and a transformation value threshold.
Claims15
A line drawing method, comprising:
- acquiring a first frame image in an image sequence, wherein the first frame image comprises a hand of a user;
- determining, according to feature information of the hand, a first position coordinate of the hand in the first frame image;
- transforming a difference between the first position coordinate and a second position coordinate to obtain an abscissa transformation value and an ordinate transformation value corresponding to the difference on a screen of an electronic device, wherein the second position coordinate is a position coordinate of the hand in a second frame image, and the second frame image is an image before the of the first frame image in the image sequence;
- and
- drawing, under a condition that at least one of the abscissa transformation value and the ordinate transformation value is not less than a first set threshold, a corresponding line according to an association relationship among the abscissa transformation value, the ordinate transformation value, a preconfigured transformation value coefficient, and a transformation value threshold,
- wherein the method further comprises:
- under a condition that both the abscissa transformation value and the ordinate transformation value are less than a first set threshold, accumulating the abscissa transformation value with a preconfigured initial abscissa value to obtain an accumulated abscissa value, and accumulating the ordinate transformation value with a preconfigured initial ordinate value to obtain an accumulated ordinate value;
- and
- drawing, under a condition that at least one of the accumulated abscissa value and the accumulated ordinate value is greater than a sixth set threshold, a straight line of a target length starting from an end of an initial line, wherein the initial line is a line drawn according to an image before the first frame image in the image sequence, and the target length corresponds to the accumulated abscissa value or the accumulated ordinate value.
An electronic device, comprising:
- a camera module configured to acquire an image;
- a display screen configured to display a line;
- a processor;
- a memory for storing computer program instructions, wherein the computer program instructions, when executed by the processor, implement operations comprising:
- acquiring a first frame image in an image sequence, wherein the first frame image comprises a hand of a user;
- determining, according to feature information of the hand, a first position coordinate of the hand in the first frame image;
- transforming a difference between the first position coordinate and a second position coordinate to obtain an abscissa transformation value and an ordinate transformation value corresponding to the difference on a screen of an electronic device, wherein the second position coordinate is a position coordinate of the hand in a second frame image, and the second frame image is an image before the of the first frame image in the image sequence;
- and
- drawing, under a condition that at least one of the abscissa transformation value and the ordinate transformation value is not less than a first set threshold, a corresponding line according to an association relationship among the abscissa transformation value, the ordinate transformation value, a preconfigured transformation value coefficient, and a transformation value threshold,
- wherein the operations further comprise:
- under a condition that both the abscissa transformation value and the ordinate transformation value are less than a first set threshold, accumulating the abscissa transformation value with a preconfigured initial abscissa value to obtain an accumulated abscissa value, and accumulating the ordinate transformation value with a preconfigured initial ordinate value to obtain an accumulated ordinate value;
- and
- drawing, under a condition that at least one of the accumulated abscissa value and the accumulated ordinate value is greater than a sixth set threshold, a straight line of a target length starting from an end of an initial line, wherein the initial line is a line drawn according to an image before the first frame image in the image sequence, and the target length corresponds to the accumulated abscissa value or the accumulated ordinate value.
Dependencies are inferred from the claim text.