如果我有 x,y 坐标,如何找到网球的速度?
How to find velocity of tennis ball if I have x,y coordinates?
我目前正在从事与网球相关的计算机视觉项目。
总之,使用这个 video 和 python OpenCV
我从视频的每一帧中提取了球的 x,y
坐标。
这是我得到的 -
P.S。 x,y坐标如下format
points = [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [985, 325], [978, 345], None, None, None, None, None, [904, 613], [895, 644], [886, 649], [877, 654], [870, 658], [870, 658], [861, 664], [853, 672], [846, 679], [837, 688], [827, 695], [827, 695], [821, 707], [812, 716], [803, 729], [1051, 313], [786, 755], [786, 755], [782, 769], [782, 746], [786, 730], [793, 700], [800, 677], [800, 677], [803, 656], [807, 640], [814, 620], [819, 593], [819, 579], [819, 579], [825, 562], [831, 546], [834, 532], None, [833, 805], [833, 805], None, None, None, None, None, None, [865, 427], [867, 418], [871, 409], [872, 400], [877, 392], [877, 392], [877, 385], [883, 377], [883, 369], [887, 366], [890, 358], [890, 357], [892, 352], [894, 346], [897, 340], [898, 336], [900, 332], [900, 332], [902, 329], [905, 325], [905, 322], [908, 320], [910, 316], [910, 316], [912, 315], [914, 314], [916, 310], [919, 308], [919, 306], [919, 306], [920, 305], [924, 306], [922, 306], [926, 305], [928, 305], [926, 307], [930, 306], [930, 305], [932, 305], [933, 307], [935, 310], [935, 308], [936, 310], [937, 313], [938, 314], [940, 316], [942, 319], [942, 319], [942, 322], [943, 323], [945, 324], [946, 316], [945, 306], [945, 306], [945, 298], [946, 291], [947, 284], [947, 278], [950, 272], [949, 273], [950, 266], [951, 261], [950, 255], [950, 251], [951, 245], [951, 245], [953, 241], [952, 237], [950, 236], [945, 237], [939, 240], [938, 239], [934, 242], [928, 244], [922, 250], [917, 252], [911, 256], [911, 256], [905, 263], [899, 267], [896, 274], [890, 278], [883, 286], [883, 286], [878, 293], [873, 300], [869, 309], [863, 318], [858, 329], [858, 329], [851, 338], [846, 349], [840, 359], [835, 371], [830, 384], [830, 384], [825, 397], [818, 410], [812, 424], None, None, None, None, None, None, None, [774, 535], [773, 537], [768, 550], [761, 572], [754, 592], [750, 615], [748, 624], [748, 624], [739, 652], [733, 674], [728, 698], [727, 718], [718, 733], [718, 733], [714, 732], [709, 729], [705, 728], [702, 729], [694, 728], [696, 728], [692, 728], [688, 730], [684, 730], [678, 731], [675, 734], [675, 734], [673, 737], [667, 741], [664, 743], [659, 749], [653, 755], [653, 755], [650, 759], [647, 765], [642, 774], [636, 780], [633, 786], [633, 787], [630, 796], [625, 804], [629, 769], [634, 737], [633, 718], [633, 718], [640, 697], [644, 657], [649, 640], [651, 616], [655, 592], [654, 591], [654, 578], [656, 560], [659, 544], [662, 525], None, None, None, [668, 482], None, None, [675, 448], [675, 448], None, [677, 427], [677, 419], [678, 410], [678, 404], [678, 404], [679, 394], [682, 394], [682, 385], [682, 380], [683, 374], [683, 374], [684, 370], [684, 367], [684, 364], [685, 361], [686, 359], [686, 359], [686, 357], [686, 356], [687, 353], [686, 353], [687, 352], [687, 352], [688, 350], [687, 339], [685, 329], [687, 318], [686, 309], [687, 309], [681, 300], [686, 293], [688, 283], [689, 273], [688, 268], [689, 270], [689, 261], [688, 256], [688, 250], [689, 243], [688, 238], [688, 238], [690, 237], [690, 231], [690, 228], [691, 226], [696, 227], [699, 226], [705, 227], None, None, None, None, None, None, None, None, None, [758, 234], [758, 234], [762, 239], [769, 241], [775, 243], [780, 246], [787, 250], [787, 250], [793, 253], [800, 256], [806, 261], [812, 263], [820, 266], [820, 266], [826, 271], [832, 274], [840, 279], [845, 283], [851, 289], [852, 289], [858, 296], [866, 299], [874, 306], [879, 312], [888, 318], [888, 318], [893, 323], [900, 330], [908, 338], [914, 344], [922, 350], [922, 350], [928, 360], [937, 367], [945, 378], [950, 384], None, None, [967, 402], [974, 411], [980, 421], [989, 428], None, None, None, None, None, None, None, None, None, [1054, 518], [1061, 533], [1066, 543], [1076, 557], [1077, 558], [1087, 569], [1093, 585], [1101, 601], [1110, 614], [1119, 629], [1119, 629], [1128, 642], [1136, 662], None, None, None, None, None, None, None, None, None, None, None, [1211, 723], [1216, 718], [1220, 719], [1226, 719], [1227, 718], [1232, 718], [1238, 719], [1243, 721], [1252, 721], [1256, 721], [1256, 721], [1262, 725], [1268, 728], [1273, 731], [1280, 734], [1286, 737], [1286, 737], [1293, 742], [1298, 746], [1305, 749], None, [1299, 691], [1299, 691], [1295, 668], [1295, 649], [1288, 623], [1285, 597], [1280, 571], [1280, 571], [1277, 552], None, None, None, None, None, None, None, None, [1254, 430], [1249, 417], [1249, 417], [1246, 409], [1242, 399], [1239, 392], [1237, 384], [1234, 379], [1234, 379], [1231, 373], [1230, 367], [1227, 364], [1225, 361], [1222, 358], [1222, 358], [1220, 356], [1219, 353], [1214, 353], [1212, 352], [1209, 350], [1209, 350], [1207, 351], [1206, 350], [1204, 352], [1202, 350], [1202, 335], [1202, 335], [1200, 324], [1198, 313], None, [1194, 292], [1195, 281], [1195, 281], [1194, 273], [1191, 263], [1191, 256], [1191, 247], [1190, 239], [1190, 239], [1189, 234], [1189, 228], [1189, 221], [1188, 216], [1186, 213], [1187, 212], [1184, 209], [1183, 205], [1182, 200], [1181, 195], [1181, 195], [1181, 195], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [908, 212], [906, 222], [901, 235], [900, 235], [898, 249], [893, 263], [888, 276], [883, 292], [878, 303], [879, 303], [876, 321], [857, 673], [866, 349], [863, 365], [859, 384], [859, 384], [855, 398], [851, 411], [849, 412], [845, 413], [841, 414], [841, 414], [837, 414], [835, 413], [830, 415], [828, 416], [825, 416], [825, 416], [821, 419], [817, 421], [816, 424], [813, 425], [809, 423], [809, 423], [805, 405], [804, 378], [803, 360], [799, 340], [800, 324], [800, 324], [838, 625], None, [793, 274], [791, 259], [788, 248], [788, 248], [787, 235], [783, 224], [783, 214], [781, 204], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [856, 617], [857, 617], [860, 617], None, None, None, None, None, None, None, None, None, None, [808, 210], [814, 226], [818, 239], [820, 238], [824, 250], [830, 260], [836, 275], [839, 286], None, None, [852, 321], [858, 334], [860, 350], [868, 366], [875, 383], [875, 383], [880, 402], [885, 418], None, None, None, None, None, None, None, None, None, None, None, None, None, [975, 558], [991, 561], [991, 561], None, [997, 579], None, None, None, None, None, [1017, 577], None, [1028, 565], [942, 433], [942, 433], [943, 424], [944, 420], [946, 412], [949, 407], [948, 401], [948, 401], [948, 397], [949, 391], [950, 391], [952, 385], [954, 381], [954, 381], [954, 378], [954, 375], [955, 372], [956, 371], [956, 368], [956, 368], [956, 368], [960, 365], [959, 363], [960, 364], [961, 364], [961, 364], [963, 363], [963, 364], [962, 364], [965, 365], [967, 367], [967, 367], [967, 367], [966, 370], [966, 371], [968, 374], [969, 377], [969, 377], [969, 381], [969, 384], [969, 388], None, [972, 394], [972, 394], [971, 399], [972, 404], [973, 409], [972, 414], [973, 418], [973, 418], [973, 424], [973, 430], [972, 437], None, None, None, None, None, None, None, None, None, [973, 430], [974, 423], [974, 416], [974, 411], [974, 407], [974, 407], [973, 403], [972, 396], None, [971, 389], [973, 385], [973, 385], [972, 384], [973, 379], [972, 377], [971, 374], [972, 373], [973, 373], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [957, 372], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [946, 412], [941, 413], [935, 414], [936, 414], [929, 414], [922, 413], [914, 414], [908, 416], [902, 417], [902, 417], [894, 418], [889, 422], [882, 424], [873, 425], [867, 428], [867, 428], [861, 436], [853, 437], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [743, 536], [738, 543], [732, 552], [732, 545], [732, 545], [734, 532], None, None, [701, 583], None, None, None, None, None, [766, 425], [770, 413], [769, 414], [774, 405], [776, 392], [780, 384], [783, 374], [788, 363], [788, 363], [791, 354], [794, 346], [799, 339], [802, 331], [805, 324], [805, 324], [808, 319], [813, 312], [814, 304], [818, 299], [824, 295], [824, 295], [828, 288], [828, 285], [832, 280], [835, 276], [838, 274], [838, 274], [842, 269], [846, 266], [848, 265], [852, 262], [855, 260], [855, 260], [857, 259], [861, 256], None, [868, 253], None, None, None, None, None, None, None, None, None, None, None, [1081, 594], [1091, 586], [1091, 586], [1103, 573], [1113, 564], [1126, 553], [1140, 542], [1150, 533], [1150, 533], [1163, 523], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
video
上的这些点
如何确定每秒(30 帧)的球速。
感谢任何帮助、指点和建议。
这不是直截了当的,因为最终你会错过一个维度:如果球从相机移开,你无法知道它移动的速度或位置。您需要将轨迹投影到 3D space,但您没有执行此操作的信息。尝试搜索“reconstruction of trajectory from single camera”,例如在 this question.
然而,人们似乎已经为这个问题寻求了各种解决方案:文献中的方法将来自相机的信息与物理系统的附加信息相结合,以解决这个问题;参见例如一篇关于足球追踪的论文 here.
我目前正在从事与网球相关的计算机视觉项目。
总之,使用这个 video 和 python OpenCV
我从视频的每一帧中提取了球的 x,y
坐标。
这是我得到的 -
P.S。 x,y坐标如下format
points = [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [985, 325], [978, 345], None, None, None, None, None, [904, 613], [895, 644], [886, 649], [877, 654], [870, 658], [870, 658], [861, 664], [853, 672], [846, 679], [837, 688], [827, 695], [827, 695], [821, 707], [812, 716], [803, 729], [1051, 313], [786, 755], [786, 755], [782, 769], [782, 746], [786, 730], [793, 700], [800, 677], [800, 677], [803, 656], [807, 640], [814, 620], [819, 593], [819, 579], [819, 579], [825, 562], [831, 546], [834, 532], None, [833, 805], [833, 805], None, None, None, None, None, None, [865, 427], [867, 418], [871, 409], [872, 400], [877, 392], [877, 392], [877, 385], [883, 377], [883, 369], [887, 366], [890, 358], [890, 357], [892, 352], [894, 346], [897, 340], [898, 336], [900, 332], [900, 332], [902, 329], [905, 325], [905, 322], [908, 320], [910, 316], [910, 316], [912, 315], [914, 314], [916, 310], [919, 308], [919, 306], [919, 306], [920, 305], [924, 306], [922, 306], [926, 305], [928, 305], [926, 307], [930, 306], [930, 305], [932, 305], [933, 307], [935, 310], [935, 308], [936, 310], [937, 313], [938, 314], [940, 316], [942, 319], [942, 319], [942, 322], [943, 323], [945, 324], [946, 316], [945, 306], [945, 306], [945, 298], [946, 291], [947, 284], [947, 278], [950, 272], [949, 273], [950, 266], [951, 261], [950, 255], [950, 251], [951, 245], [951, 245], [953, 241], [952, 237], [950, 236], [945, 237], [939, 240], [938, 239], [934, 242], [928, 244], [922, 250], [917, 252], [911, 256], [911, 256], [905, 263], [899, 267], [896, 274], [890, 278], [883, 286], [883, 286], [878, 293], [873, 300], [869, 309], [863, 318], [858, 329], [858, 329], [851, 338], [846, 349], [840, 359], [835, 371], [830, 384], [830, 384], [825, 397], [818, 410], [812, 424], None, None, None, None, None, None, None, [774, 535], [773, 537], [768, 550], [761, 572], [754, 592], [750, 615], [748, 624], [748, 624], [739, 652], [733, 674], [728, 698], [727, 718], [718, 733], [718, 733], [714, 732], [709, 729], [705, 728], [702, 729], [694, 728], [696, 728], [692, 728], [688, 730], [684, 730], [678, 731], [675, 734], [675, 734], [673, 737], [667, 741], [664, 743], [659, 749], [653, 755], [653, 755], [650, 759], [647, 765], [642, 774], [636, 780], [633, 786], [633, 787], [630, 796], [625, 804], [629, 769], [634, 737], [633, 718], [633, 718], [640, 697], [644, 657], [649, 640], [651, 616], [655, 592], [654, 591], [654, 578], [656, 560], [659, 544], [662, 525], None, None, None, [668, 482], None, None, [675, 448], [675, 448], None, [677, 427], [677, 419], [678, 410], [678, 404], [678, 404], [679, 394], [682, 394], [682, 385], [682, 380], [683, 374], [683, 374], [684, 370], [684, 367], [684, 364], [685, 361], [686, 359], [686, 359], [686, 357], [686, 356], [687, 353], [686, 353], [687, 352], [687, 352], [688, 350], [687, 339], [685, 329], [687, 318], [686, 309], [687, 309], [681, 300], [686, 293], [688, 283], [689, 273], [688, 268], [689, 270], [689, 261], [688, 256], [688, 250], [689, 243], [688, 238], [688, 238], [690, 237], [690, 231], [690, 228], [691, 226], [696, 227], [699, 226], [705, 227], None, None, None, None, None, None, None, None, None, [758, 234], [758, 234], [762, 239], [769, 241], [775, 243], [780, 246], [787, 250], [787, 250], [793, 253], [800, 256], [806, 261], [812, 263], [820, 266], [820, 266], [826, 271], [832, 274], [840, 279], [845, 283], [851, 289], [852, 289], [858, 296], [866, 299], [874, 306], [879, 312], [888, 318], [888, 318], [893, 323], [900, 330], [908, 338], [914, 344], [922, 350], [922, 350], [928, 360], [937, 367], [945, 378], [950, 384], None, None, [967, 402], [974, 411], [980, 421], [989, 428], None, None, None, None, None, None, None, None, None, [1054, 518], [1061, 533], [1066, 543], [1076, 557], [1077, 558], [1087, 569], [1093, 585], [1101, 601], [1110, 614], [1119, 629], [1119, 629], [1128, 642], [1136, 662], None, None, None, None, None, None, None, None, None, None, None, [1211, 723], [1216, 718], [1220, 719], [1226, 719], [1227, 718], [1232, 718], [1238, 719], [1243, 721], [1252, 721], [1256, 721], [1256, 721], [1262, 725], [1268, 728], [1273, 731], [1280, 734], [1286, 737], [1286, 737], [1293, 742], [1298, 746], [1305, 749], None, [1299, 691], [1299, 691], [1295, 668], [1295, 649], [1288, 623], [1285, 597], [1280, 571], [1280, 571], [1277, 552], None, None, None, None, None, None, None, None, [1254, 430], [1249, 417], [1249, 417], [1246, 409], [1242, 399], [1239, 392], [1237, 384], [1234, 379], [1234, 379], [1231, 373], [1230, 367], [1227, 364], [1225, 361], [1222, 358], [1222, 358], [1220, 356], [1219, 353], [1214, 353], [1212, 352], [1209, 350], [1209, 350], [1207, 351], [1206, 350], [1204, 352], [1202, 350], [1202, 335], [1202, 335], [1200, 324], [1198, 313], None, [1194, 292], [1195, 281], [1195, 281], [1194, 273], [1191, 263], [1191, 256], [1191, 247], [1190, 239], [1190, 239], [1189, 234], [1189, 228], [1189, 221], [1188, 216], [1186, 213], [1187, 212], [1184, 209], [1183, 205], [1182, 200], [1181, 195], [1181, 195], [1181, 195], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [908, 212], [906, 222], [901, 235], [900, 235], [898, 249], [893, 263], [888, 276], [883, 292], [878, 303], [879, 303], [876, 321], [857, 673], [866, 349], [863, 365], [859, 384], [859, 384], [855, 398], [851, 411], [849, 412], [845, 413], [841, 414], [841, 414], [837, 414], [835, 413], [830, 415], [828, 416], [825, 416], [825, 416], [821, 419], [817, 421], [816, 424], [813, 425], [809, 423], [809, 423], [805, 405], [804, 378], [803, 360], [799, 340], [800, 324], [800, 324], [838, 625], None, [793, 274], [791, 259], [788, 248], [788, 248], [787, 235], [783, 224], [783, 214], [781, 204], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [856, 617], [857, 617], [860, 617], None, None, None, None, None, None, None, None, None, None, [808, 210], [814, 226], [818, 239], [820, 238], [824, 250], [830, 260], [836, 275], [839, 286], None, None, [852, 321], [858, 334], [860, 350], [868, 366], [875, 383], [875, 383], [880, 402], [885, 418], None, None, None, None, None, None, None, None, None, None, None, None, None, [975, 558], [991, 561], [991, 561], None, [997, 579], None, None, None, None, None, [1017, 577], None, [1028, 565], [942, 433], [942, 433], [943, 424], [944, 420], [946, 412], [949, 407], [948, 401], [948, 401], [948, 397], [949, 391], [950, 391], [952, 385], [954, 381], [954, 381], [954, 378], [954, 375], [955, 372], [956, 371], [956, 368], [956, 368], [956, 368], [960, 365], [959, 363], [960, 364], [961, 364], [961, 364], [963, 363], [963, 364], [962, 364], [965, 365], [967, 367], [967, 367], [967, 367], [966, 370], [966, 371], [968, 374], [969, 377], [969, 377], [969, 381], [969, 384], [969, 388], None, [972, 394], [972, 394], [971, 399], [972, 404], [973, 409], [972, 414], [973, 418], [973, 418], [973, 424], [973, 430], [972, 437], None, None, None, None, None, None, None, None, None, [973, 430], [974, 423], [974, 416], [974, 411], [974, 407], [974, 407], [973, 403], [972, 396], None, [971, 389], [973, 385], [973, 385], [972, 384], [973, 379], [972, 377], [971, 374], [972, 373], [973, 373], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [957, 372], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [946, 412], [941, 413], [935, 414], [936, 414], [929, 414], [922, 413], [914, 414], [908, 416], [902, 417], [902, 417], [894, 418], [889, 422], [882, 424], [873, 425], [867, 428], [867, 428], [861, 436], [853, 437], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, [743, 536], [738, 543], [732, 552], [732, 545], [732, 545], [734, 532], None, None, [701, 583], None, None, None, None, None, [766, 425], [770, 413], [769, 414], [774, 405], [776, 392], [780, 384], [783, 374], [788, 363], [788, 363], [791, 354], [794, 346], [799, 339], [802, 331], [805, 324], [805, 324], [808, 319], [813, 312], [814, 304], [818, 299], [824, 295], [824, 295], [828, 288], [828, 285], [832, 280], [835, 276], [838, 274], [838, 274], [842, 269], [846, 266], [848, 265], [852, 262], [855, 260], [855, 260], [857, 259], [861, 256], None, [868, 253], None, None, None, None, None, None, None, None, None, None, None, [1081, 594], [1091, 586], [1091, 586], [1103, 573], [1113, 564], [1126, 553], [1140, 542], [1150, 533], [1150, 533], [1163, 523], None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
video
上的这些点
如何确定每秒(30 帧)的球速。
感谢任何帮助、指点和建议。
这不是直截了当的,因为最终你会错过一个维度:如果球从相机移开,你无法知道它移动的速度或位置。您需要将轨迹投影到 3D space,但您没有执行此操作的信息。尝试搜索“reconstruction of trajectory from single camera”,例如在 this question.
然而,人们似乎已经为这个问题寻求了各种解决方案:文献中的方法将来自相机的信息与物理系统的附加信息相结合,以解决这个问题;参见例如一篇关于足球追踪的论文 here.