Skip to content

Instantly share code, notes, and snippets.

View Hitoli's full-sized avatar
🏦
Learning and Building

Hitesh Kohli Hitoli

🏦
Learning and Building
View GitHub Profile
@Hitoli
Hitoli / gist:662466b837a27503f679b3d238985bd9
Created January 19, 2026 09:05
Pose detection + Kalman Filter
package ai.crik.sports.features.analytics.pose.utils
import ai.crik.sports.di.Utils
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Matrix
import android.os.SystemClock
import androidx.annotation.OptIn
import androidx.camera.core.CameraSelector
@Hitoli
Hitoli / gist:ebf6768e01e6d363a3641ec909508302
Created January 16, 2026 07:40
Pose Processor Phase 4
package ai.crik.sports.features.analytics.pose.utils
import ai.crik.sports.di.Utils
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Matrix
import android.os.SystemClock
import androidx.annotation.OptIn
import androidx.camera.core.CameraSelector
@Hitoli
Hitoli / gist:3a709e832fd1271634378c15e3de6882
Last active December 24, 2025 09:57
pose detections it is
"package ai.crik.sports.features.analytics.pose.utils
import ai.crik.sports.di.Utils
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Matrix
import android.os.SystemClock
import androidx.annotation.OptIn
import androidx.camera.core.CameraSelector
import androidx.camera.core.ExperimentalGetImage
@Hitoli
Hitoli / gist:9a78aebf8e14c0887cb29d49ecf142f4
Created December 20, 2025 07:17
Media pipe pose detection
"package ai.crik.sports.features.analytics.utils
import ai.crik.sports.features.analytics.pose.utils.PoseProcessor
import ai.crik.sports.features.analytics.pose.viewmodel.PoseViewmodel
import android.util.Log
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.ImageProxy
import kotlinx.coroutines.*
import javax.inject.Inject
fun Array<Int>.unionOfArrays(array:Array<Int>):MutableList<Int>{
var temp1 = 0
var temp2 = 0
var temp = 0
val arr:MutableList<Int> = mutableListOf()
while (temp1<this.size && temp2<array.size){
if (this[temp1]<array[temp2]){
if (this[temp1]!=temp){
temp = this[temp1]
arr.add(this[temp1])
@Hitoli
Hitoli / gist:79f942cc97122b75b510337208ce2d5b
Created February 25, 2025 08:11
Linear Search Element in Array
fun Array<Int>.linearSearch(n:Int):Boolean{
for (i in 0 until this.size){
if (this[i] == n){
return true
}
}
return false
}
@Hitoli
Hitoli / gist:bb32aab50b2df4f321926fd87b2cca94
Created February 25, 2025 08:08
Moving 0s to end of the array
fun Array<Int>.moving0sToEnd(){
var temp1 = 0
var temp2 = 1
while (temp2<this.size){
if ((this[temp1]!=0 && this[temp2]!=0)|| this[temp1]!=0 && this[temp2]==0){
temp1++
temp2++
}else if (this[temp1]==0 && this[temp2]!=0){
//swap
val temp = this[temp1]
@Hitoli
Hitoli / gist:3179112fbc5d9491452ab41701fd3ce9
Created February 24, 2025 05:44
Right Rotate Array by N Places
fun Array<Int>.reverse(start:Int, end:Int){
var startN = start
var endN = end
while (startN<endN){
val temp = this[startN]
this[startN]= this[endN]
this[endN] = temp
startN++
endN --
}
@Hitoli
Hitoli / gist:f0dedb6d65c09fdc3497122138f45579
Created February 24, 2025 05:25
Left Rotate Array by N places
fun Array<Int>.leftRotateByNPlaces(n:Int){
this.reverse(0, n-1)
this.reverse(n, this.size-1)
this.reverse(0,this.size-1)
}
fun Array<Int>.reverse(start:Int, end:Int){
var startN = start
var endN = end
while (startN<endN){
@Hitoli
Hitoli / gist:aa87902ea9e5e4c6b04e34b48c1530b2
Created February 24, 2025 05:14
Left Rotate Array by one place
fun Array<Int>.leftRotateByOne(){
val temp = this[0]
for (i in 1 until this.size){
this[i-1] = this[i]
}
this[size-1] = temp
}