本示例实现了可视化算法
无人机传感器记录的飞行数据。
本演示的目的是展示数据可视化的不同可能性,包括基于时间的数据可视化。
数据可视化的不同可能性,包括基于时间的数据可视化。
我们先从 CSV 文件读取记录的数据。
Out[0]:
1 | 0 | 0.0 | -4.0 |
2 | 1 | 3.0 | -5.0 |
3 | 2 | 5.0 | -3.0 |
4 | 3 | 8.0 | -3.0 |
5 | 4 | 10.0 | -3.0 |
我们可以看到,表格包含 3 个字段,即时间计数、高度值和无人机相对于地平线的倾斜角度。
根据传感器数值的可视化。
我们可以看到,无人机在绕着某种地平线飞行的过程中,逐渐增加高度和
并改变俯仰角,因为它在绕着某种障碍物飞行。
障碍物。我们还可以看到
这很可能是
无人机在有风的条件下飞行。
现在让我们进入数据可视化循环本身。它可以有条件地分为三个部分。
- 高度显示。在每个时间点,都会以红点的形式绘制高度图。
轴约束条件设置为显示当前时间 ±10 秒周围的区域。
图头显示当前高度值和一个向上/向下箭头,取决于高度是上升还是下降。
2.俯仰角图。俯仰图显示无人机相对于地平线的偏转角度。
cosd 和 sind 函数用于绘制俯仰线。
页眉包含以度为单位的俯仰角值。
3.无人机图像旋转和可视化,无人机图像旋转一定角度(俯仰角值 + 90 度)。
channelview 功能将图像转换为便于进一步处理的视图。
使用掩码去除黑色像素。
最后,将所有三幅图像合并为一帧,形成 GIF 帧。
[ Info: Saved animation to /user/start/examples/image_processing/dron/tmp.gif
根据 GIF 的结果,我们可以发现
我们可以得到一个相当翔实的数据表示
随着时间的推移。这种方法
尤其是在描述真实物理对象的行为时。
{"id": "e81577ee-f6a2-4c47-a0c9-bf3ae2381341", "data": [{"showlegend": true, "mode": "lines", "xaxis": "x", "colorbar": {"y": 0.7395833333333333, "title": {"text": ""}, "len": 0.40392607174103246, "x": 0.9934383202099737}, "name": "y1", "yaxis": "y", "legendgroup": "y1", "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "y": [0, 3, 5, 8, 10, 13, 15, 18, 20, 22, 25, 27, 29, 32, 34, 36, 38, 40, 42, 44, 45, 47, 49, 50, 52, 53, 54, 56, 57, 58, 59, 60, 60, 61, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 62, 62, 62, 61, 60, 60, 59, 58, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 40, 39, 38, 37, 37, 36, 35, 35, 35, 34, 34, 34, 34, 33, 33, 34, 34, 34, 34, 35, 35, 36, 37, 37, 38, 39, 40, 41, 43, 44, 45, 47, 48, 50, 52, 54, 55, 57, 59, 61, 64, 66, 68, 70, 73, 75, 77, 80, 82, 85, 87, 90, 92, 95, 98, 100, 103, 105, 108, 110, 113, 115, 118, 120, 122, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 144, 146, 147, 149, 150, 151, 153, 154, 155, 156, 156, 157, 158, 158, 159, 159, 160, 160, 160, 160, 160, 160, 160, 159, 159, 159, 158, 158, 157, 156, 156, 155, 154, 153, 152, 151, 150, 149, 149, 148, 147, 145, 144, 143, 142, 141, 140, 140, 139, 138, 137, 136, 135, 134, 134, 133, 132, 132, 131, 131, 131, 130, 130, 130, 130, 130, 130, 130, 131, 131, 132, 132, 133, 134, 134, 135, 136, 137, 139, 140, 141, 143, 144, 146, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 168, 170, 172, 175, 177, 180, 182, 185, 187, 190, 192, 195, 198, 200, 203, 205, 208, 210, 213, 215, 217, 220, 222, 224, 226, 229, 231, 233, 235, 236, 238, 240, 242, 243, 245, 246, 247, 249, 250, 251, 252, 253, 253, 254, 255, 255, 256, 256, 256, 256, 257, 257, 256, 256, 256, 256, 255, 255, 255, 254, 253, 253, 252, 251, 250, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 232, 231, 230, 230, 229, 228, 228, 228, 227, 227, 227, 227, 227, 227, 227, 227, 228, 228, 228, 229, 230, 230, 231, 232, 233], "type": "scatter", "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 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, 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, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 350, "currentCount": 350}}}, {"showlegend": true, "mode": "lines", "xaxis": "x2", "colorbar": {"y": 0.23958333333333323, "title": {"text": ""}, "len": 0.4039260717410324, "x": 0.9934383202099737}, "name": "y1", "yaxis": "y2", "legendgroup": "y1", "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 1}, "y": [-4, -5, -3, -3, -3, -3, -2, -2, -3, -3, -2, -3, -2, -2, -1, -2, -1, -2, -1, -1, -1, -2, -1, -1, -1, -1, 0, -1, -1, 0, -1, -1, -1, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 2, 2, 1, 2, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 5, 5, 4, 3, 4, 5, 5, 5, 4, 5, 5, 4, 5, 5, 5, 5, 6, 6, 4, 5, 5, 5, 6, 5, 5, 6, 6, 5, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 6, 7, 6, 6, 5, 6, 6, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 5, 5, 7, 7, 7, 6, 6, 7, 6, 7, 6, 6, 6, 5, 6, 6, 7, 6, 6, 5, 5, 6, 5, 5, 6, 6, 6, 5, 5, 5, 6, 5, 5, 5, 6, 5, 6, 5, 5, 5, 5, 4, 5, 4, 5, 4, 4, 4, 4, 3, 4, 4, 4, 3, 3, 4, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 2, 3, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, -1, 0, -1, -1, -1, -1, -2, -1, -2, -1, -1, -2, -1, -1, -3, -2, -2, -2, -3, -2, -4, -3, -4, -4, -2, -4, -3, -4, -4, -3, -4, -4, -4, -5, -4, -5, -5, -4, -4, -5, -6, -6, -6, -5, -7, -5, -7, -7, -6, -7, -6, -7, -7, -6, -6, -7, -6, -7, -7, -7, -8, -8, -8, -8, -7, -7, -8, -8, -8, -8, -9, -9, -9, -9, -9, -8, -10, -10, -9, -10, -9, -9, -10, -9, -10, -10, -10, -10, -11, -11, -12, -12, -11, -12, -11, -12, -11, -11, -11, -11, -11, -11, -12, -11, -12, -13, -11, -12, -12, -12, -13, -13, -13, -12, -13, -13, -13, -12, -13, -14, -12, -12, -13, -14, -13, -14, -13, -13, -13], "type": "scatter", "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 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, 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, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 350, "currentCount": 350}}}], "config": {"showlegend": false, "paper_bgcolor": "rgba(255, 255, 255, 1.000)", "height": 400, "yaxis2": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [-10, -5, 0, 5], "range": [-14.63, 7.630000000000001], "domain": [0.03762029746281702, 0.44154636920384943], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["-10", "-5", "0", "5"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x2", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "xaxis2": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [0, 100, 200, 300], "range": [-10.469999999999999, 359.47], "domain": [0.05100612423447069, 0.9934383202099737], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["0", "100", "200", "300"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y2", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "annotations": [{"yanchor": "top", "xanchor": "center", "rotation": 0, "y": 1, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 20}, "yref": "paper", "showarrow": false, "text": "Высота", "xref": "paper", "x": 0.5222222222222223}, {"yanchor": "top", "xanchor": "center", "rotation": 0, "y": 0.49999999999999994, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 20}, "yref": "paper", "showarrow": false, "text": "Угол наклона", "xref": "paper", "x": 0.5222222222222223}], "plot_bgcolor": "rgba(255, 255, 255, 1.000)", "margin": {"l": 0, "b": 20, "r": 0, "t": 20}, "width": 1311.59375, "xaxis": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [0, 100, 200, 300], "range": [-10.469999999999999, 359.47], "domain": [0.05100612423447069, 0.9934383202099737], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["0", "100", "200", "300"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "yaxis": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [0, 50, 100, 150, 200, 250], "range": [-7.710000000000008, 264.71000000000004], "domain": [0.537620297462817, 0.9415463692038495], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["0", "50", "100", "150", "200", "250"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}}}