Как отслеживать перемещение точек в списке списков?
У меня длинный список. Этот список содержит 60 подсписок, то есть 60 изображений, каждый подсписок содержит 30 подсписок, то есть 30 точек (координаты x и y). Как найти для каждой точки изображения ее ближайшую точку на следующем изображении? Таким образом, в конце концов, я могу отслеживать движение каждой из этих 30 точек.
[[[[99, 87, 10], [212, 271, 10], [224, 394, 10], [394, 178, 10], [155, 91, 10], [297, 107, 10], [406, 52, 10], [349, 427, 10], [149, 118, 10], [184, 199, 10], [185, 247, 10], [62, 232, 10], [63, 71, 10], [205, 46, 10], [381, 74, 10], [255, 389, 10], [98, 143, 9], [99, 373, 10], [55, 341, 10], [89, 195, 10], [305, 182, 10], [263, 255, 9], [345, 62, 9], [226, 235, 9], [242, 142, 9], [379, 35, 9], [391, 265, 9], [205, 151, 9], [335, 397, 9], [122, 211, 9]]], [[[347, 425, 10], [64, 75, 10], [399, 184, 10], [178, 244, 10], [292, 106, 10], [379, 35, 10], [383, 71, 10], [184, 200, 10], [212, 271, 10], [406, 52, 10], [302, 181, 10], [149, 87, 10], [245, 142, 10], [221, 238, 10], [93, 145, 10], [211, 146, 10], [51, 339, 10], [223, 392, 9], [97, 93, 10], [345, 61, 9], [63, 230, 9], [91, 197, 10], [141, 121, 10], [262, 263, 10], [392, 259, 9], [100, 369, 9], [207, 44, 9], [127, 212, 9], [254, 389, 9]]], [[[212, 269, 9], [383, 71, 10], [184, 200, 10], [296, 178, 10], [69, 80, 10], [173, 247, 10], [409, 56, 10], [140, 122, 10], [207, 45, 10], [394, 257, 10], [403, 187, 10], [64, 224, 10], [91, 205, 10], [148, 87, 10], [51, 337, 10], [223, 392, 10], [218, 148, 10], [93, 99, 10], [248, 143, 10], [339, 59, 10], [91, 145, 10], [323, 400, 10], [261, 263, 10], [289, 106, 9], [254, 382, 10], [343, 422, 9], [134, 214, 9], [217, 242, 9], [383, 40, 9], [103, 363, 9]]], [[[383, 74, 10], [208, 271, 10], [220, 146, 10], [253, 143, 10], [394, 257, 10], [212, 43, 10], [321, 401, 10], [212, 239, 10], [343, 422, 10], [136, 123, 10], [383, 43, 10], [93, 103, 10], [135, 214, 10], [333, 56, 10], [409, 59, 10], [110, 359, 10], [177, 205, 10], [260, 263, 10], [293, 177, 10], [69, 80, 9], [409, 190, 10], [50, 331, 10], [92, 207, 9], [254, 380, 9], [148, 87, 9], [169, 250, 9], [65, 219, 9], [220, 385, 9], [283, 107, 9], [87, 149, 9]]], [[[95, 106, 10], [110, 356, 10], [317, 406, 10], [223, 383, 10], [344, 421, 10], [136, 124, 10], [142, 88, 10], [164, 256, 10], [47, 328, 10], [253, 376, 10], [277, 107, 10], [68, 82, 10], [383, 45, 10], [255, 142, 10], [214, 41, 10], [291, 176, 10], [221, 146, 9], [412, 193, 10], [409, 61, 10], [171, 206, 10], [260, 263, 10], [207, 237, 10], [95, 211, 9], [65, 217, 9], [395, 255, 10], [208, 271, 9], [326, 53, 9], [136, 215, 9], [86, 154, 9], [385, 79, 9]]], [[[343, 418, 9], [203, 271, 10], [113, 353, 10], [254, 368, 10], [67, 82, 10], [135, 88, 10], [315, 406, 10], [214, 40, 10], [223, 145, 10], [269, 106, 10], [407, 58, 10], [225, 386, 10], [97, 111, 10], [259, 145, 10], [169, 201, 10], [205, 238, 10], [399, 249, 9], [254, 261, 9], [387, 80, 9], [97, 215, 10], [142, 215, 9], [83, 157, 9], [47, 327, 9], [284, 173, 9], [413, 195, 9], [59, 212, 9], [136, 128, 9], [161, 259, 9], [320, 50, 9], [382, 46, 9]]], [[[45, 322, 10], [134, 129, 10], [142, 214, 10], [75, 154, 10], [262, 142, 10], [311, 406, 10], [278, 169, 10], [257, 361, 10], [97, 115, 10], [119, 351, 10], [215, 35, 10], [169, 203, 10], [223, 140, 10], [383, 47, 10], [253, 260, 10], [202, 271, 10], [202, 236, 10], [412, 200, 10], [413, 52, 9], [97, 219, 10], [343, 413, 10], [401, 247, 9], [268, 103, 10], [160, 261, 9], [64, 82, 9], [387, 79, 9], [316, 51, 9], [58, 211, 9], [134, 91, 9]]], [[[195, 274, 10], [313, 47, 10], [97, 219, 10], [415, 205, 10], [73, 158, 10], [57, 83, 10], [169, 201, 10], [57, 209, 10], [232, 382, 10], [266, 103, 10], [159, 261, 10], [275, 167, 10], [399, 241, 10], [387, 77, 10], [225, 134, 10], [267, 139, 9], [343, 410, 9], [413, 49, 9], [143, 214, 10], [251, 261, 10], [199, 235, 9], [257, 361, 10], [41, 317, 9], [122, 350, 10], [304, 409, 9], [91, 119, 9], [128, 130, 9], [215, 31, 9], [133, 91, 9], [381, 49, 9]]], [[[233, 382, 9], [130, 93, 10], [69, 160, 10], [41, 317, 10], [398, 236, 10], [190, 281, 10], [89, 119, 10], [143, 215, 10], [217, 28, 10], [125, 129, 10], [344, 404, 10], [247, 262, 10], [413, 47, 10], [167, 200, 10], [395, 76, 10], [297, 412, 10], [271, 137, 10], [309, 49, 10], [49, 83, 10], [263, 358, 10], [55, 202, 9], [379, 50, 9], [154, 265, 9], [223, 129, 9], [415, 205, 9], [130, 353, 9], [191, 233, 9], [275, 167, 9], [100, 221, 9], [263, 97, 9]]], [[[146, 223, 9], [261, 92, 10], [183, 283, 9], [267, 355, 9], [382, 49, 10], [397, 76, 10], [46, 76, 10], [68, 160, 10], [43, 315, 10], [123, 91, 10], [412, 47, 10], [417, 206, 10], [272, 137, 10], [236, 383, 10], [345, 401, 10], [273, 167, 10], [99, 223, 10], [223, 128, 9], [133, 353, 10], [307, 43, 10], [119, 124, 10], [188, 238, 9], [153, 265, 10], [398, 231, 9], [57, 199, 10], [218, 27, 9], [297, 412, 9], [166, 195, 9], [245, 260, 9], [89, 119, 9]]], [[[218, 21, 10], [225, 122, 10], [268, 171, 10], [41, 313, 10], [122, 91, 10], [344, 398, 10], [295, 417, 10], [239, 388, 10], [242, 259, 10], [62, 163, 10], [184, 241, 10], [148, 225, 10], [303, 41, 10], [149, 265, 10], [137, 356, 9], [279, 139, 10], [88, 119, 10], [100, 230, 10], [400, 230, 9], [260, 92, 9], [418, 206, 10], [401, 75, 9], [167, 188, 9], [44, 76, 10], [58, 196, 9], [412, 47, 9], [269, 349, 9], [119, 123, 9], [385, 50, 9]]], [[[403, 77, 10], [412, 41, 10], [57, 195, 10], [271, 349, 10], [172, 286, 10], [44, 73, 10], [41, 309, 10], [299, 37, 10], [419, 208, 10], [383, 49, 10], [400, 229, 10], [245, 389, 10], [237, 256, 10], [57, 166, 10], [118, 124, 10], [151, 231, 10], [255, 91, 10], [184, 243, 10], [88, 121, 10], [118, 88, 10], [100, 231, 10], [224, 115, 9], [295, 419, 10], [267, 173, 10], [345, 397, 9], [283, 136, 9], [142, 268, 9], [137, 359, 9], [167, 181, 9], [217, 15, 9]]], [[[179, 248, 10], [250, 86, 10], [297, 35, 10], [58, 166, 10], [170, 287, 10], [292, 422, 10], [152, 231, 10], [220, 112, 10], [215, 13, 10], [268, 178, 10], [41, 308, 10], [277, 347, 10], [100, 237, 10], [421, 207, 10], [56, 194, 10], [245, 389, 10], [403, 238, 10], [139, 269, 10], [410, 35, 10], [81, 124, 10], [235, 255, 10], [284, 137, 10], [169, 179, 10], [141, 365, 10], [346, 395, 9], [116, 88, 9], [118, 124, 9], [385, 52, 9], [38, 69, 9], [407, 83, 9]]], [[[285, 136, 10], [285, 424, 10], [169, 178, 10], [409, 83, 10], [165, 291, 10], [248, 392, 10], [115, 123, 10], [405, 29, 10], [61, 195, 10], [82, 127, 10], [247, 87, 10], [269, 183, 10], [279, 346, 10], [217, 11, 10], [151, 232, 10], [43, 304, 10], [351, 391, 10], [405, 241, 10], [58, 166, 10], [388, 57, 10], [35, 63, 9], [293, 34, 10], [113, 86, 10], [178, 250, 9], [100, 245, 9], [214, 109, 9], [235, 256, 10], [421, 208, 9], [139, 271, 9], [145, 369, 9]]], [[[67, 199, 10], [410, 88, 10], [227, 257, 10], [136, 279, 10], [209, 106, 10], [56, 169, 10], [217, 10, 10], [40, 301, 10], [389, 57, 10], [109, 80, 10], [147, 373, 10], [250, 395, 10], [291, 133, 10], [113, 129, 10], [243, 88, 10], [152, 233, 10], [163, 295, 10], [410, 243, 10], [423, 212, 10], [269, 187, 10], [33, 57, 9], [83, 127, 9], [283, 428, 9], [170, 175, 9], [355, 385, 9], [178, 256, 9], [405, 29, 9], [290, 34, 9], [101, 251, 9], [284, 344, 9]]], [[[409, 89, 10], [236, 91, 9], [106, 74, 10], [283, 429, 9], [355, 379, 10], [421, 213, 10], [37, 301, 10], [416, 248, 10], [283, 33, 10], [179, 263, 10], [391, 56, 10], [267, 191, 10], [225, 257, 10], [135, 285, 10], [153, 375, 10], [100, 256, 9], [209, 104, 9], [83, 128, 9], [292, 131, 9], [163, 297, 10], [112, 129, 10], [52, 172, 9], [291, 343, 9], [170, 166, 9], [31, 53, 9], [215, 9, 10], [155, 239, 9], [403, 29, 9], [71, 197, 9], [257, 397, 9]]], [[[281, 433, 9], [235, 89, 10], [359, 373, 10], [278, 28, 10], [409, 89, 10], [422, 248, 10], [262, 399, 10], [161, 302, 10], [295, 344, 10], [159, 379, 10], [387, 55, 10], [215, 8, 10], [111, 136, 10], [33, 295, 10], [51, 173, 10], [109, 69, 10], [134, 285, 10], [81, 136, 10], [292, 130, 10], [173, 160, 9], [401, 28, 9], [77, 197, 10], [219, 253, 10], [105, 257, 10], [208, 101, 9], [157, 247, 9], [29, 51, 9], [179, 269, 9], [267, 193, 9]]], [[[178, 153, 10], [401, 29, 10], [262, 199, 9], [153, 253, 9], [412, 94, 10], [207, 98, 10], [427, 244, 10], [163, 382, 10], [85, 196, 10], [112, 141, 10], [77, 142, 10], [418, 217, 10], [105, 260, 10], [278, 21, 10], [295, 125, 10], [359, 371, 9], [46, 177, 9], [134, 284, 10], [32, 293, 9], [29, 46, 10], [177, 274, 10], [217, 247, 10], [290, 430, 9], [235, 91, 10], [158, 309, 9], [265, 401, 9], [302, 344, 9], [382, 52, 9], [111, 67, 9]]], [[[275, 17, 10], [412, 103, 9], [207, 98, 10], [76, 149, 10], [109, 266, 10], [299, 119, 10], [400, 26, 10], [151, 257, 10], [217, 243, 10], [376, 49, 10], [159, 311, 10], [261, 199, 10], [267, 401, 10], [297, 429, 10], [175, 278, 10], [220, 9, 10], [415, 217, 10], [181, 148, 9], [89, 199, 10], [31, 43, 9], [43, 184, 10], [235, 83, 9], [164, 386, 9], [31, 293, 10], [361, 367, 9], [431, 247, 9], [304, 345, 9], [131, 287, 9], [111, 58, 9]]], [[[299, 119, 10], [77, 151, 10], [399, 26, 10], [187, 145, 10], [205, 91, 10], [92, 199, 10], [301, 422, 10], [165, 386, 10], [409, 218, 10], [127, 292, 10], [224, 13, 10], [307, 344, 10], [106, 271, 10], [40, 188, 10], [374, 50, 10], [117, 149, 10], [273, 16, 10], [361, 367, 10], [29, 296, 10], [433, 249, 10], [256, 202, 10], [411, 109, 10], [236, 77, 9], [151, 259, 9], [160, 313, 9], [173, 280, 9], [116, 56, 9], [218, 239, 9], [268, 403, 9], [33, 37, 9]]], [[[313, 349, 10], [367, 47, 10], [395, 22, 10], [201, 88, 10], [172, 281, 10], [97, 200, 10], [125, 296, 10], [187, 145, 10], [226, 14, 10], [433, 250, 10], [271, 404, 10], [297, 413, 10], [401, 219, 10], [307, 116, 10], [79, 158, 10], [116, 153, 10], [39, 31, 10], [163, 314, 10], [105, 272, 10], [25, 297, 9], [166, 387, 10], [250, 202, 10], [364, 359, 10], [151, 261, 10], [35, 193, 9], [219, 238, 9], [233, 70, 9], [266, 17, 9], [410, 110, 9]]], [[[226, 15, 10], [151, 261, 9], [21, 296, 10], [247, 201, 10], [364, 50, 10], [389, 20, 10], [271, 404, 10], [314, 349, 10], [194, 143, 10], [410, 112, 10], [32, 199, 10], [167, 386, 10], [107, 272, 10], [113, 159, 10], [401, 219, 10], [121, 46, 10], [307, 109, 10], [219, 237, 10], [364, 357, 10], [299, 412, 10], [235, 63, 10], [79, 159, 9], [123, 298, 10], [169, 283, 9], [103, 194, 9], [194, 86, 9], [433, 251, 9], [41, 26, 9], [263, 17, 9], [166, 313, 9]]], [[[407, 113, 10], [109, 271, 10], [147, 262, 10], [226, 16, 10], [118, 164, 10], [118, 302, 10], [123, 39, 10], [16, 296, 10], [309, 107, 10], [169, 284, 10], [399, 223, 10], [301, 411, 10], [241, 58, 10], [80, 161, 10], [431, 242, 10], [241, 201, 10], [31, 207, 10], [109, 193, 10], [364, 353, 10], [320, 353, 10], [197, 147, 10], [263, 19, 9], [358, 51, 9], [46, 23, 9], [191, 79, 9], [220, 237, 9], [386, 20, 9], [166, 314, 9], [167, 385, 9], [271, 404, 9]]], [[[203, 151, 9], [167, 319, 10], [191, 79, 10], [364, 347, 10], [272, 405, 10], [27, 212, 10], [111, 193, 10], [167, 285, 10], [221, 230, 10], [241, 56, 10], [13, 298, 10], [313, 100, 10], [398, 223, 10], [322, 353, 10], [45, 21, 10], [379, 21, 10], [110, 273, 10], [117, 304, 10], [357, 51, 10], [260, 17, 9], [170, 385, 9], [125, 38, 10], [302, 410, 9], [238, 203, 9], [400, 116, 9], [145, 263, 10], [230, 17, 9], [431, 236, 9], [80, 163, 9], [124, 166, 9]]], [[[361, 341, 10], [124, 166, 10], [117, 195, 10], [325, 353, 10], [395, 226, 10], [224, 232, 10], [394, 115, 10], [315, 97, 10], [193, 75, 10], [272, 403, 10], [22, 217, 10], [9, 303, 9], [230, 17, 10], [355, 50, 10], [431, 231, 9], [113, 273, 9], [171, 382, 9], [237, 207, 10], [169, 290, 9], [173, 323, 10], [259, 17, 9], [81, 161, 10], [207, 151, 9], [127, 37, 9], [377, 22, 9], [239, 55, 9], [115, 311, 9], [305, 409, 9], [43, 16, 9], [145, 269, 9]]], [[[392, 226, 9], [357, 340, 10], [167, 295, 10], [315, 92, 10], [392, 112, 10], [237, 207, 10], [371, 23, 10], [176, 325, 10], [16, 221, 10], [231, 23, 10], [143, 272, 10], [122, 199, 10], [8, 305, 10], [113, 274, 10], [130, 32, 10], [225, 232, 10], [196, 69, 10], [261, 10, 10], [239, 52, 10], [331, 357, 10], [38, 11, 10], [88, 165, 9], [429, 229, 9], [172, 379, 9], [274, 405, 9], [352, 50, 9], [110, 316, 9], [127, 169, 9], [311, 405, 9], [214, 151, 9]]], [[[91, 169, 10], [125, 169, 10], [365, 17, 10], [142, 271, 10], [386, 230, 10], [163, 298, 10], [386, 112, 10], [170, 376, 10], [232, 202, 10], [10, 313, 10], [316, 86, 10], [347, 53, 10], [131, 27, 10], [357, 338, 10], [331, 357, 10], [218, 151, 10], [179, 326, 9], [225, 231, 10], [231, 22, 10], [116, 274, 10], [241, 49, 9], [313, 403, 10], [278, 409, 9], [430, 224, 9], [11, 224, 9], [37, 9, 10], [109, 323, 9], [199, 63, 9], [125, 203, 9]]], [[[385, 109, 9], [278, 409, 9], [10, 223, 9], [331, 357, 9], [215, 230, 10], [10, 320, 10], [100, 326, 10], [221, 153, 10], [315, 403, 10], [429, 223, 10], [169, 369, 10], [115, 280, 10], [263, 11, 10], [37, 9, 10], [157, 303, 10], [203, 62, 10], [229, 23, 10], [379, 230, 9], [127, 170, 10], [182, 323, 9], [359, 17, 10], [142, 271, 9], [91, 169, 9], [127, 208, 9], [131, 26, 9], [357, 331, 9], [317, 83, 9], [343, 58, 9], [239, 49, 9]]], [[[281, 413, 10], [29, 13, 10], [211, 224, 10], [356, 329, 10], [187, 319, 10], [128, 211, 10], [265, 11, 10], [167, 369, 10], [130, 175, 10], [139, 268, 10], [334, 353, 10], [206, 59, 10], [99, 167, 10], [233, 52, 10], [428, 223, 10], [379, 104, 10], [134, 25, 10], [97, 327, 10], [314, 79, 10], [316, 403, 10], [152, 303, 10], [338, 62, 9], [111, 286, 10], [233, 201, 9], [226, 159, 9], [377, 230, 9], [10, 326, 9], [224, 22, 9], [357, 19, 9]]], [[[375, 232, 10], [137, 25, 10], [317, 401, 10], [10, 328, 10], [335, 352, 10], [353, 20, 10], [206, 58, 10], [379, 103, 10], [225, 23, 10], [310, 73, 10], [271, 15, 10], [353, 326, 10], [188, 315, 10], [285, 419, 10], [92, 323, 10], [233, 51, 10], [128, 213, 10], [231, 196, 10], [13, 217, 10], [163, 368, 9], [230, 164, 9], [208, 219, 9], [337, 62, 9], [23, 13, 9], [423, 217, 9], [110, 286, 9], [133, 175, 9], [137, 268, 9], [149, 303, 9], [101, 167, 9]]], [[[225, 164, 10], [188, 309, 10], [373, 237, 9], [145, 25, 10], [9, 329, 10], [419, 214, 10], [325, 399, 10], [131, 267, 10], [227, 193, 10], [285, 419, 10], [308, 67, 10], [89, 323, 10], [231, 21, 10], [335, 352, 10], [207, 215, 10], [353, 320, 9], [110, 291, 10], [337, 62, 9], [105, 163, 10], [232, 52, 9], [19, 15, 9], [207, 59, 9], [13, 214, 9], [272, 19, 9], [377, 100, 9], [135, 181, 9], [135, 217, 9], [149, 303, 9], [349, 19, 9]]], [[[236, 55, 9], [88, 323, 10], [337, 346, 10], [286, 422, 10], [333, 400, 10], [347, 19, 10], [350, 313, 10], [417, 207, 10], [112, 292, 10], [129, 265, 10], [159, 374, 10], [235, 20, 10], [205, 51, 10], [149, 23, 10], [274, 21, 10], [340, 70, 10], [9, 329, 10], [16, 16, 9], [371, 97, 9], [308, 61, 9], [136, 218, 9], [370, 239, 10], [227, 195, 9], [149, 303, 9], [136, 182, 9], [107, 161, 9], [16, 211, 9], [226, 166, 9], [191, 305, 9], [201, 211, 9]]], [[[363, 243, 9], [334, 400, 9], [226, 194, 10], [143, 217, 10], [347, 308, 10], [151, 302, 10], [83, 325, 10], [129, 263, 10], [286, 425, 10], [236, 21, 10], [155, 375, 10], [19, 203, 10], [9, 337, 10], [337, 77, 10], [197, 203, 10], [195, 303, 10], [205, 44, 9], [155, 28, 10], [220, 164, 10], [347, 19, 10], [307, 55, 10], [112, 158, 9], [235, 59, 9], [370, 98, 9], [115, 299, 10], [339, 343, 10], [137, 184, 9], [15, 16, 9], [415, 201, 9], [275, 22, 9]]], [[[277, 23, 10], [206, 43, 10], [149, 214, 10], [230, 194, 10], [304, 52, 10], [335, 79, 10], [239, 25, 10], [339, 341, 10], [127, 256, 10], [116, 155, 10], [196, 203, 10], [340, 21, 10], [161, 32, 9], [139, 183, 10], [19, 195, 10], [151, 375, 9], [14, 16, 9], [151, 298, 9], [237, 67, 9], [85, 325, 9], [9, 341, 10], [121, 298, 10], [415, 196, 10], [357, 245, 10], [196, 302, 9], [285, 431, 9], [220, 166, 9], [368, 98, 9], [346, 305, 9], [337, 401, 9]]], [[[161, 32, 9], [367, 98, 9], [214, 165, 10], [331, 83, 9], [10, 15, 10], [151, 214, 10], [236, 74, 10], [339, 335, 10], [127, 253, 10], [205, 38, 10], [230, 194, 10], [290, 431, 10], [280, 28, 10], [416, 190, 10], [83, 326, 10], [335, 26, 10], [115, 154, 10], [119, 298, 10], [195, 201, 10], [141, 183, 10], [304, 46, 10], [22, 193, 10], [357, 247, 10], [151, 298, 9], [199, 298, 9], [239, 25, 9], [339, 301, 9], [343, 403, 9], [146, 377, 9]]], [[[165, 37, 9], [236, 75, 10], [208, 167, 9], [346, 406, 10], [247, 28, 10], [11, 14, 10], [200, 292, 10], [331, 88, 10], [121, 298, 10], [416, 190, 10], [13, 344, 10], [122, 247, 10], [359, 248, 10], [291, 431, 10], [202, 35, 10], [333, 301, 10], [338, 334, 10], [232, 197, 9], [329, 29, 9], [149, 295, 9], [151, 213, 10], [23, 194, 10], [193, 195, 9], [146, 377, 9], [275, 35, 9], [80, 328, 9], [358, 97, 9], [146, 179, 9], [117, 151, 9], [305, 45, 9]]], [[[117, 292, 10], [119, 143, 10], [328, 28, 10], [417, 183, 10], [200, 197, 10], [358, 99, 10], [171, 40, 10], [329, 93, 10], [205, 167, 10], [200, 32, 10], [149, 178, 10], [28, 194, 10], [307, 45, 10], [327, 298, 10], [338, 332, 10], [142, 380, 10], [299, 431, 9], [151, 213, 10], [359, 250, 10], [20, 345, 10], [273, 38, 10], [11, 13, 10], [202, 290, 9], [238, 197, 9], [247, 28, 9], [346, 407, 9], [76, 328, 9], [235, 77, 9], [121, 239, 9], [149, 291, 9]]], [[[149, 209, 10], [328, 94, 10], [200, 166, 10], [358, 99, 10], [21, 345, 10], [241, 197, 10], [147, 286, 10], [232, 82, 10], [308, 51, 10], [349, 411, 10], [356, 254, 10], [413, 176, 10], [170, 43, 10], [273, 38, 10], [329, 29, 10], [247, 23, 10], [118, 292, 10], [141, 381, 10], [76, 327, 9], [299, 430, 10], [197, 25, 10], [122, 139, 9], [200, 197, 10], [28, 193, 9], [121, 237, 9], [149, 177, 9], [328, 296, 9], [203, 286, 9]]], [[[26, 346, 10], [248, 197, 10], [341, 326, 10], [171, 46, 10], [201, 283, 10], [123, 139, 10], [197, 167, 10], [201, 197, 10], [304, 430, 10], [232, 83, 10], [147, 285, 10], [412, 173, 10], [141, 382, 10], [199, 23, 10], [327, 295, 10], [351, 418, 10], [355, 254, 10], [151, 207, 10], [148, 171, 10], [31, 191, 10], [119, 292, 10], [75, 326, 9], [274, 44, 9], [335, 37, 9], [358, 106, 9], [313, 57, 9], [251, 20, 9], [119, 235, 9]]], [[[305, 427, 10], [326, 99, 10], [352, 422, 10], [128, 136, 10], [148, 170, 10], [226, 88, 10], [27, 347, 10], [121, 231, 10], [254, 21, 10], [201, 281, 10], [341, 322, 10], [355, 262, 10], [152, 201, 10], [202, 202, 10], [339, 39, 10], [73, 323, 9], [137, 389, 10], [193, 165, 10], [314, 57, 10], [149, 283, 10], [356, 109, 10], [37, 187, 10], [327, 293, 10], [411, 175, 9], [121, 292, 9], [277, 47, 9], [171, 47, 9], [197, 17, 9], [10, 8, 9]]], [[[39, 184, 10], [203, 207, 9], [147, 164, 10], [152, 200, 10], [355, 267, 10], [17, 11, 10], [321, 103, 10], [339, 40, 10], [151, 281, 10], [346, 319, 10], [356, 116, 10], [136, 392, 10], [257, 19, 10], [316, 59, 10], [71, 322, 10], [307, 425, 10], [185, 169, 10], [171, 50, 10], [29, 347, 9], [260, 195, 10], [411, 171, 10], [277, 47, 10], [325, 292, 10], [199, 10, 9], [355, 424, 10], [119, 291, 9], [131, 137, 10], [122, 230, 9], [201, 274, 9], [221, 89, 9]]], [[[203, 209, 10], [200, 10, 10], [20, 11, 10], [261, 17, 10], [316, 59, 10], [320, 109, 10], [167, 56, 10], [353, 118, 10], [35, 344, 10], [154, 283, 10], [323, 291, 10], [305, 417, 10], [407, 164, 10], [355, 267, 10], [281, 53, 9], [136, 397, 10], [69, 317, 10], [346, 317, 10], [263, 195, 10], [135, 136, 10], [205, 269, 9], [221, 89, 10], [359, 431, 10], [127, 225, 9], [147, 194, 9], [38, 182, 9], [345, 45, 10], [121, 291, 9], [151, 160, 9], [185, 169, 9]]], [[[209, 266, 10], [139, 134, 10], [319, 110, 10], [349, 46, 10], [356, 274, 10], [261, 17, 10], [157, 159, 10], [39, 179, 10], [69, 313, 10], [37, 344, 10], [405, 157, 10], [141, 190, 10], [182, 170, 10], [350, 121, 10], [349, 314, 9], [323, 289, 10], [26, 11, 10], [359, 433, 10], [158, 285, 9], [130, 223, 10], [284, 57, 9], [319, 58, 9], [124, 287, 9], [266, 196, 9], [311, 413, 9], [165, 61, 9], [213, 88, 9], [136, 397, 9], [203, 211, 9], [200, 10, 9]]], [[[203, 214, 10], [130, 284, 10], [316, 110, 10], [40, 173, 10], [325, 58, 10], [310, 412, 10], [357, 433, 10], [405, 155, 10], [349, 122, 10], [352, 49, 10], [68, 313, 10], [212, 266, 10], [39, 344, 10], [160, 287, 10], [201, 8, 10], [130, 219, 10], [184, 171, 10], [213, 87, 10], [136, 399, 10], [139, 187, 9], [139, 135, 10], [263, 13, 10], [322, 287, 10], [266, 195, 9], [164, 62, 9], [357, 281, 9], [157, 158, 9], [286, 58, 9], [26, 10, 9], [353, 309, 9]]], [[[217, 265, 10], [361, 281, 10], [350, 431, 10], [309, 411, 10], [329, 59, 10], [46, 345, 10], [358, 52, 10], [128, 401, 10], [272, 191, 10], [131, 284, 10], [139, 133, 10], [206, 217, 10], [315, 111, 10], [128, 217, 10], [137, 184, 10], [349, 123, 10], [157, 160, 10], [31, 8, 10], [40, 167, 10], [213, 85, 10], [320, 285, 10], [290, 58, 9], [209, 10, 9], [163, 292, 9], [399, 151, 9], [184, 175, 9], [268, 10, 9], [159, 67, 9], [353, 309, 9]]], [[[331, 59, 10], [365, 281, 10], [61, 310, 10], [291, 59, 10], [363, 55, 10], [158, 68, 10], [214, 11, 10], [275, 189, 10], [399, 151, 10], [208, 79, 10], [310, 113, 10], [349, 124, 10], [122, 401, 10], [320, 285, 10], [167, 292, 10], [44, 160, 10], [269, 8, 10], [309, 409, 10], [123, 212, 10], [187, 179, 10], [349, 431, 10], [220, 265, 10], [137, 279, 9], [51, 338, 9], [203, 220, 9], [137, 183, 10], [37, 13, 9], [157, 160, 9], [139, 133, 9], [352, 308, 9]]], [[[352, 308, 10], [316, 281, 10], [118, 405, 10], [369, 281, 10], [37, 13, 10], [332, 59, 10], [346, 131, 10], [363, 53, 10], [220, 265, 10], [297, 61, 10], [393, 147, 10], [142, 275, 10], [143, 188, 9], [137, 129, 10], [170, 292, 10], [271, 8, 10], [203, 221, 9], [157, 68, 9], [308, 115, 9], [205, 79, 9], [52, 339, 9], [275, 188, 9], [347, 431, 9], [157, 161, 9], [43, 154, 9], [53, 309, 9], [122, 211, 9], [311, 403, 9]]], [[[143, 275, 9], [205, 79, 9], [155, 67, 10], [46, 307, 10], [369, 280, 10], [280, 188, 10], [160, 163, 10], [205, 223, 10], [148, 193, 10], [389, 146, 10], [171, 293, 10], [119, 208, 10], [221, 266, 10], [346, 135, 10], [315, 398, 10], [297, 61, 10], [43, 153, 10], [333, 58, 10], [115, 405, 9], [368, 50, 10], [219, 11, 9], [134, 125, 9], [58, 344, 9], [339, 431, 9], [278, 11, 9], [193, 185, 9], [315, 277, 9], [353, 307, 9], [38, 14, 9], [307, 115, 9]]], [[[225, 268, 10], [341, 140, 10], [193, 185, 10], [39, 307, 10], [314, 275, 10], [165, 164, 10], [368, 50, 10], [117, 203, 10], [206, 223, 10], [301, 64, 10], [335, 57, 10], [286, 191, 10], [220, 13, 10], [333, 429, 10], [149, 191, 10], [38, 15, 10], [111, 404, 10], [131, 124, 10], [386, 139, 10], [373, 275, 10], [171, 301, 10], [283, 13, 10], [41, 148, 9], [58, 344, 9], [355, 307, 9], [202, 74, 9], [145, 280, 9], [301, 116, 9], [319, 392, 9]]], [[[357, 302, 10], [149, 191, 10], [290, 14, 10], [308, 271, 10], [230, 275, 10], [146, 281, 10], [327, 391, 10], [127, 124, 10], [143, 57, 10], [201, 67, 10], [105, 407, 10], [207, 229, 10], [374, 45, 10], [41, 147, 10], [327, 427, 10], [177, 304, 10], [337, 59, 9], [295, 119, 9], [381, 137, 10], [221, 11, 10], [290, 188, 9], [37, 309, 10], [375, 269, 9], [169, 167, 9], [305, 67, 9], [40, 17, 9], [191, 191, 9], [59, 345, 9], [339, 145, 9]]], [[[207, 231, 9], [200, 65, 10], [305, 67, 10], [380, 139, 10], [44, 143, 10], [359, 302, 10], [376, 44, 10], [45, 17, 10], [191, 193, 10], [335, 153, 10], [35, 309, 10], [119, 121, 10], [117, 196, 10], [147, 285, 10], [231, 278, 10], [291, 116, 10], [319, 425, 10], [100, 407, 9], [143, 56, 9], [289, 187, 10], [334, 391, 9], [340, 57, 9], [182, 307, 10], [149, 191, 9], [65, 349, 9], [307, 271, 9], [290, 14, 9], [229, 11, 9], [375, 265, 9], [169, 169, 9]]], [[[49, 19, 10], [167, 169, 10], [344, 55, 10], [142, 55, 10], [68, 347, 10], [338, 385, 10], [359, 298, 10], [193, 193, 10], [287, 117, 10], [152, 191, 10], [46, 140, 10], [29, 309, 10], [117, 119, 10], [314, 423, 10], [205, 235, 10], [93, 404, 10], [152, 291, 10], [374, 261, 10], [295, 182, 10], [379, 43, 9], [295, 16, 9], [231, 286, 9], [231, 11, 9], [307, 268, 9], [115, 190, 9], [376, 137, 9], [197, 62, 9], [310, 71, 9], [337, 157, 9]]], [[[171, 166, 10], [25, 309, 9], [307, 424, 10], [191, 316, 10], [364, 293, 10], [152, 191, 10], [152, 292, 10], [193, 59, 10], [196, 199, 10], [296, 181, 10], [307, 266, 10], [231, 11, 10], [343, 50, 10], [296, 17, 10], [68, 349, 10], [287, 118, 10], [337, 159, 10], [115, 118, 10], [371, 257, 10], [339, 382, 10], [141, 49, 10], [235, 291, 10], [47, 140, 10], [202, 238, 9], [53, 20, 9], [376, 137, 9], [311, 79, 9], [93, 403, 9], [112, 187, 9], [385, 39, 9]]], [[[110, 117, 10], [339, 382, 10], [154, 292, 10], [196, 202, 10], [298, 178, 10], [178, 164, 10], [238, 14, 10], [304, 425, 10], [375, 135, 10], [386, 40, 10], [52, 23, 10], [153, 191, 10], [308, 259, 10], [191, 322, 10], [344, 45, 10], [141, 46, 10], [235, 293, 10], [201, 247, 10], [111, 184, 10], [88, 398, 9], [22, 308, 10], [70, 350, 10], [283, 118, 9], [299, 19, 10], [368, 253, 10], [191, 62, 10], [364, 293, 9], [337, 164, 9], [49, 139, 9], [313, 85, 9]]], [[[335, 167, 10], [303, 26, 10], [347, 43, 10], [369, 289, 9], [203, 251, 10], [236, 296, 10], [387, 39, 10], [301, 175, 10], [101, 118, 10], [188, 65, 10], [203, 206, 10], [375, 135, 10], [279, 122, 10], [154, 190, 10], [315, 85, 10], [105, 181, 10], [245, 16, 9], [53, 23, 10], [85, 398, 10], [346, 385, 10], [302, 427, 10], [22, 310, 10], [185, 160, 10], [76, 353, 9], [154, 296, 9], [141, 41, 10], [363, 253, 9], [310, 253, 9], [53, 139, 9], [187, 327, 9]]], [[[241, 299, 10], [211, 206, 10], [80, 392, 10], [159, 187, 10], [57, 29, 10], [349, 385, 10], [248, 16, 10], [76, 358, 10], [370, 289, 10], [391, 39, 10], [347, 39, 10], [94, 119, 10], [208, 257, 10], [189, 159, 10], [307, 32, 10], [188, 68, 10], [153, 303, 10], [57, 137, 10], [23, 311, 10], [185, 328, 10], [373, 131, 9], [275, 128, 9], [310, 253, 9], [142, 33, 9], [333, 167, 10], [100, 175, 9], [319, 85, 9], [362, 251, 9], [298, 431, 9], [305, 172, 9]]], [[[61, 136, 9], [296, 430, 10], [213, 203, 10], [356, 386, 10], [97, 169, 10], [371, 127, 10], [314, 37, 10], [310, 248, 10], [323, 86, 10], [349, 33, 10], [370, 287, 10], [275, 130, 10], [251, 15, 10], [333, 169, 10], [245, 305, 10], [140, 28, 10], [305, 172, 10], [22, 317, 10], [86, 122, 10], [196, 160, 10], [152, 311, 10], [355, 253, 9], [160, 187, 9], [187, 70, 9], [211, 259, 10], [59, 29, 10], [75, 394, 9], [183, 326, 9], [394, 39, 9], [76, 365, 9]]], [[[98, 165, 10], [319, 37, 10], [355, 253, 10], [247, 305, 10], [370, 119, 10], [256, 16, 10], [293, 431, 10], [183, 71, 10], [62, 37, 10], [309, 241, 10], [63, 137, 10], [203, 163, 10], [326, 93, 10], [362, 387, 10], [153, 316, 10], [273, 135, 10], [335, 159, 10], [141, 27, 10], [350, 33, 10], [86, 122, 10], [69, 399, 10], [181, 323, 10], [400, 35, 9], [376, 290, 10], [305, 171, 9], [219, 199, 9], [214, 260, 9], [165, 182, 9], [22, 317, 9], [75, 365, 9]]], [[[86, 122, 10], [225, 194, 10], [253, 309, 9], [351, 254, 10], [320, 37, 10], [152, 316, 10], [76, 370, 10], [22, 320, 10], [293, 430, 10], [329, 100, 10], [365, 386, 10], [403, 33, 10], [309, 176, 10], [205, 164, 10], [308, 239, 10], [61, 37, 10], [135, 21, 10], [171, 183, 10], [364, 117, 10], [355, 28, 10], [273, 142, 10], [217, 261, 9], [61, 135, 9], [64, 405, 9], [380, 289, 10], [95, 164, 9], [178, 73, 9], [333, 157, 9], [257, 15, 9]]], [[[171, 73, 9], [362, 116, 10], [57, 410, 10], [271, 149, 10], [206, 166, 10], [308, 238, 10], [58, 133, 10], [409, 29, 10], [173, 182, 10], [333, 157, 10], [355, 26, 10], [308, 177, 10], [261, 14, 10], [23, 326, 10], [181, 331, 10], [95, 164, 10], [225, 256, 10], [368, 386, 10], [350, 254, 10], [293, 428, 9], [335, 103, 9], [152, 317, 9], [134, 15, 10], [254, 309, 9], [226, 193, 9], [61, 44, 9], [85, 118, 9], [325, 40, 9], [79, 375, 9], [381, 289, 9]]]]
Что я уже пробовал:
Я попробовал кодировать его для более простого списка:
l_input = [ [[99, 87], [400, 500], [300, 95]], [[297, 107], [100, 118], [405, 450]] ] def sq_distance(x1, x2): return sum(map(lambda x: (x[0] - x[1])**2, zip(x1, x2))) def get_min_point(point, points): dists = list(map(lambda x: sq_distance(x, point), points)) return points[dists.index(min(dists))] output = list(map(list, zip(l_input[0], map(lambda pt: get_min_point(pt, l_input[1]), l_input[0])))) # or in a loop output = [] for i in range(len(l_input) - 1): output.append(list(map(list, zip(l_input[0], map(lambda pt: get_min_point(pt, l_input[1]), l_input[0])))))
output = [ [[99, 87],[100, 118]], [[400, 500], [405, 450]], [[300, 95], [297, 107]] ]
Итак, мой код работает, но очевидно, что он не работает для большего списка, который я только что предоставил. Как я могу адаптировать этот код к большему списку, пожалуйста?
Patrice T
Что вы подразумеваете под "это не работает для большего списка" ?