The Show
2 posts
• Page 1 of 1
The Show
Here are some core ideas I used for making CV for the show 21. Hope others can share their ideas as well.
Also do not message me asking to buy the code. Anyone who sends such request will be blocked.
The degree system I use is y-inverted, meaning 90 stands for 6-clock direction, 180 for 9, 270 for 12.
Pinpoint pitching:
- For each pitch, we have starter angle/how much you rotate by in CW direction/duration of rotation. I stay 100ms at the initial angle for all of them.
- Fastball : //530
- Circle change : 270/-360/900
- Slider : 180/-270/800
- 12-6 Curve : 90/-180/570
- Curve : 135/-225/700
- Changeup : 90/180/600
- Cutter : 180/90/350
- Splitter : 180/180/700 (second portion : -90/200)
- 2-seam : 45/-135/500
- Sinker : 90/-180/650
- Knuckle curve : 135/-225/700
-- Finishing angle : the finishing angle depends on your left-stick position at the start of the pitch. I used the following approximation and it worked pretty good.
fin_ang = 90 - (int)get_val(STICK_2_X) * 45 / 100;
Hitting:
- Jaj gave me the idea of using radius for ball prediction , and that is what I used.
- 1. to extract the ball : I used the following list of functions from opencv as the main ingredient.
-- GaussianBlur, cvtColor, inRange, findContours, contourArea. I also used checking circularity and Hu-moments for fine picking the circular contours.
https://www.pyimagesearch.com/2015/09/1 ... th-opencv/ : this article contains everything one needs.
- 2. prediction of ball movement : I used linear prediction based on the radius. After that take weighted average (weighted using radius) of predictions so far and pass it to gpc, after converting to polar coordinates (scale x-axis so it matches y-axis)
- 3. Moving the stick : I used sqrt of the distance (post scaling x-axis) * 5.5 as the power moving the stick. Used set_polar from https://www.consoletuner.com/greslib/?w944.
(the frame I used had corner points (500,250)-(1420,1000))
Also do not message me asking to buy the code. Anyone who sends such request will be blocked.
The degree system I use is y-inverted, meaning 90 stands for 6-clock direction, 180 for 9, 270 for 12.
Pinpoint pitching:
- For each pitch, we have starter angle/how much you rotate by in CW direction/duration of rotation. I stay 100ms at the initial angle for all of them.
- Fastball : //530
- Circle change : 270/-360/900
- Slider : 180/-270/800
- 12-6 Curve : 90/-180/570
- Curve : 135/-225/700
- Changeup : 90/180/600
- Cutter : 180/90/350
- Splitter : 180/180/700 (second portion : -90/200)
- 2-seam : 45/-135/500
- Sinker : 90/-180/650
- Knuckle curve : 135/-225/700
-- Finishing angle : the finishing angle depends on your left-stick position at the start of the pitch. I used the following approximation and it worked pretty good.
fin_ang = 90 - (int)get_val(STICK_2_X) * 45 / 100;
Hitting:
- Jaj gave me the idea of using radius for ball prediction , and that is what I used.
- 1. to extract the ball : I used the following list of functions from opencv as the main ingredient.
-- GaussianBlur, cvtColor, inRange, findContours, contourArea. I also used checking circularity and Hu-moments for fine picking the circular contours.
https://www.pyimagesearch.com/2015/09/1 ... th-opencv/ : this article contains everything one needs.
- 2. prediction of ball movement : I used linear prediction based on the radius. After that take weighted average (weighted using radius) of predictions so far and pass it to gpc, after converting to polar coordinates (scale x-axis so it matches y-axis)
- 3. Moving the stick : I used sqrt of the distance (post scaling x-axis) * 5.5 as the power moving the stick. Used set_polar from https://www.consoletuner.com/greslib/?w944.
(the frame I used had corner points (500,250)-(1420,1000))
Last edited by osori on Tue May 04, 2021 6:40 pm, edited 1 time in total.
-
osori - Corporal
- Posts: 4
- Joined: Sun Dec 06, 2020 4:51 am
Re: The Show
Thank you for sharing your findings.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
2 posts
• Page 1 of 1
Return to Gtuner Computer Vision
Who is online
Users browsing this forum: No registered users and 97 guests