Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor blob detection outside of the Touch class #20

Merged
merged 13 commits into from
Dec 19, 2024

Conversation

vberthiaume
Copy link
Member

Fix #18.

  • refactor blob detection out of the Touch class and into its own class, BlobDetector
  • add multi-touch testing to testing_touch.cpp to

- replace some hard-coded variables by a maxNumBlobs variable
- Directly return a movement vector from the blob detector, so client code doesn't have to store previous blob positions
- everything needs to be thoroughly tested
@vberthiaume vberthiaume linked an issue Dec 17, 2024 that may be closed by this pull request
3 tasks
include/puara/descriptors/touch.h Outdated Show resolved Hide resolved
tests/testing_touch.cpp Outdated Show resolved Hide resolved
tests/testing_touch.cpp Show resolved Hide resolved
include/puara/utils/blobDetector.h Outdated Show resolved Hide resolved
include/puara/utils/blobDetector.h Show resolved Hide resolved
include/puara/utils/blobDetector.h Outdated Show resolved Hide resolved
include/puara/utils/blobDetector.h Outdated Show resolved Hide resolved
@jcelerier jcelerier mentioned this pull request Dec 17, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may leave this as is for now, but my suggestion is to have the blobdetector as a separate class and the touch class only dealing with extracting the features.

In that case, there's no need for multi versions of the gestures as the class itself will deal with 1 DoF at a time. The user can implement multi versions (or we can create wrappers for that) from the main touch class.


// brush: direction and intensity of capsense brush motion
// rub: intensity of rub motion
// in ~cm/s (distance between stripes = ~1.5cm)
for(int i = 0; i < (sizeof(blobPos) / sizeof(blobPos[0])); ++i)
for(int i = 0; i < maxNumBlobs; ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the iteration and simplify the class to process a single DoF

Comment on lines +96 to +97
multiBrush[i] = multiBrushIntegrator[i].integrate(movement[i] * 0.15);
multiRub[i] = multiRubIntegrator[i].integrate(std::abs(movement[i] * 0.15));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can promote brush and rub as specific classes (separate from the less interesting gestures from this class)

include/puara/utils/blobDetector.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@jcelerier jcelerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate blob detection logic
3 participants