{"id":52,"date":"2024-05-10T05:32:54","date_gmt":"2024-05-10T05:32:54","guid":{"rendered":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/?page_id=52"},"modified":"2024-12-05T04:16:07","modified_gmt":"2024-12-05T04:16:07","slug":"method","status":"publish","type":"page","link":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/","title":{"rendered":"Method"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Pipeline<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png\" alt=\"\" class=\"wp-image-216\" srcset=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png 1024w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-300x166.png 300w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-768x425.png 768w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM.png 1263w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p>Our pipeline is shown above. Given&nbsp;a&nbsp;swing&nbsp;video&nbsp;clip,&nbsp;we&nbsp;first&nbsp;use&nbsp;a&nbsp;<strong>keyframe prediction module<\/strong>&nbsp;to&nbsp;estimate the keyframe,&nbsp;and then we use our <strong>detection module<\/strong> to detect the baseball bat. Finally, we apply a <strong>line fitting<\/strong> and a <strong>vanishing point detection<\/strong> algorithm to estimate and correct the hitting angle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Keyframe Prediction<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.13.27-PM-1024x594.png\" alt=\"\" class=\"wp-image-217\" srcset=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.13.27-PM-1024x594.png 1024w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.13.27-PM-300x174.png 300w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.13.27-PM-768x446.png 768w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.13.27-PM.png 1189w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p>Details of our keyframe detection module are shown above. Given an untrimmed video, we apply a coarse-to-fine approach to predict the hitting moment. First, we identify the swing action snippets within the untrimmed video, which typically correspond to a 2-3 second clip. Next, we extract image features using DINOv2 for each frame within the predicted snippet. Finally, a feed-forward layer generates keyframe confidence scores, and the frame with the highest score is selected as the keyframe<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Detection Model<\/h2>\n\n\n\n<p>Detection results are pivotal in both keyframe detection and angle estimation phases of our project. We have selected the <strong><a href=\"https:\/\/github.com\/facebookresearch\/Detic\/tree\/main\">Detic<\/a> <\/strong>model for detecting baseball bats, owing to its exceptional performance and adaptability. Detic offers comprehensive coverage across a wide range of classes within diverse datasets, which is crucial for accurately identifying specialized sports equipment such as baseball bats. Moreover, the model excels in reliably detecting and tracking baseball bats under various video conditions, ranging from professional broadcast footage to amateur recordings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hitting&nbsp;angle estimation and correction<\/h2>\n\n\n\n<p>After detecting the bat in the keyframe, we apply PCA to the bat mask to determine its orientation. However, many broadcast videos are not filmed directly behind the pitcher&#8217;s mound and are often slightly rotated and tilted. To correct the angle, we use a <a href=\"https:\/\/github.com\/fkluger\/vanishing_points_2017\"><strong>vanishing point detection model<\/strong><\/a>.<\/p>\n\n\n\n<p>The standard coordinate system is defined as below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"379\" height=\"295\" src=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/coordinate.png\" alt=\"\" class=\"wp-image-61\" style=\"width:338px;height:auto\" srcset=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/coordinate.png 379w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/coordinate-300x234.png 300w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/figure>\n<\/div>\n\n\n<p>Suppose we define the vanishing vector corresponding to the <code>x,y,z<\/code> axes to be<code> v<sub>x<\/sub>, v<sub>y<\/sub>, v<sub>z<\/sub><\/code>, and bat vector to be <code>m<\/code>. The following equation can be used to obtain the corrected hitting angle (the projected hitting angle inside the strike zone plane).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"609\" height=\"137\" src=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/eq.png\" alt=\"\" class=\"wp-image-62\" srcset=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/eq.png 609w, https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/eq-300x67.png 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Pipeline Our pipeline is shown above. Given&nbsp;a&nbsp;swing&nbsp;video&nbsp;clip,&nbsp;we&nbsp;first&nbsp;use&nbsp;a&nbsp;keyframe prediction module&nbsp;to&nbsp;estimate the keyframe,&nbsp;and then we use our detection module to detect the baseball bat. Finally, we apply a line fitting and a vanishing point detection algorithm to estimate and correct the hitting angle. Keyframe Prediction Details of our keyframe detection module are shown above. Given an untrimmed &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Method&#8221;<\/span><\/a><\/p>\n","protected":false},"author":192,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-52","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Method - Automatic Hitting Angle Estimation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Method - Automatic Hitting Angle Estimation\" \/>\n<meta property=\"og:description\" content=\"Pipeline Our pipeline is shown above. Given&nbsp;a&nbsp;swing&nbsp;video&nbsp;clip,&nbsp;we&nbsp;first&nbsp;use&nbsp;a&nbsp;keyframe prediction module&nbsp;to&nbsp;estimate the keyframe,&nbsp;and then we use our detection module to detect the baseball bat. Finally, we apply a line fitting and a vanishing point detection algorithm to estimate and correct the hitting angle. Keyframe Prediction Details of our keyframe detection module are shown above. Given an untrimmed &hellip; Continue reading &quot;Method&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/\" \/>\n<meta property=\"og:site_name\" content=\"Automatic Hitting Angle Estimation\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-05T04:16:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/\",\"url\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/\",\"name\":\"Method - Automatic Hitting Angle Estimation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/wp-content\\\/uploads\\\/sites\\\/99\\\/2024\\\/12\\\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png\",\"datePublished\":\"2024-05-10T05:32:54+00:00\",\"dateModified\":\"2024-12-05T04:16:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/wp-content\\\/uploads\\\/sites\\\/99\\\/2024\\\/12\\\/Screenshot-2024-12-04-at-11.14.30-PM.png\",\"contentUrl\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/wp-content\\\/uploads\\\/sites\\\/99\\\/2024\\\/12\\\/Screenshot-2024-12-04-at-11.14.30-PM.png\",\"width\":1263,\"height\":699},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/method\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Method\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#website\",\"url\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/\",\"name\":\"Automatic Hitting Angle Estimation\",\"description\":\"Students: Lingran Zhao, Ziyou Ren | Advisors: Deva Ramanan (CMU), Nate Chodosh (CMU), Sean Ahmed (Pittsbugh Pirates), James Bueghly (Pittsbugh Pirates)\",\"publisher\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#organization\",\"name\":\"Automatic Hitting Angle Estimation\",\"url\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/wp-content\\\/uploads\\\/sites\\\/99\\\/2024\\\/05\\\/cropped-pittsburgh_pirates.png\",\"contentUrl\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/wp-content\\\/uploads\\\/sites\\\/99\\\/2024\\\/05\\\/cropped-pittsburgh_pirates.png\",\"width\":250,\"height\":250,\"caption\":\"Automatic Hitting Angle Estimation\"},\"image\":{\"@id\":\"https:\\\/\\\/mscvprojects.ri.cmu.edu\\\/2024team1\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Method - Automatic Hitting Angle Estimation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/","og_locale":"en_US","og_type":"article","og_title":"Method - Automatic Hitting Angle Estimation","og_description":"Pipeline Our pipeline is shown above. Given&nbsp;a&nbsp;swing&nbsp;video&nbsp;clip,&nbsp;we&nbsp;first&nbsp;use&nbsp;a&nbsp;keyframe prediction module&nbsp;to&nbsp;estimate the keyframe,&nbsp;and then we use our detection module to detect the baseball bat. Finally, we apply a line fitting and a vanishing point detection algorithm to estimate and correct the hitting angle. Keyframe Prediction Details of our keyframe detection module are shown above. Given an untrimmed &hellip; Continue reading \"Method\"","og_url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/","og_site_name":"Automatic Hitting Angle Estimation","article_modified_time":"2024-12-05T04:16:07+00:00","og_image":[{"url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/","url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/","name":"Method - Automatic Hitting Angle Estimation","isPartOf":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/#primaryimage"},"image":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/#primaryimage"},"thumbnailUrl":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM-1024x567.png","datePublished":"2024-05-10T05:32:54+00:00","dateModified":"2024-12-05T04:16:07+00:00","breadcrumb":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/#primaryimage","url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM.png","contentUrl":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/12\/Screenshot-2024-12-04-at-11.14.30-PM.png","width":1263,"height":699},{"@type":"BreadcrumbList","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/method\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/"},{"@type":"ListItem","position":2,"name":"Method"}]},{"@type":"WebSite","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#website","url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/","name":"Automatic Hitting Angle Estimation","description":"Students: Lingran Zhao, Ziyou Ren | Advisors: Deva Ramanan (CMU), Nate Chodosh (CMU), Sean Ahmed (Pittsbugh Pirates), James Bueghly (Pittsbugh Pirates)","publisher":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#organization","name":"Automatic Hitting Angle Estimation","url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#\/schema\/logo\/image\/","url":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/cropped-pittsburgh_pirates.png","contentUrl":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-content\/uploads\/sites\/99\/2024\/05\/cropped-pittsburgh_pirates.png","width":250,"height":250,"caption":"Automatic Hitting Angle Estimation"},"image":{"@id":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/pages\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/users\/192"}],"replies":[{"embeddable":true,"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":6,"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/pages\/52\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/pages\/52\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/mscvprojects.ri.cmu.edu\/2024team1\/wp-json\/wp\/v2\/media?parent=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}