gpt4 book ai didi

python - 图像分析 : separating intersecting spaghettis

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:21:27 27 4
gpt4 key购买 nike

我有一张图像,人眼清楚地包含几个(此处为 2 个)重叠的“花边”。 enter image description here

这源于一项相当冗长的实验图像分析。

红点是两个向量 px 和 py 中包含的所有点,一个是红色像素的 x_position,另一个是 y 位置。

  px= array([  0,   0,   0,   0,   0,   0,   1,   1,   1,   1,   1,   1,   1,
2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7,
7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,
9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18,
18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20,
20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 22,
22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25,
25, 25, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27,
27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29,
29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31,
31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32,
32, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34,
34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36,
36, 36, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38,
38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 40, 40, 40,
40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42,
42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43,
44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47,
47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58,
58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69,
69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72,
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73,
73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74,
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78,
78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87,
87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 89, 89, 89,
89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 91, 91, 91,
91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 93, 93,
93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 95, 95,
95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 97, 97, 97,
97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 99, 99, 99,
99, 99, 99, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101,
101, 101, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103,
103, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 105,
106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107,
108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109,
110, 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111,
112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 114,
114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 116, 116,
116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 118, 118,
118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 120, 120,
120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 122, 122,
122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 124, 124,
124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126,
126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 128, 128, 128,
128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 130, 130, 130,
130, 130, 130, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132,
132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134,
134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136,
136, 136, 136, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138,
138, 138, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140,
140, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142,
142, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144,
144, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146,
146, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148,
149, 149, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 150,
151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 153,
153, 153, 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, 155,
155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 157,
157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 159,
159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160,
161, 161, 161, 161, 161, 161, 162, 162, 162, 162, 162, 162, 162,
163, 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164,
164, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166,
166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 168, 168,
168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, 169, 170,
170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171,
172, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173])

py=array([189, 190, 191, 192, 193, 194, 189, 190, 191, 192, 193, 194, 195,
190, 191, 192, 193, 194, 195, 196, 190, 191, 192, 193, 194, 195,
196, 191, 192, 193, 194, 195, 196, 197, 192, 193, 194, 195, 196,
197, 198, 193, 194, 195, 196, 197, 198, 199, 194, 195, 196, 197,
198, 199, 200, 194, 195, 196, 197, 198, 199, 200, 201, 195, 196,
197, 198, 199, 200, 201, 202, 196, 197, 198, 199, 200, 201, 202,
197, 198, 199, 200, 201, 202, 203, 198, 199, 200, 201, 202, 203,
199, 200, 201, 202, 203, 204, 199, 200, 201, 202, 203, 204, 205,
199, 200, 201, 202, 203, 204, 205, 206, 200, 201, 202, 203, 204,
205, 206, 207, 202, 203, 204, 205, 206, 207, 202, 203, 204, 205,
206, 207, 208, 203, 204, 205, 206, 207, 208, 209, 204, 205, 206,
207, 208, 209, 210, 205, 206, 207, 208, 209, 210, 211, 206, 207,
208, 209, 210, 211, 212, 206, 207, 208, 209, 210, 211, 212, 213,
207, 208, 209, 210, 211, 212, 213, 214, 208, 209, 210, 211, 212,
213, 214, 209, 210, 211, 212, 213, 214, 215, 210, 211, 212, 213,
214, 215, 216, 211, 212, 213, 214, 215, 216, 217, 211, 212, 213,
214, 215, 216, 217, 212, 213, 214, 215, 216, 217, 218, 219, 213,
214, 215, 216, 217, 218, 219, 220, 214, 215, 216, 217, 218, 219,
220, 215, 216, 217, 218, 219, 220, 221, 216, 217, 218, 219, 220,
221, 222, 217, 218, 219, 220, 221, 222, 223, 218, 219, 220, 221,
222, 223, 218, 219, 220, 221, 222, 223, 224, 219, 220, 221, 222,
223, 224, 225, 220, 221, 222, 223, 224, 225, 226, 221, 222, 223,
224, 225, 226, 227, 221, 222, 223, 224, 225, 226, 227, 228, 222,
223, 224, 225, 226, 227, 228, 223, 224, 225, 226, 227, 228, 229,
224, 225, 226, 227, 228, 229, 230, 311, 225, 226, 227, 228, 229,
230, 309, 310, 311, 312, 313, 225, 226, 227, 228, 229, 230, 231,
307, 308, 309, 310, 311, 312, 313, 314, 226, 227, 228, 229, 230,
231, 232, 306, 307, 308, 309, 310, 311, 312, 313, 314, 227, 228,
229, 230, 231, 232, 304, 305, 306, 307, 308, 309, 310, 311, 312,
313, 314, 228, 229, 230, 231, 232, 233, 302, 303, 304, 305, 306,
307, 308, 309, 310, 311, 312, 313, 228, 229, 230, 231, 232, 233,
234, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,
312, 229, 230, 231, 232, 233, 234, 298, 299, 300, 301, 302, 303,
304, 305, 306, 307, 308, 309, 310, 230, 231, 232, 233, 234, 235,
296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
309, 230, 231, 232, 233, 234, 235, 236, 294, 295, 296, 297, 298,
299, 300, 301, 302, 303, 304, 305, 306, 231, 232, 233, 234, 235,
236, 237, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
302, 303, 304, 305, 232, 233, 234, 235, 236, 237, 238, 239, 288,
289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
302, 233, 234, 235, 236, 237, 238, 239, 240, 285, 286, 287, 288,
289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
234, 235, 236, 237, 238, 239, 240, 283, 284, 285, 286, 287, 288,
289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 235, 236, 237,
238, 239, 240, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
291, 292, 293, 294, 295, 296, 235, 236, 237, 238, 239, 240, 241,
278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
291, 292, 293, 236, 237, 238, 239, 240, 241, 242, 276, 277, 278,
279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
237, 238, 239, 240, 241, 242, 243, 273, 274, 275, 276, 277, 278,
279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 238, 239, 240,
241, 242, 243, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
279, 280, 281, 282, 283, 284, 285, 238, 239, 240, 241, 242, 243,
244, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
279, 280, 281, 282, 283, 239, 240, 241, 242, 243, 244, 265, 266,
267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
280, 240, 241, 242, 243, 244, 245, 261, 262, 263, 264, 265, 266,
267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 240, 241,
242, 243, 244, 245, 258, 259, 260, 261, 262, 263, 264, 265, 266,
267, 268, 269, 270, 271, 272, 273, 274, 241, 242, 243, 244, 245,
246, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
267, 268, 269, 270, 271, 272, 241, 242, 243, 244, 245, 246, 247,
252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 242, 243, 244, 245, 246, 247, 249, 250,
251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
264, 265, 266, 267, 242, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
256, 257, 258, 259, 260, 240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 235, 236, 237,
238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 254, 231, 232, 233, 234, 235, 236, 237, 238, 239,
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 227,
228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 223, 224, 225,
226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238,
239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
241, 242, 246, 247, 248, 249, 250, 251, 210, 211, 212, 213, 214,
215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 246, 247,
248, 249, 250, 251, 189, 190, 191, 192, 193, 194, 195, 196, 197,
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 247, 248,
249, 250, 251, 252, 183, 184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
247, 248, 249, 250, 251, 252, 172, 173, 174, 175, 176, 177, 178,
179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
218, 219, 220, 221, 222, 223, 224, 225, 226, 248, 249, 250, 251,
252, 253, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
218, 219, 249, 250, 251, 252, 253, 254, 167, 168, 169, 170, 171,
172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
211, 212, 213, 249, 250, 251, 252, 253, 254, 167, 168, 169, 170,
171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 250, 251,
252, 253, 254, 255, 167, 168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 250, 251,
252, 253, 254, 255, 168, 169, 170, 171, 172, 173, 174, 175, 176,
177, 178, 179, 180, 250, 251, 252, 253, 254, 255, 256, 251, 252,
253, 254, 255, 256, 252, 253, 254, 255, 256, 257, 252, 253, 254,
255, 256, 257, 258, 253, 254, 255, 256, 257, 258, 253, 254, 255,
256, 257, 258, 259, 254, 255, 256, 257, 258, 259, 260, 254, 255,
256, 257, 258, 259, 260, 255, 256, 257, 258, 259, 260, 256, 257,
258, 259, 260, 261, 256, 257, 258, 259, 260, 261, 256, 257, 258,
259, 260, 261, 262, 257, 258, 259, 260, 261, 262, 258, 259, 260,
261, 262, 263, 258, 259, 260, 261, 262, 263, 259, 260, 261, 262,
263, 264, 259, 260, 261, 262, 263, 264, 260, 261, 262, 263, 264,
265, 260, 261, 262, 263, 264, 265, 261, 262, 263, 264, 265, 266,
261, 262, 263, 264, 265, 266, 267, 262, 263, 264, 265, 266, 267,
262, 263, 264, 265, 266, 267, 268, 263, 264, 265, 266, 267, 268,
263, 264, 265, 266, 267, 268, 269, 264, 265, 266, 267, 268, 269,
265, 266, 267, 268, 269, 270, 265, 266, 267, 268, 269, 270, 266,
267, 268, 269, 270, 271, 266, 267, 268, 269, 270, 271, 267, 268,
269, 270, 271, 272, 267, 268, 269, 270, 271, 272, 273, 268, 269,
270, 271, 272, 273, 268, 269, 270, 271, 272, 273, 274, 269, 270,
271, 272, 273, 274, 269, 270, 271, 272, 273, 274, 275, 270, 271,
272, 273, 274, 275, 270, 271, 272, 273, 274, 275, 276, 271, 272,
273, 274, 275, 276, 271, 272, 273, 274, 275, 276, 277, 272, 273,
274, 275, 276, 277, 273, 274, 275, 276, 277, 278, 273, 274, 275,
276, 277, 278, 273, 274, 275, 276, 277, 278, 279, 274, 275, 276,
277, 278, 279, 274, 275, 276, 277, 278, 279, 280, 275, 276, 277,
278, 279, 280, 275, 276, 277, 278, 279, 280, 281, 276, 277, 278,
279, 280, 281, 276, 277, 278, 279, 280, 281, 282, 277, 278, 279,
280, 281, 282, 278, 279, 280, 281, 282, 283, 278, 279, 280, 281,
282, 283, 279, 280, 281, 282, 283, 284, 279, 280, 281, 282, 283,
284, 279, 280, 281, 282, 283, 284, 285, 280, 281, 282, 283, 284,
285, 280, 281, 282, 283, 284, 285, 286, 281, 282, 283, 284, 285,
286, 281, 282, 283, 284, 285, 286, 287, 282, 283, 284, 285, 286,
287, 283, 284, 285, 286, 287, 288, 283, 284, 285, 286, 287, 288,
284, 285, 286, 287, 288, 289, 284, 285, 286, 287, 288, 289, 290,
285, 286, 287, 288, 289, 290, 286, 287, 288, 289, 290, 291, 286,
287, 288, 289, 290, 291, 292, 287, 288, 289, 290, 291, 292, 287,
288, 289, 290, 291, 292, 293, 288, 289, 290, 291, 292, 293, 289,
290, 291, 292, 293, 294, 289, 290, 291, 292, 293, 294, 295, 290,
291, 292, 293, 294, 295, 296, 291, 292, 293, 294, 295, 296, 297,
292, 293, 294, 295, 296, 297, 292, 293, 294, 295, 296, 297, 298,
293, 294, 295, 296, 297, 298, 299, 294, 295, 296, 297, 298, 299,
300, 294, 295, 296, 297, 298, 299, 300, 301, 295, 296, 297, 298,
299, 300, 301, 302, 296, 297, 298, 299, 300, 301, 302, 297, 298,
299, 300, 301, 302, 303, 298, 299, 300, 301, 302, 303, 304, 299,
300, 301, 302, 303, 304, 305, 300, 301, 302, 303, 304, 305, 306,
301, 302, 303, 304, 305, 306, 307, 302, 303, 304, 305])

要重现图像,一旦将数组作为 px 和 py 复制粘贴到编辑器中,这个 MWE 就足够了

import numpy as np
plot_mtx = np.zeros( (5120,5120) )
px=...
py=...
window_size = max(px[-1]-px[0],[py[-1]-py[0]])
imshow(plot_mtx[min(px):min(px)+window_size,min(py):min(py)+window_size])

本质上,这是两条线,每条线的宽度约为 6 像素。我想将它们分成不同的两行,这样从上到下的行就有 px_1,py_1,从左到右的行有 px_2,py_2。

到目前为止,我未能找到合适的关键字来找到此类算法。我想到的是一个 for 循环,它从一个末端开始,以这样一种方式完成具有像素位置的列表,即循环前进的方向永远不会超过相对于前面几个步骤的特定角度。这样,该算法将始终采用平滑穿过交叉点的像素集。然后只需从数据中删除新找到的行并重新开始即可。

你有什么更好的意见吗?

感谢任何反馈

最佳答案

  1. Skeletonize图片。
  2. 按交叉点拆分(它有超过 2 个邻居)- 给你 4 个部分。
  3. 将方向相似的对连接在一起 - 你会得到 2 条骨架线。
  4. 通过接近度阈值将原始像素分配给每条线。

关于python - 图像分析 : separating intersecting spaghettis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30360478/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com