CN107450840B - Method and device for determining finger touch connected domain and electronic equipment - Google Patents

Method and device for determining finger touch connected domain and electronic equipment Download PDF

Info

Publication number
CN107450840B
CN107450840B CN201710661233.XA CN201710661233A CN107450840B CN 107450840 B CN107450840 B CN 107450840B CN 201710661233 A CN201710661233 A CN 201710661233A CN 107450840 B CN107450840 B CN 107450840B
Authority
CN
China
Prior art keywords
pixel
pixels
value
connected domain
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710661233.XA
Other languages
Chinese (zh)
Other versions
CN107450840A (en
Inventor
陈维亮
董碧峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201710661233.XA priority Critical patent/CN107450840B/en
Publication of CN107450840A publication Critical patent/CN107450840A/en
Application granted granted Critical
Publication of CN107450840B publication Critical patent/CN107450840B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)
  • Position Input By Displaying (AREA)

Abstract

The embodiment of the invention provides a method and a device for determining a finger touch connected domain and electronic equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining the number of pixels of connected domains in a binary image, comparing the number of pixels contained in each connected domain with a first number threshold value, wherein the first number threshold value is determined by the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion, and simultaneously comparing the number of pixels contained in each connected domain with a second number threshold value, wherein the second number threshold value is determined by a preset finger touch area. And determining the connected domain which passes the two comparisons as the connected domain corresponding to the finger touch. The connected domains generated by finger touch and non-finger touch can be accurately distinguished through the two comparison processes, and the accuracy of finger touch operation identification is improved.

Description

Method and device for determining finger touch connected domain and electronic equipment
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a device for determining a finger touch connected domain and electronic equipment.
Background
Controlling an operation object in a touch manner to realize various functions of the operation object has become a mainstream control manner, and specific touch manners generally include clicking, dragging, stretching, and the like. The user can send an operation instruction to an operation interface of the electronic device in a finger touch mode, so that the electronic device can accurately realize corresponding functions according to the operation instruction.
In practical applications, the electronic device usually responds to all operation instructions applied to the operation interface. In fact, only the operation instruction generated by finger touch is the effective operation instruction triggered by the user, and the operation instruction triggered by other modes may be only misoperation. In this case, the electronic device may respond to the invalid operation because the operation instruction generated by the finger touch cannot be accurately recognized.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for determining a finger touch connected domain, and an electronic device, which can improve accuracy of determining the finger touch connected domain and correspondingly improve accuracy of recognizing a finger touch operation.
The embodiment of the invention provides a method for determining a finger touch connected domain, which comprises the following steps:
acquiring the number of pixels of a connected domain in a binary image;
and screening the pixel quantity according to a first quantity threshold value and a second quantity threshold value, and determining a finger touch connected domain in the connected domain, wherein the first quantity threshold value is determined by the total number of pixels corresponding to a preset binarization value in the binarization image and a preset proportion, and the second quantity threshold value is determined by a preset finger touch area.
Optionally, the screening the number of pixels according to a first number threshold and a second number threshold to determine a finger touch connected domain in the connected domain includes:
screening out connected domains with the pixel number not less than a first number threshold value as first connected domains, wherein the first number threshold value is determined by the product of the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion.
Optionally, the screening the number of pixels according to a first number threshold and a second number threshold to determine a finger touch connected domain in the connected domain includes:
and if the number of the pixels of the first connected domain is not less than a second number threshold, determining that the first connected domain is a finger touch connected domain, wherein the second number threshold is determined by the ratio of the preset finger touch area to the preset pixel area.
Optionally, the acquiring the number of pixels of the connected component in the binarized image includes:
for a pixel traversed currently, if the pixel corresponds to a preset binary value, obtaining label values of a plurality of adjacent pixels around the pixel, wherein the adjacent pixels correspond to the preset binary value;
determining a label value of the pixel according to the label values of the plurality of adjacent pixels;
and if all the pixels in the binary image have been traversed, acquiring the pixel number of the pixels with the same mark value as the pixel number of the connected domain.
The embodiment of the invention provides a device for determining a finger touch connected domain, which comprises:
the first acquisition module is used for acquiring the number of pixels of a connected domain in a binary image;
and the determining module is used for screening the pixel quantity according to a first quantity threshold and a second quantity threshold and determining a finger touch connected domain in the connected domain, wherein the first quantity threshold is determined by the total number of pixels corresponding to a preset binarization value in the binarization image and a preset proportion, and the second quantity threshold is determined by a preset finger touch area.
Optionally, the determining module is specifically configured to: screening out connected domains with the pixel number not less than a first number threshold value as first connected domains, wherein the first number threshold value is determined by the product of the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion.
Optionally, the determining module is further specifically configured to: and if the number of the pixels of the first connected domain is not less than a second number threshold, determining that the first connected domain is a finger touch connected domain, wherein the second number threshold is determined by the ratio of the preset finger touch area to the preset pixel area.
Optionally, the first obtaining module specifically includes:
a first obtaining unit, configured to, for a currently traversed pixel, obtain label values of a plurality of adjacent pixels around the pixel if the pixel corresponds to a preset binarization value, where the adjacent pixels correspond to the preset binarization value;
a determination unit configured to determine a flag value of the pixel from flag values of the plurality of adjacent pixels;
and the second acquisition unit is used for acquiring the pixel number of the pixels with the same mark value as the pixel number of the connected domain if all the pixels in the binary image have been traversed.
An embodiment of the present invention provides an electronic device, including: a memory, and a processor coupled to the memory;
the memory to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor to execute the one or more computer instructions to implement the method of any of claims 1-4.
According to the method, the device and the electronic equipment for determining the finger touch connected domain, firstly, the number of pixels of the connected domain in the binary image is obtained, and then the number of pixels contained in the connected domain is compared with a first number threshold value, wherein the first number threshold value is determined by the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion. In the binarized images with different sizes, the number of pixels of the connected domain corresponding to the noise is different, which results in that the total number of pixels corresponding to the preset binarized value in the binarized image is different, therefore, the first number threshold is substantially a relative threshold, and the binarized images with different sizes all have corresponding first number thresholds. Based on the above, the number of the pixels of the connected domain is compared with the first number threshold, so that the effects that the connected domain corresponding to the noise point and the connected domain corresponding to the non-noise point can be accurately distinguished for the binary image with any size can be achieved, and a cushion can be laid for accurately identifying the finger touch connected domain. When the number of the pixels of the connected domain is not less than the first number threshold, the connected domain is indicated to be a non-noise connected domain. The number of pixels contained in the connected component is compared to a second number threshold. Since the second number threshold is determined by the preset finger area, the size of the binarized image does not affect the preset finger touch area, and thus, the second number threshold is substantially an absolute threshold. When the number of pixels in the connected domain is smaller than the second number threshold, it is indicated that a certain difference exists between an area corresponding to the number of pixels in the connected domain and a preset finger touch area, and the connected domain is not a finger touch connected domain. Correspondingly, when the number of pixels in the connected component is not less than the second number threshold, it may be indicated that the connected component is the finger touch connected component. Based on the above description, the accuracy of determining the finger touch connected domain can be improved by using the first quantity threshold and the second quantity threshold in combination, and the accuracy of the finger touch operation is correspondingly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a first method for determining a finger touch connected domain according to an embodiment of the present invention;
fig. 2 is a flowchart of a second method for determining a finger touch connected domain according to an embodiment of the present invention;
fig. 3 is a flowchart of a third method for determining a finger touch connected domain according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a first apparatus for determining a finger touch connected domain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a second apparatus for determining a finger touch communicating area according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe XXX in embodiments of the present invention, these XXX should not be limited to these terms. These terms are only used to distinguish XXX from each other. For example, a first XXX may also be referred to as a second XXX, and similarly, a second XXX may also be referred to as a first XXX, without departing from the scope of embodiments of the present invention.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
Fig. 1 is a flowchart of a first method for determining a finger touch connected domain according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
s101, acquiring the number of pixels of a connected domain in the binary image.
After a user triggers finger touch operation in an operation interface, optionally, the finger touch operation may be one finger or multiple fingers, a corresponding depth image may be obtained based on the finger touch operation of the user, and then binarization processing is performed on the depth image to obtain a binarized image.
After the binarization processing, the binarization value corresponding to the pixel where the finger touch operation occurs is a, and the binarization value corresponding to the pixel where the finger touch operation does not occur is B, so that the pixel with the binarization value a is a pixel which needs to be concerned. The binary value may be any two different integers, and in general, a is 1 and B is 0.
The pixel number of the connected domain in the binary image can be obtained according to the binary value corresponding to each pixel in the binary image, wherein the connected domain is composed of a plurality of pixels with binary values of A, and each finger corresponds to one connected domain.
S102, screening the number of pixels according to the first number threshold and the second number threshold, and determining a finger touch connected domain in the connected domain.
In order to accurately identify whether the connected domain in the binarized image corresponds to finger touch, the obtained number of pixels of the connected domain needs to be compared with a first number threshold and a second number threshold, so as to determine the connected domain in which the number of pixels simultaneously satisfies the first number threshold and the second number threshold, and the determined connected domain is also the finger touch connected domain. For the connected domains with different pixel numbers and satisfying the first number threshold and the second number threshold, the connected domain is not the finger touch connected domain, and the connected domain may correspond to noise or other touch manners, and the connected domain corresponding to the noise may be generated when finger touch or other touch occurs.
The first number threshold may be determined by a total number of pixels corresponding to a preset binarization value in the binarized image and a preset ratio. The preset ratio can be generally set to any value between 0.1 and 0.3, and preferably, the preset ratio can be set to 0.2.
Optionally, the first number threshold is determined by a product of a total number of pixels corresponding to a preset binarization value in the binarized image and a preset proportion. And the preset binary value is a binary value corresponding to the pixel in the connected domain. For example, assume that the binarized values for pixels in the binarized image are A and B. In the embodiment of the present invention, a is a preset binary value. On the basis, the total number of pixels with the preset binarization value A in the binarized image can be obtained by counting the number of the pixels with the binarization value A in the binarized image. Determining the product of the total number of pixels and the preset proportion as a first quantity threshold value,
the second number threshold may be determined by a preset finger touch area. Since each pixel has a certain size, the area of the connected component is also closely related to the number of pixels contained in the connected component, and the larger the number of pixels contained in the connected component, the larger the area of the connected component.
Optionally, the second number threshold is determined by a ratio of the finger touch area to a preset pixel area. For example, in the embodiment of the present invention, the predetermined pixel area may be set to be, for example, 1mm2The touch area of the finger may be measured by taking the preset pixel area as a unit of measurement, and the finger pad area size of a general adult is taken as the finger touch area, and the finger touch area of the adult is generally considered to be 10mm by 10mm to 100mm2The second number threshold may be determined by the finger touch area and the preset pixel area. Alternatively, the second number threshold may be determined as a ratio of the touch area to a predetermined pixel area, such as 100mm2/1mm2100. In practical applications, the second number threshold can be set to any integer between 100 and 800 according to experimental data.
The comparison of the number of pixels in the connected component with the first number threshold and the second number threshold may be performed simultaneously or sequentially.
Optionally, if the two connected domains are compared simultaneously, a part of the connected domains with the number of pixels not less than the first number threshold and another part of the connected domains with the number of pixels not less than the second number threshold may be obtained, and the intersection of the two connected domains is the finger touch connected domain.
Optionally, if the sequential comparison is performed, a part of connected domains with the number of pixels not less than the first number threshold is obtained first. Whether the number of pixels of the partial connected component is not less than the second number threshold may be further compared to determine whether the partial connected component corresponds to a finger touch. And when the number of pixels of a certain part of connected domains is not less than a second number threshold, determining that the connected domains correspond to finger touch. When the number of pixels in the partial connected domain is smaller than the second number threshold, it is determined that the connected domain does not correspond to the finger touch, that is, the connected domain is generated by the non-finger touch, wherein the non-finger touch may be a stylus touch or a touch of another device.
In this embodiment, the number of pixels in a connected domain in the binarized image is obtained, and then, the number of pixels included in the connected domain is compared with a first number threshold, where the first number threshold is determined by a total number of pixels corresponding to a preset binarized value in the binarized image and a preset ratio. In the binarized images with different sizes, the number of pixels of the connected domain corresponding to the noise is different, which results in that the total number of pixels corresponding to the preset binarized value in the binarized image is different, therefore, the first number threshold is substantially a relative threshold, and the binarized images with different sizes all have corresponding first number thresholds. Based on the above, the number of the pixels of the connected domain is compared with the first number threshold, so that the effects that the connected domain corresponding to the noise point and the connected domain corresponding to the non-noise point can be accurately distinguished for the binary image with any size can be achieved, and a cushion can be laid for accurately identifying the finger touch connected domain. When the number of the pixels of the connected domain is not less than the first number threshold, the connected domain is indicated to be a non-noise connected domain. The number of pixels contained in the connected component is compared to a second number threshold. Since the second number threshold is determined by the preset finger area, the size of the binarized image does not affect the preset finger touch area, and thus, the second number threshold is substantially an absolute threshold. When the number of pixels in the connected domain is smaller than the second number threshold, it is indicated that a certain difference exists between an area corresponding to the number of pixels in the connected domain and a preset finger touch area, and the connected domain is not a finger touch connected domain. Correspondingly, when the number of pixels in the connected component is not less than the second number threshold, it may be indicated that the connected component is the finger touch connected component. Based on the above description, the accuracy of determining the finger touch connected domain can be improved by using the first quantity threshold and the second quantity threshold in combination, and the accuracy of the finger touch operation is correspondingly improved.
In addition, in some specific scenes, such as a projection scene, projection is realized by displaying an operation object displayed on a display of a computer connected to a projector on a projection content bearer. The user can only operate the computer connected with the projector, and can not directly operate the content bearing carrier, which seriously limits the operation range of the user. If the scheme is applied to certain specific scenes such as projection, the problem that the operation of a user is not convenient and fast in the scene can be solved on the basis that the effect of accurately identifying the finger touch operation can be achieved.
Based on this, as shown in fig. 2, the method for determining a finger touch connected domain in the embodiment of the present invention includes the following steps:
s201, acquiring the number of pixels of a connected domain in the binary image.
In a projection scene, the number of pixels of the connected domain can be obtained by the following method: when a user performs a finger touch operation at a certain position on the content carrier, the finger touch operation may be one finger or multiple fingers, the projection device may acquire a depth image corresponding to the finger touch operation according to the finger touch operation of the user, and a depth value of each pixel in the depth image corresponds to a distance between each pixel and a light source of the projection device. And then the depth image is subjected to binarization processing to obtain a binarized image. Alternatively, the binarization processing may be performed on the depth image by: the pixel binarization method includes the steps that a pixel with a depth value meeting a preset depth range in a depth image is binarized into 1, wherein the binarization value 1 is preset binarization, and the preset binarization value can be any other positive integer; the pixels whose depth values do not satisfy the preset depth range are binarized into 0. Alternatively, the preset depth range may be the thickness of an adult finger.
At this time, the pixel with the binarization value of 1 corresponds to a position where the finger touch operation occurs on the content carrying carrier, the pixel with the binarization value of 0 corresponds to a position where the finger touch operation does not occur on the content carrying carrier, and the pixel with the binarization value of 1 is a pixel which is needed to be concerned. And acquiring the pixel number of a connected domain in the binary image according to the binary value corresponding to each pixel in the binary image, wherein the connected domain is composed of a plurality of pixels with the binary value of 1.
S202, screening out connected domains with the number of pixels not less than a first number threshold value as first connected domains.
S203, determining whether the number of pixels in the first connected domain is not less than the second number threshold, and if the number of pixels in the first connected domain is not less than the second number threshold, executing step S204.
S204, determining that the first connected domain is a finger touch connected domain.
The first quantity threshold is determined by a product of a total number of pixels corresponding to a preset binarization value in the binarized image and a preset proportion, and a specific determination manner may refer to related description in the first embodiment, which is not described herein again. And screening connected domains with the pixel number not less than the first number threshold according to the first number threshold, and taking the connected domains as screened connected domains, wherein the screened connected domains are connected domains possibly corresponding to the touch control by the finger. And whether the connected domain really corresponds to the finger touch or not needs to be further judged.
And comparing the number of pixels of the screened connected domain with a second number threshold, wherein the second number threshold is determined by a ratio of the finger touch area to a preset pixel area, and a specific determination manner may refer to the related description in the first embodiment, which is not described herein again. And judging whether the number of the pixels of the screened connected domain is not less than a second number threshold. And finally, determining the connected domains of which the number of pixels is not less than a second number threshold value in the screened connected domains as the connected domains touched by the finger.
It should be noted that the above description is only an example of a projection scenario, and the present invention is not limited to a specific usage scenario. In practical application, there may be other similar scenes that the user needs to go back and forth between the content carrying carrier and the operating device many times to achieve the corresponding purpose because the content carrying carrier has a certain distance with the operating device, and such scenes are also suitable for the present invention.
In this embodiment, based on the determined number of pixels in the connected component, the number of pixels included in the connected component is compared with a first number threshold, where the first number threshold is determined by a preset ratio and a total number of pixels corresponding to a preset binarization value in the binarized image. In the binarized images with different sizes, the number of pixels of the connected domain corresponding to the noise is different, which results in that the total number of pixels corresponding to the preset binarized value in the binarized image is different, therefore, the first number threshold is substantially a relative threshold, and the binarized images with different sizes all have corresponding first number thresholds. Based on the above, the number of the pixels of the connected domain is compared with the first number threshold, so that the effects that the connected domain corresponding to the noise point and the connected domain corresponding to the non-noise point can be accurately distinguished for the binary image with any size can be achieved, and a cushion can be laid for accurately identifying the finger touch connected domain. When the number of the pixels of the connected domain is not less than the first number threshold, the connected domain is indicated to be a non-noise connected domain. The number of pixels contained in the connected component is compared to a second number threshold. Since the second number threshold is determined by the preset finger area, the size of the binarized image does not affect the preset finger touch area, and thus, the second number threshold is substantially an absolute threshold. When the number of pixels in the connected domain is smaller than the second number threshold, it is indicated that a certain difference exists between an area corresponding to the number of pixels in the connected domain and a preset finger touch area, and the connected domain is not a finger touch connected domain. Correspondingly, when the number of pixels in the connected component is not less than the second number threshold, it may be indicated that the connected component is the finger touch connected component. Based on the above description, the accuracy of determining the finger touch connected domain can be improved by using the first quantity threshold and the second quantity threshold in combination, and the accuracy of the finger touch operation is correspondingly improved. Meanwhile, the finger touch operation triggered on the content bearing carrier can be directly and accurately identified in a specific scene, and the convenience of user operation can be greatly improved.
Fig. 3 is a flowchart of a third method for determining a finger touch connected domain according to an embodiment of the present invention, and as shown in fig. 3, the method may include the following steps:
s301, acquiring a first depth image, wherein the first depth image corresponds to a depth image when interactive operation is not performed.
Also taking a projection scene as an example, the projection device projects the content onto the content carrying carrier, and when no finger touch occurs, it indicates that the user does not perform an interactive operation with the content carrying carrier. The projection device receives the reflected light reflected by the content carrier back to the projection device, and then obtains the distance between each pixel in the image and the projection device according to the received reflected light. Alternatively, a distance matrix may be formed from the distance values corresponding to the respective pixels, the distance matrix corresponding to the first depth image.
S302, a second depth image is obtained, and the second depth image corresponds to the depth image in the interactive operation process.
When the projection device projects the display content onto the content carrying carrier, when there is finger touch on the content carrying carrier, it indicates that the user performs an interactive operation with the content carrying carrier. The second depth image is obtained in a manner similar to the first depth image, and the specific process may refer to the related description in the above steps, and therefore, the details are not described herein again.
And S303, performing difference operation on the second depth image and the first depth image to obtain a third depth image.
And S304, carrying out binarization processing on each pixel in the third depth image by using a preset depth threshold value.
And performing difference on the second depth image and the first depth image to obtain a third depth image, and performing binarization processing on each pixel in the third depth image by using a preset depth threshold value. And obtaining a binary image after the binarization processing, wherein the binary image can be a binary depth image, and the binary values of the pixels in the binary image respectively correspond to 1 and 0, wherein 1 is a preset binary value.
S305, acquiring the pixel number of the connected domain in the binary image.
Alternatively, the number of pixels of the connected component in the binarized image may be determined in the following manner. Each pixel in the binarized image is traversed starting from the starting pixel in the binarized image. For the sake of simplicity of description, the pixel in the binarized image that is currently traversed to is referred to as the current pixel. And if the binarization value of the current pixel is 0, skipping the pixel, and continuously traversing the next pixel in the binarization image according to a preset traversal rule. If the binarization value of the current pixel is the preset binarization value 1, obtaining the label values of a plurality of adjacent pixels around the current pixel, wherein the plurality of adjacent pixels around the current pixel are pixels corresponding to the preset binarization value 1. Alternatively, the surrounding plurality of adjacent pixels may be pixels of which the binarized value is a preset binarized value among 8 adjacent pixels surrounding the current pixel as a center. The tag value has an initial tag value, which may be any positive integer greater than the predetermined binarization value.
There are many cases for the flag values corresponding to a plurality of adjacent pixels around the current pixel.
First, when the label values corresponding to a plurality of adjacent pixels are all empty, which indicates that the plurality of adjacent pixels are not labeled, the label value is determined to be a new label value, that is, the sum of the maximum label value in the label values corresponding to the pixels in the current binarized image and the preset label value update step is used as the new label value. At the same time, the flag values of a plurality of adjacent pixels are all set to new flag values. Then, the new mark value is updated by the preset mark value updating step length to obtain a new mark value, and the new mark value is used for the subsequent mark.
Secondly, when the mark values corresponding to the plurality of adjacent pixels are not empty, which indicates that the marked pixels exist in the plurality of adjacent pixels, the mark value corresponding to the current pixel is set as the maximum mark value in the mark values corresponding to the plurality of adjacent pixels. At the same time, the flag values of a plurality of adjacent pixels of the current pixel are also updated to the maximum flag value. After the setting of the flag value is completed, the setting of the flag value is not directly performed on the next pixel, but the flag value corresponding to the pixel of which the traversal order is prior to the current pixel is modified, and the specific modification process is as follows: and recording the remaining mark values except the maximum mark value in the mark values corresponding to a plurality of adjacent pixels before the mark value setting of the current pixel. Alternatively, the remaining flag value may be recorded in an array. And traversing from the initial pixel in the binary image again according to the recorded residual mark value, determining the pixel with the residual mark value, and updating the mark value corresponding to the determined pixel with the residual mark value to the maximum mark value. The above process is also: when the mark values corresponding to the plurality of adjacent points are not empty, the mark value of the previously marked pixel is corrected every time the mark value of the current pixel is set. Therefore, after the setting of the marking value of the last pixel is finished, the setting of the marking values of all pixels in the whole binary image is finished, and the marking values of other pixels do not need to be corrected.
And traversing the pixels in the binary image based on the mode, wherein after all the pixels in the binary image are traversed, the pixels with the preset binary values in the binary image have a corresponding mark value. Alternatively, the label value corresponding to each pixel in the binarized image may be recorded in a matrix, where the position of each label value element in the matrix corresponds to the position of the pixel corresponding to the label value in the binarized image. Alternatively, the label value corresponding to each pixel in the binarized image may also be recorded in a label value file, where the correspondence between the label value corresponding to the pixel and the pixel is recorded. The label value corresponding to each pixel in the binarized image and the number of pixels having the same label value may be obtained from a matrix or a file, and one connected domain is composed of pixels having the same label value.
S306, screening the number of pixels according to the first number threshold and the second number threshold, and determining the finger touch connected domain in the connected domain.
The execution process of step S306 is similar to the corresponding steps in the foregoing embodiment, and reference may be made to the relevant description in the embodiment shown in fig. 1, which is not repeated herein.
In this embodiment, pixels in the binarized image are traversed, and when a plurality of adjacent pixels corresponding to the currently traversed pixels are not empty, after the current pixel is set with the label value, the label value of the pixel in the binarized image, which has been set with the label value, is corrected again, that is, the correction is set at any time and at any time. And when the setting of the mark value of the last pixel is finished, the setting process of the mark value of each pixel in the whole binary image is finished. The marking value corresponding to each pixel does not need to be corrected after all the pixels are set with the marking values, and the speed of setting the marking values is greatly improved.
Fig. 4 is a schematic structural diagram of a first embodiment of a device for determining a finger touch connected domain according to an embodiment of the present invention, and as shown in fig. 4, the device for determining a finger touch connected domain includes: the device comprises a first obtaining module 11 and a determining module 12.
The first obtaining module 11 is configured to obtain the number of pixels in a connected domain in the binarized image.
The determining module 12 is configured to screen the number of pixels according to a first number threshold and a second number threshold, and determine a finger touch connected domain in the connected domain, where the first number threshold is determined by a total number of pixels corresponding to a preset binarization value in the binarized image and a preset ratio, and the second number threshold is determined by a preset finger touch area.
Optionally, the determining module 12 is specifically configured to: screening out connected domains with the pixel number not less than a first number threshold value as first connected domains, wherein the first number threshold value is determined by the product of the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion.
Optionally, the determining module 12 is further specifically configured to: and if the number of the pixels in the first communication domain is not less than a second number threshold, determining that the first communication domain is a finger touch communication domain, wherein the second number threshold is determined by the ratio of the preset finger touch area to the preset pixel area.
The apparatus shown in fig. 4 can perform the method of the embodiment shown in fig. 1 and fig. 2, and reference may be made to the related description of the embodiment shown in fig. 1 and fig. 2 for a part not described in detail in this embodiment. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 1 and fig. 2, and are not described herein again.
Fig. 5 is a schematic structural diagram of a second embodiment of the device for determining a finger touch connected domain according to the embodiment of the present invention, as shown in fig. 5, based on the embodiment shown in fig. 4, the device for determining a finger touch connected domain includes: a second obtaining module 21, a calculating module 22 and a processing module 23.
A second obtaining module 21, configured to obtain a first depth image, where the first depth image corresponds to a depth image when the interactive operation is not performed, and obtain a second depth image, where the second depth image corresponds to a depth image when the interactive operation is performed.
And the calculating module 22 is configured to perform a difference operation on the second depth image and the first depth image to obtain a third depth image.
And the processing module 23 is configured to perform binarization processing on each pixel in the third depth image by using a preset depth threshold to obtain a binarized image, where the binarized image is a binarized depth image.
Optionally, the first obtaining module 11 specifically includes: a first acquisition unit 111, a determination unit 112, a second acquisition unit 113.
The first obtaining unit 111 is configured to, for a currently traversed pixel, obtain label values of a plurality of adjacent pixels around the pixel if the pixel corresponds to a preset binarization value, where the plurality of adjacent pixels correspond to the preset binarization value.
A determining unit 112 for determining a label value of a pixel based on label values of a plurality of adjacent pixels.
A second obtaining unit 113, configured to obtain a connected component formed by pixels having the same label value and the number of pixels included in the connected component if all the pixels in the binarized image have been traversed.
Optionally, the determining unit 112 is specifically configured to:
and if the mark values of the plurality of adjacent pixels are not null, determining the mark value of the pixel as the maximum mark value of the mark values of the plurality of adjacent pixels.
Optionally, the determining unit 112 is further specifically configured to:
the marker values of a plurality of contiguous pixels are marked as new marker values.
Optionally, the first obtaining module 11 further includes: a first updating unit 114, a recording unit 115, and a second updating unit 116.
A first updating unit 114, configured to update the flag values of the plurality of adjacent pixels to a maximum flag value.
A recording unit 115 for recording the remaining mark values except the maximum mark value among the mark values of the plurality of adjacent pixels.
And a second updating unit 116, configured to re-traverse the traversed pixel with the remaining tag value before the pixel, and update the tag value of the traversed pixel to the maximum tag value.
The apparatus shown in fig. 5 can perform the method of the embodiment shown in fig. 3, and reference may be made to the related description of the embodiment shown in fig. 3 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution refer to the description in the embodiment shown in fig. 3, and are not described herein again.
Fig. 6 is an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device includes: a memory 31, and a processor 32 coupled to the memory.
Memory 31 for storing one or more computer instructions, wherein the one or more computer instructions are invoked for execution by the processor.
A processor 32 for executing one or more computer instructions to implement the method of the embodiment shown in fig. 1-3.
It should be noted that the electronic device may be a projector or a robot with a projection function, or the like. In addition, for the parts of the present embodiment that are not described in detail, reference may be made to the related description of the embodiment shown in fig. 1 to 3. The implementation process and technical effect of the technical solution are described in the embodiments shown in fig. 1 to 3, and are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and certainly, the embodiments can also be implemented by hardware. With this understanding in mind, the above technical solutions may be embodied in the form of a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., which includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A method for determining a finger touch connected domain includes:
acquiring the number of pixels of a connected domain in a binary image;
screening the pixel quantity according to a first quantity threshold value and a second quantity threshold value, and determining a finger touch connected domain in the connected domain, wherein the first quantity threshold value is determined by the total number of pixels corresponding to a preset binarization value in the binarization image and a preset proportion, and the second quantity threshold value is determined by a preset finger touch area;
the first quantity threshold value is used for screening out a connected domain corresponding to a noise point corresponding to the preset binarization value and a connected domain corresponding to a non-noise point from the binarization image;
the acquiring of the number of the pixels of the connected domain in the binarized image includes: for a pixel traversed currently, if the pixel corresponds to a preset binary value, obtaining label values of a plurality of adjacent pixels around the pixel, wherein the adjacent pixels correspond to the preset binary value; determining a label value of the pixel according to the label values of the plurality of adjacent pixels; if all pixels in the binary image have been traversed, acquiring the pixel number of the pixels with the same mark value as the pixel number of the connected domain;
when a pixel which is already marked exists in the plurality of adjacent pixels, after the marking value of the currently traversed pixel is set, the method further comprises the following steps: and correcting the marking value of the pixel marked before the marking value of the pixel traversed currently is set.
2. The method of claim 1, wherein the filtering the number of pixels according to a first number threshold and a second number threshold to determine a finger touch connected component in the connected component comprises:
screening out connected domains with the pixel number not less than a first number threshold value as first connected domains, wherein the first number threshold value is determined by the product of the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion.
3. The method of claim 2, wherein the filtering the number of pixels according to a first number threshold and a second number threshold to determine a finger touch connected component in the connected component comprises:
and if the number of the pixels of the first connected domain is not less than a second number threshold, determining that the first connected domain is a finger touch connected domain, wherein the second number threshold is determined by the ratio of the preset finger touch area to the preset pixel area.
4. A device for determining a connected domain touched by a finger, comprising:
the first acquisition module is used for acquiring the number of pixels of a connected domain in a binary image;
the determining module is used for screening the pixel quantity according to a first quantity threshold value and a second quantity threshold value, and determining a finger touch connected domain in the connected domain, wherein the first quantity threshold value is determined by the total number of pixels corresponding to a preset binarization value in the binarization image and a preset proportion, and the second quantity threshold value is determined by a preset finger touch area;
the first quantity threshold value is used for screening out a connected domain corresponding to a noise point corresponding to the preset binarization value and a connected domain corresponding to a non-noise point from the binarization image;
the first obtaining module specifically includes:
a first obtaining unit, configured to, for a currently traversed pixel, obtain label values of a plurality of adjacent pixels around the pixel if the pixel corresponds to a preset binarization value, where the adjacent pixels correspond to the preset binarization value;
a determination unit configured to determine a flag value of the pixel from flag values of the plurality of adjacent pixels;
a second obtaining unit, configured to obtain, if all pixels in the binarized image have been traversed, a pixel number of pixels having the same label value as a pixel number of a connected domain;
wherein, when there is a pixel that has been marked among the plurality of adjacent pixels, after the marking value setting is performed on the currently traversed pixel, the determining device is further configured to: and correcting the marking value of the pixel marked before the marking value of the pixel traversed currently is set.
5. The apparatus of claim 4, wherein the determining module is specifically configured to: screening out connected domains with the pixel number not less than a first number threshold value as first connected domains, wherein the first number threshold value is determined by the product of the total number of pixels corresponding to a preset binary value in the binary image and a preset proportion.
6. The apparatus of claim 5, wherein the determining module is further specifically configured to: and if the number of the pixels of the first connected domain is not less than a second number threshold, determining that the first connected domain is a finger touch connected domain, wherein the second number threshold is determined by the ratio of the preset finger touch area to the preset pixel area.
7. An electronic device, comprising: a memory, and a processor coupled to the memory;
the memory to store one or more computer instructions, wherein the one or more computer instructions are for the processor to invoke for execution;
the processor to execute the one or more computer instructions to implement the method of any of claims 1-3.
CN201710661233.XA 2017-08-04 2017-08-04 Method and device for determining finger touch connected domain and electronic equipment Active CN107450840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710661233.XA CN107450840B (en) 2017-08-04 2017-08-04 Method and device for determining finger touch connected domain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710661233.XA CN107450840B (en) 2017-08-04 2017-08-04 Method and device for determining finger touch connected domain and electronic equipment

Publications (2)

Publication Number Publication Date
CN107450840A CN107450840A (en) 2017-12-08
CN107450840B true CN107450840B (en) 2020-12-01

Family

ID=60490802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710661233.XA Active CN107450840B (en) 2017-08-04 2017-08-04 Method and device for determining finger touch connected domain and electronic equipment

Country Status (1)

Country Link
CN (1) CN107450840B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109829886A (en) * 2018-12-25 2019-05-31 苏州江奥光电科技有限公司 A kind of pcb board defect inspection method based on depth information
CN111833398B (en) * 2019-04-16 2023-09-08 杭州海康威视数字技术股份有限公司 Pixel point marking method and device in image
CN114253417B (en) * 2021-12-02 2024-02-02 Tcl华星光电技术有限公司 Multi-touch point identification method and device, computer readable medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246595A (en) * 2008-02-01 2008-08-20 黑龙江科技学院 Multi-view point data splitting method of optical three-dimensional scanning system
CN102509264A (en) * 2011-11-01 2012-06-20 武汉大学 Image-segmentation-based scanning image dedusting method
CN103544472A (en) * 2013-08-30 2014-01-29 Tcl集团股份有限公司 Processing method and processing device based on gesture images
CN106155642A (en) * 2015-03-25 2016-11-23 联想(北京)有限公司 A kind of information processing method and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102566827A (en) * 2010-12-30 2012-07-11 株式会社理光 Method and system for detecting object in virtual touch screen system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246595A (en) * 2008-02-01 2008-08-20 黑龙江科技学院 Multi-view point data splitting method of optical three-dimensional scanning system
CN102509264A (en) * 2011-11-01 2012-06-20 武汉大学 Image-segmentation-based scanning image dedusting method
CN103544472A (en) * 2013-08-30 2014-01-29 Tcl集团股份有限公司 Processing method and processing device based on gesture images
CN106155642A (en) * 2015-03-25 2016-11-23 联想(北京)有限公司 A kind of information processing method and electronic equipment

Also Published As

Publication number Publication date
CN107450840A (en) 2017-12-08

Similar Documents

Publication Publication Date Title
CN108520229A (en) Image detecting method, device, electronic equipment and computer-readable medium
CN107450840B (en) Method and device for determining finger touch connected domain and electronic equipment
CN110766679A (en) Lens contamination detection method and device and terminal equipment
CN108961157B (en) Picture processing method, picture processing device and terminal equipment
CN108961183B (en) Image processing method, terminal device and computer-readable storage medium
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN113253878B (en) Touch screen report point determining method and device, electronic equipment and storage medium
CN112949477B (en) Information identification method, device and storage medium based on graph convolution neural network
CN109491502B (en) Haptic rendering method, terminal device and computer-readable storage medium
CN114693673A (en) Glass detection method and device, electronic equipment and computer-readable storage medium
CN111553302A (en) Key frame selection method, device, equipment and computer readable storage medium
CN109873980B (en) Video monitoring method and device and terminal equipment
CN110349138B (en) Target object detection method and device based on example segmentation framework
CN113344957B (en) Image processing method, image processing apparatus, and non-transitory storage medium
CN110782504A (en) Curve determination method, device, computer readable storage medium and equipment
CN112116585B (en) Image removal tampering blind detection method, system, device and storage medium
WO2024002092A1 (en) Method and apparatus for pushing video, and storage medium
CN109799905B (en) Hand tracking method and advertising machine
CN108932704B (en) Picture processing method, picture processing device and terminal equipment
CN110969602A (en) Image definition detection method and device
CN108776959B (en) Image processing method and device and terminal equipment
CN115829929A (en) Method, device and equipment for detecting defects of product surface image and storage medium
CN114639056A (en) Live content identification method and device, computer equipment and storage medium
CN109165648A (en) A kind of image processing method, image processing apparatus and mobile terminal
CN114998800A (en) Video detection method, device, equipment and computer readable storage medium

Legal Events

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