{"id":91,"date":"2021-10-23T01:25:33","date_gmt":"2021-10-23T06:25:33","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/?p=91"},"modified":"2021-10-23T01:25:33","modified_gmt":"2021-10-23T06:25:33","slug":"anoushkas-status-report-for-10-23","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/2021\/10\/23\/anoushkas-status-report-for-10-23\/","title":{"rendered":"Anoushka&#8217;s status report for 10\/23"},"content":{"rendered":"<p><span style=\"font-weight: 400\">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. <\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-100\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.20.49-AM.png\" alt=\"\" width=\"428\" height=\"548\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.20.49-AM.png 1378w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.20.49-AM-234x300.png 234w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.20.49-AM-768x983.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.20.49-AM-800x1024.png 800w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/p>\n<p><span style=\"font-weight: 400\">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?\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-96\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.13.43-AM-278x300.png\" alt=\"\" width=\"477\" height=\"515\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.13.43-AM-278x300.png 278w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.13.43-AM-768x828.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.13.43-AM-950x1024.png 950w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.13.43-AM.png 1004w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-95\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.12.31-AM-300x240.png\" alt=\"\" width=\"614\" height=\"491\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.12.31-AM-300x240.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.12.31-AM-768x616.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.12.31-AM-1024x821.png 1024w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.12.31-AM.png 1350w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/p>\n<p><span style=\"font-weight: 400\">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:<\/span><\/p>\n<pre><strong>\u00a0(x0, y0) = dist * np.array([np.cos(angle), np.sin(angle)])<\/strong><\/pre>\n<p><span style=\"font-weight: 400\">The slope of the line is the tangent of the angle.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">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:<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre><span style=\"font-weight: 400\">[[<\/span><span style=\"font-weight: 400\">this_line<\/span><span style=\"font-weight: 400\">,<\/span> <span style=\"font-weight: 400\">this_hor_line<\/span><span style=\"font-weight: 400\">],<\/span> <span style=\"font-weight: 400\">[<\/span><span style=\"font-weight: 400\">next_line<\/span><span style=\"font-weight: 400\">,<\/span> <span style=\"font-weight: 400\">this_hor_line<\/span><span style=\"font-weight: 400\">],<\/span>\r\n\r\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">[<\/span><span style=\"font-weight: 400\">this_line<\/span><span style=\"font-weight: 400\">,<\/span> <span style=\"font-weight: 400\">next_hor_line<\/span><span style=\"font-weight: 400\">],<\/span> <span style=\"font-weight: 400\">[<\/span><span style=\"font-weight: 400\">next_line<\/span><span style=\"font-weight: 400\">,<\/span> <span style=\"font-weight: 400\">next_hor_line<\/span><span style=\"font-weight: 400\">]]<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Here this_line is the x axis intersection of the current vertical line and next_line is the next one.\u00a0<\/span><\/p>\n<p>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.<\/p>\n<p><span style=\"font-weight: 400\">One tricky part was ensuring that we didn\u2019t end up with extra lines towards the left\u00a0 and right due to the edge of the chessboard being taken as an edge. We corrected for this in the following way:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">finding the middle 2 vertical lines and calculating the gap between them<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Go left and right from each of these 2 lines and +- the gap to get all the other lines.\u00a0<\/span><\/li>\n<li>Stop when enough lines have been placed to ensure the edge of the board or any noise does not affect the output.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Once I had that working, I began work on actually determining the move. Once we had the grid, this surprisingly wasn\u2019t as hard to implement. I did the following:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Iterate through each rectangle<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Get the edges inside the square<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Apply the logic of the flowchart above<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">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\u00a0 wooden chessboard. This is because the 64 squares we are making aren\u2019t ready yet (we have 32). However, I confirmed with Demi that this will not be a problem for us because we don\u2019t use wood and our pieces are smooth.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">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\u2019t 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.<\/span><\/p>\n<p><span style=\"font-weight: 400\">I\u2019m 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 \u201coptimizing for speed\u201d 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.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">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.\u00a0\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">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\u2019t be too many complex tasks left after this week.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-99\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.19.13-AM.png\" alt=\"\" width=\"3082\" height=\"546\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.19.13-AM.png 3082w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.19.13-AM-300x53.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.19.13-AM-768x136.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-content\/uploads\/sites\/170\/2021\/10\/Screenshot-2021-10-23-at-2.19.13-AM-1024x181.png 1024w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/2021\/10\/23\/anoushkas-status-report-for-10-23\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Anoushka&#8217;s status report for 10\/23&#8221;<\/span><\/a><\/p>\n","protected":false},"author":514,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[5],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/posts\/91"}],"collection":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/users\/514"}],"replies":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":1,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":101,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/posts\/91\/revisions\/101"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/f21-teamb1\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}