This week, I had 4 main tasks: Optimization for speed, Dealing with skew, Integration with sockets and Getting a camera stand.
For the camera stand, this is a newly added task after getting feedback about the demo setup, where we want a mount for the webcam so that it can point downwards. My current setup literally tapes the webcam to a piece of plank that is protruding from a table. The main difficulty here is that a webcam ordinarily would not need such a functionality, and the mounts that do do not seem high enough for our needs. I am looking at this and this currently. The problem with both honestly is thinking long term in terms of the demo. The reason why the current setup is sort of ideal, is because of the fact that I can easily just add an additional phone or something on top of it to provide a live video feed for the demo, which is something that would be nice to show the full storyboard/flow of the project. The first clamp is also a bit worrying because it seems the most ideal for getting the downward angle, but it is a ball clamp and I am not sure if the head is removable. Regardless, I will discuss with the team by this week to make a decision on it.
Integration with sockets took longer than expected, because Aria is using sockets, while I am on windows and it is not supported. Transitioning to winsock took a bit longer than expected due to a couple of transitioning issues, but it seems to be ok now. We will test it when we meet up this week.
Dealing with skew is done fully as well this time. This part of the code is basically an additional check on top of the code to see if the skew is more than 20 pixels from corner to corner, and if so to correct for it when scanning for pixels for correctness. This was done early in the week, and was just finishing up of what was mostly already done last week, and to deal with more obvious skew issues.
Optimization for speed is the last main task for the week, and is what I spent the most time on this week. I have tried many different ways to reduce the latency for the CV component. I think it makes sense to figure out where the latency is in the first place. My starting latency was at 280ms, which is higher than expected, and the main issues were due to doing 2 different full scans of the image. Basically a first overlay is required to figure out the black squares to detect the corners, and then a second overlay is required to figure out for each grid cell if it is of a certain color or not. Some early easy wins were reducing the number of pixels checks for each grid cell for correctness, and writing the output vector directly when figuring out the second overlay instead of doing a third pass. However, further optimizations proved tricky, as they tended to start causing some correctness issues. My final latency for the week is at 230ms, which is still very high. Will work further to bring it down next week.
Change of plans
I am again on track to finish on time, I am mostly done with the rough product, it is entirely working already and if the demo was this week it could work, but we are now in the refinement and optimization phase for my portion of the project 🙂
Deliverables for next week
I hope to cut down latency further, at least for my portion of the code. I will also be meeting Nadine for the next stage of integration.