Team Status Report for 10/23

Lask week, our group spent most  of our time on writing our Design report. We updated our Gantt chart to make updates on changes of current schedule. Anoushka worked on introduction, design requirements, CV trade studies, and CV system description. Demi worked on Architecture, LED trade studies, and hardware system description. Yoorae helped Anoushka on design requirements, and wrote trade studies for AI engine, Project management, and ethical issues sections. We met on Thursday night last weekend to combine our work and finalize our design reports. This week, we discussed ethical issues on Monday to prepare for ethics discussion and ethics assignment for our project. We have concluded that our major goal of the project was to create leisure activity for people who enjoy chess but who are not very familiar with technology by eliminating any software interactions from user’s point of view, but can cause ethical harm by creating more social isolation since our project does not provide any user to user interaction.

 

One of the most significant risks still remains the accuracy of the CV. This is being managed by ensuring that the board does not have any qualities that would make detection harder. For example, Anoushka found that even slight irregularities on a square can cause issues. We are ensuring that the board does not have any of these. In terms of contingency plans, the main one is to ensure that the user has a way of telling us the detection is wrong. This took some planning to ensure that the game doesn’t become unplayable, but we got help from professors and TA. We decided to light up LEDs to display the detected move and provide the user with a button to press if the detection is wrong. There were no changes to the system diagram after the design report.

 

Updated Gantt Schedule:

 

Demi’s Status Report for 10/23

10/10-16
I mainly worked on the design document. I created a system diagram to illustrate the overall flow of our project and recreated the block diagram. I also wrote the requirements section for LEDs and trade study sections for LEDs and board integration.

10/17-23
Earlier this week, I laser cut the squares for the second chessboard. Due to time and cost constraints, the plan is to only make one complete chessboard with the LEDs and push button installed. The second chessboard will just be the chessboard top without any LEDs, to allow Anoushka and Yoorae to test CV while I make the main chessboard.

The weld-on glue has arrived, so I have started gluing the squares. As of 10:30 pm, I have been able to glue 24 squares. The gluing part is taking longer than expected. The initial bond forms within a few minutes, and I have to hold the pieces together during this 2-3 minute period before moving on to the next piece. My goal is to finish welding all 64 squares by Sunday night. Due to time constraint, for the sample chessboard, instead of using glue, I will use tape to hold the pieces together.

I have set up the Raspberry Pi. There was an issue at the beginning. When I connected the RPi for the first time, I got a missing HDMI output message on the monitor. I tried every solution on the internet but could not solve it. As a last resort, I decided to use a different SD card to see if the SD card was the issue. I formatted and installed NOOBS on the new card and was able to see a signal on the monitor. I have installed the NeoPixel library for the LEDs. Because of the initial SD card error, I was not able to test the LEDs with the RPi yet.

Next week, I am planning to connect the LEDs to the RPi and test them. I will also laser cut the internals of the chessboard for the LED matrix. Lastly, I am going to place an order for the wooden sheets and push button.

Anoushka’s status report for 10/23

The week of 10/16 I mostly worked on the design report. I wrote the introduction, the design requirements (move detection), architecture overview, design trade studies for computer vision (edge detection and piece vs change detection) and system description (Move detection). I also worked on a flowchart representing that CV pipeline. This took a considerable amount of time because there were a lot of cases to consider and it still had to be as readable as possible.

I also spent time coming up with more design requirements that would help us measure the performance of the Computer Vision. For example, how far can the center of the piece be from the center of the square and still be detected correctly? 

I spent a lot more time on the design report that I had predicted, and spent most of week 10/23 trying to catch up on the actual project.

I spent the first 2 days trying to figure out the detected lines (grid) in the input image once we have detected edges. A picture is attached below of the input image and the detected lines that correctly form the grid.

 

 

The way I did this was first applying the hough transform and then iterating through the peaks. The peaks were of the form (angle, dist), and I got the coordinates of the point by:

 (x0, y0) = dist * np.array([np.cos(angle), np.sin(angle)])

The slope of the line is the tangent of the angle. 

Once I had this, I found the intersection points of these lines with either y=0 (for the vertical lines) and x=0 (for the horizontal lines). Then, for each vertical line I iterated through all the horizontal lines and formed rectangles with the coordinates:

 

[[this_line, this_hor_line], [next_line, this_hor_line],

        [this_line, next_hor_line], [next_line, next_hor_line]]

 

Here this_line is the x axis intersection of the current vertical line and next_line is the next one. 

Similarly, this_horizontal_line is the y intersection of the current horizontal line (as we iterate through the lines) and next_hor_line the next one.

One tricky part was ensuring that we didn’t end up with extra lines towards the left  and right due to the edge of the chessboard being taken as an edge. We corrected for this in the following way:

  1. finding the middle 2 vertical lines and calculating the gap between them
  2. Go left and right from each of these 2 lines and +- the gap to get all the other lines. 
  3. Stop when enough lines have been placed to ensure the edge of the board or any noise does not affect the output.

 

Once I had that working, I began work on actually determining the move. Once we had the grid, this surprisingly wasn’t as hard to implement. I did the following:

  1. Iterate through each rectangle
  2. Get the edges inside the square
  3. Apply the logic of the flowchart above

 

One issue I had however is that the chessboard I am testing on had a few lines on the square due to the pictures being of  wooden chessboard. This is because the 64 squares we are making aren’t ready yet (we have 32). However, I confirmed with Demi that this will not be a problem for us because we don’t use wood and our pieces are smooth. 

Now that I have most of the harder things working, I am going to test on the chessboard we purchased. From preliminary testing, this seems to be working a lot easier than on my original chessboard picture because it doesn’t have the wood problem. This is what I plan to do this week. Yoorae will be helping out as well as CV is a shared task due to complexity.

I’m behind schedule but I am confident I will catch up this week. Most of this was due to not allocating enough time for the design review. However, I have also been doing the “optimizing for speed” thing in parallel, so that is not a different task anymore. This week, I will be working on completing move detection and being ready to test when Demi finishes the board. 

I updated the Gantt chart for myself to allow more time for move detection. I was expected to be done with it last week, but I have updated that to finish this week instead. The color for 11/1 is just for testing on the actual chessboard because I have to wait for Demi to finish it.  

 

I plan to catch up by day 1-2 this week. I have also been doing some work on figuring out how we will integrate with Stockfish (eg how the moves will be sent to it), and that integration seems fairly simple. There shouldn’t be too many complex tasks left after this week. 

 

Deliverable: Completed move detection, tested on at least the sample chess board. If I get the actual chessboard, I will also test on that. I will also calculate metrics such as accuracy, distance from the center etc., as described in the design report. I am to have preliminary testing reports out this week.

 

 

 

 

 

Yoorae’s Status Report for 10/23

Last week I have spent most of my time on lab hours for writing Design Review Report. The portion I was responsible for was any part that was related to integration of Stockfish Engine of the project. I was also responsible for writing project management portion (including schedule, team member responsibilities, budget, and risk management), related ethical issues, and related work.

I have also finalized the chess logic algorithm that returns boolean values on whether player has made a valid move or not. Since every chess piece has different allowed movements, I have created a class for each chess piece. The main function ‘validate’ will be inputed the current board state, chess piece type,  and a new location that user has indicated. The original state of selected piece (before movement) will be reachable in a board class that is passed into the function. If the movement is validated from the piece class as a possible movement, the function will return a tuple of new coordinates for the piece, else, it will return Null and the function will return false.

 

I am also working on a transition function for Chess AI integration. Anoushka has updated coordinate algorithm from CV edge detection, which has to be translated to be computed with bit boards in Stockfish engine.

From next week, I will be working with Anoushka with the  background subtraction algorithm to help her with updating board states.

Yoorae’s Status Report for 10/9

This week I spent most of my time practicing for Design Review presentation. I practiced speaking with my teammates and practiced answering possible questions that can be asked to me. I also started writing Design Review Report, and wrote a code in C that can detect any illegal moves in Chess.

Demi’s Status Report for 10/9

This week I laser cut the chessboard squares and handed it over to Anoushka for CV testing. Once the acrylic weld-on arrives, I will glue the squares together. I decided that it would be convenient to have two sets of chessboard. In that way we can work in parallel, building the chessboard and testing with CV, so I ordered another pair of green and white acrylic sheets. I also made orders for the WS2812B 30 pixels/m LEDS, 5V 10A power supply, and acrylic weld-on and picked up the Raspberry Pi which we borrowed from the capstone inventory.

I have researched how the WS2812B LED strips are connected and controlled by RPi. I will be using the rpi_ws281x library. From our proposal presentation, we got feedback on how we will be controlling 64 LEDs with the limited number of pins on the RPi. I looked into it and concluded that we only need one GPIO pin since there is only one data line for the WS2812B LED strip.

I am on track schedule wise. I now have most of the parts needed for creating the board and have finalized the details of the design. I plan on to work on the design report early on next week. For the rest of the week, I will test the LEDs with the RPi and make an additional chessboard.

Anoushka’s status report for 10/9

This week I worked more on edge detection and grid detection. I tried chess board edge detection on various pictures of boards and had challenges in cases where there was a shadow or the color of the chessboard was similar to the table. I have been looking into ways of removing shadows before I detect the edges using canny edge detection. 

 

An easy solution is making them put the chessboard on a light colored table but that is a last resort. I also worked with Demi to explain my requirements for the board so I can do CV on it. I have now started working on CV on the real board because we got pieces this week.

Team Status Report for 10/09

This week we spent our time preparing for our Design Review presentation. We met on Saturday outside of class to finalize our slides and Yoorae presented on Wednesday. We received feedback that our metrics seem inaccurate, so we discussed with Professor Yu to get ideas to make our metrics more reasonable as well as get new metric ideas that would measure more useful things. For example, we decided to change our illegal move detection accuracy to instead be a latency measure. This is because illegal move detection itself doesn’t make sense to measure because it should reasonably be 100% accurate. We also decided on more metrics that helped capture useful features of our design (like how much the distance of the center of the piece can be from the center of the square).

We also received our chess pieces and Demi created the sample chessboard, so we can now start testing our CV.

 

Demi’s Status Report for 10/2

This week I finalized the specifics of the board. Each square will be laser cut into 2×2 inches using green and white translucent acrylic sheets. The squares will be welded together using acrylic weld on glue. An 8×8 RGB LED matrix will be installed under the board. The front of the board will be laser cut to fit the push button and LCD screen in.

My goal for this week was to have the squares ready. It is important for us to have the top of the board as soon as possible so Anoushka and Yoorae can start testing with CV. However, the acrylic sheets have not arrived yet. In the meantime, I made a drawing for the squares using SolidWorks, so I will be able to laser cut the squares as soon as the sheets arrive.

Anoushka’s status report for 10/2

This week I worked on finalising the Camera compatible with Rpi that we will be using for the CV. I also began working on using OpenCV to detect edges of an image of a chess board. I then began working on detection of squares in a chess board image. I am thinking of starting at the middle of the chess board, and going one-by-one in all directions till I hit a large color gradient. This would be the edge of the square in that direction. Because our sample chess board hasn’t arrived yet, I had to use an image off the internet. However, at least the basic algorithm will be transferable to our chess board. I also discussed with Demi the requirements that our chess board must satisfy so that I am able to detect the squares and the pieces on the board.  fo