Implementing Satoru Gojo's Domain Expansion, "Unlimited Void", was quite simple because the gesture itself is simple.
Only one hand needed and your middle finger to be wrapped behind your pointer.
It was easy to set up a MediaPipe pipeline to recognize that gesture, and I ended up finishing it quickly while my brother was sleeping.
Then I went onto implementing Sukuna's Domain Expansion, "Malevolent Shrine", which was a lot more challenging.
The gesture is more complex, requiring both hands and a specific way to position your fingers.
MediaPipe's hand tracking can struggle with accurately recognizing that gesture, since theres 10 fingers trying to be tracked simultaneously.
At first, I was stumped, I had been playing around with different approaches to try to get it working, but nothing seemed to be accurate enough.
I then set it aside, leaving it for the next day.
So today, I sat down with my brother and we brainstormed some solutions together.
We noticed that the main issue was that MediaPipe was struggling to track all 10 fingers accurately, which made it hard to reliably detect the specific configuration needed for Sukuna's Domain Expansion.
But what if we didn't need to track all 10 fingers?
We could just focus on the pinky, ring and middle fingers, since those are the ones that are most critical for the gesture.
So we did, we set up a new MediaPipe pipeline that only tracked those three fingers, and we focused our gesture recognition logic on the positions of those fingers relative to each other.
We made sure that we took into account more factors like fingertip distances and trying to find a triangle formed by the gesture.
Soon enough, that pull request was merged, and we had a working implementation of Sukuna's Domain Expansion as well.