5/12/23
I wanted to write one last post before I turn everything in. I want to thank Dr. McVey for all the help and guidance she has given me throughout the years and I wouldn't be where I am today without her. From the time I was a freshman you made sure I was always on the right track and pushed me to keep learning and to become who I am today. Big thank you to Dr. Pankratz and Dr. Diederich who both always offered me support whenever I needed it.
- Morgan Wilson
5/10/23
I wanted to talk a little about my presentation and the preparation that went into it. For my presentation I wanted to show off all the hard work that I have been doing. I also needed to take into account that not everyone watching is going to be as tech literite as my peers and I. So I wanted to make sure I was going to be able to explain things as simply as I could so everybody would be able to understand and appreciate my project and the work I put in. One of my main concerns was making sure I was using too much technical jargon without giving a good definition as to what it meant. Another concern was trying to help people visualize what I was doing as much as possible. To accomplish this I wanted to show off the mask and contours that the object detection was generating even though I usually only look at them for debugging. It provides the audience a good visual aid to help them understand what I am talking about. Overall I am happy with how my presentation went and I am proud of the work I have put into VolleyVision.
5/8/23
After talking to Dr. McVey and Dr. Diederich I wanted to go into some more detail on how I am cleaning the data file. The file cleaning was probably one of the hardest parts of the entire project and without it nothing would work. The object tracker I used would lose players when they would stop moving and it would pick up any change of pixels as a player. This meant that I needed a way to remember who was a player and who was not a player. The way I did this was that I decided that each frame I would determine the location of the six players even if that frame we did not track them all or tracked more than six players. I also needed my approach to work no matter how many players were being tracked so if I needed to up the player count I would not need to rewrite my entire code. My approach I decided to store an array of the player IDs that we wanted to track. I do this by looking at the first frame of when all six players first appear on the court. I also make a hash table of the players positions with the key value being the ID of the player. I do this on every frame as long as the IDs of arrays stays the same.
What happens when the array of tracked IDs changes from a frame to another frame. To handle this I had to look at all the cases. There were three cases. First we are tracking less IDs then there are players meaning we lost a player due to them not moving. To handle this I would see what players we lose by comparing the tracked players from the previous frame to the current. This would give me the IDs of the players I was missing. I then just counted the players as being tracked and put in their location the same as the previous frame.
Case two is that we track more players than we should have. To fix this we once again look to the previous frame to see what the six players we should track are. Then we compare and get rid of the non player object that was being tracked.
The final and the hardest case to deal with is when we have the same number of players, but the IDs we are tracking are obviously not players. First we have to determine what IDs are previously tracked players from the last frame and keep those in the array. Then we have to go through the rest of the IDs and see if they are a lost player who stopped moving or a random object that the tracker happened to pick up. To determine this we have to use the distance formula and compare the XY coordinates of the object to the location of each lost player. If the distance between the two is smallest enough we can be reasonably sure that the object is in fact our lost player who started moving again. If it is too far away we can be sure that it is not the player and just random noise.
4/17/23
This week I was able to work a lot on the animation side of things. I was having a bug where it would display no players on the court in between every frame. This made the animation look glitchy and not very smooth. I was able to fix this and the animation looks a lot smoother. The current problem I am having is with the translation of the coordinates. I found that openCV has a built-in function that can find a translation matrix using just coordinates. While this is a good starting point this results in some very weird translations and is not very accurate.
Here we have an example of a volley.
Here is what the translated coordinates map to.
As you can see I still have a lot of work to do to get the translation just right.
4/7/23
The current issue with the object tracker is that as a player stands still we lose them in the tracker. To fix this I am going to go into the data file that contains the codinates and object IDs and keep track of the objects that the tracker is losing. So when a player is standing still and I lose them I just take the ID that I lost and the cordinates I lost it at and add it to data file. This results in a constistent six players being tracked at all times.
This is what the data file used to look like. Then after I clean it up in code we get this.
The data file is now much cleaner and consistent. We are able to get rid of a lot of noise that the object detector gets.
3/20/23
After a fun spring break I am back at work on McVATs. So far this week I have gotten a good amount of work done and I am able to read in coordinates from a data file and draw the player. I also added a slide bar that lets you pick which frame you want to load and lets you rewind and fast forward the animation. I want to add support for a play button that will move the player in real time as it was recorded. I also got the reading in of the data file working and I am starting to think that buffering my file will be unnecessary as my test data file was pretty large and it handled it flawlessly with no buffering. Here is what my animation looks like as of now.
I plan to add pictures of 2D volleyball players eventually so it is not just a red dot.
3/6/23
After all the progress I have made with the object tracking I am putting it on hold until I meet with Dr. McVey later this week. While I wait for the meeting I have been working on the animation side of things. I wrote the functions that draw the court and the players on it. The players will be able to be drawn using x,y coordinates I get from the object tracking. Since I got the court and the players being drawn I have been working on how I will be reading information from my data file. I know I will need to buffer it so I pull out chunks of data at a time instead of one coordinate at a time. So I will pull out chunks of coordinates so as to not have to constantly read from the data file. I also know I will need to thread this so that I can read from the data file and buffer information while the animation is running. I have started looking into how to do this and I found that python has threading built in and it should be easy to set up. I also have experience with threading from the android development class I took so I am not expecting this to be a big challenge. However, I have never really buffered information and I am trying to think of a good way to do it. The issue I am running into is that I need to keep track of what information I have access to and where in the data file I last looked at to determine what information I need to pull from it next. I have no experience with this and am I finding it to be a little more difficult than I originally thought it would.
2/27/23
I started to work a lot more on object tracking.
Above you can see that I was able to get some basic object tracking to work. To do this I had to use openCV to create a mask which essentially turns the frame into black and white image. The black is what is not changing frame to frame and the white pixels represent a change. What this allows me to do is to see moving objects on a static background, which is exactly what I will be doing with McVATs. I will be looking at a static background (volleyball court) and the players will be moving. The image you see is me taking the mask and finding the contours and drawing boundaries around them. Then I need to filter out the contours that are not objects I want to track. I did this by looking at the area of the objects and throwing away the ones that were too small. In the picture below you can see how this worked really well in reducing unwanted noise.
2/24/23
So far this week I have been working on animations. I am working really hard to find the court design I want the animation to have. I am also trying to get the players to animate from a data file. I want to be able to have a scroll bar that will play the frame that is being loaded in from the data file. So far only the court is loading in as it should, but the other things are not far behind.
2/21/23
This week I worked a lot on the website and tried to get it in a better place. I have been having a lot of problems with word press and after a three hour long battle I admitted defeat and gave up on trying to use it. I found a free template online for a basic website and downloaded it and started writing my website in HTML and CSS myself. This was a lot simpler and faster than wordpress. I also started working on the animation side of things. I already know how to use pygames (a simple game making library) from my adventure making a chess engine so I thought that would be a good place to start. After talking to McVey today she explained that I should make the animations with the idea that I can rewind and fast forward in mind. Before I try to tackle that problem I am writing the functions that draw the court, players, and ball. I also know I need to add some videos showing what my project can do right now.
2/13/23
This week I did not work on my project as much as I should have. So this blog will not be very long. This week I practiced on my openCV skills a little more and learned to do some cool things with manipulating pictures and videos. I also started to think about what my data file is going to look like and after getting feedback from the whiteboard session I feel a little more confident about the structure of my file and how it is going to work.
1/30/23
This is my first of many blog posts for my capstone project that I have named McVATs. This stands for Morgan’s Capstone Volleyball Animation Tracking System. Giving my project a cool name is not all I have done either. After a call with Professor McVey I was given some direction on how the project is going to work. Right now my understanding is that I will take a video of a volley in a volleyball game. I will then run my first piece of software that will track the volleyball and players and it will generate the X and Y coordinates of each of the objects that I am tracking. I will save all this to a data file and send that into my second piece of software that will interpret the data and create a 2d animation of the volley.
This quick sketch illustrates how my system would work. Right now I am currently working on getting the tracking software written. I am trying to use the openCV library to track my face on a webcam and once I get that working I will try to start tracking objects on the volleyball court. Right now I am just trying to get a prototype working and once I am successful with that I will be better able to understand my next goal.
I also need to start working on my website. I have some experience with web design from my internship this last summer and I think this will be pretty straightforward, but I haven’t started it yet.