% facebookX24.m
clc;
addpath('C:\Program Files\MATLAB\R2015b\toolbox\jsonlab-1.5'); % read .json
json2data=loadjson('E:\JZChen\X24\museum_metadata.json'); Cameras_number = json2data.Informative.Cameras_number;
% fprintf('%d',Cameras_number); % draw the camera and it's index
for index = :Cameras_number
%fprintf('%d\n',index);
name = json2data.cameras{,index}.Name;
Position = json2data.cameras{,index}.Position;
%fprintf('%s,%d\n',name,Position);
tmp_x = Position();
tmp_z = Position();
tmp_y = Position();
plot3(tmp_z,tmp_x,tmp_y,'rx');
text(tmp_z,tmp_x,tmp_y,name,'FontSize',);
hold on;
end
r=sqrt(0.0955); % radius
x0=;y0=1.65;z0=; % sphere center [z,x,y]=sphere(); % generate sphere
surf(r*z+z0,r*x+x0,r*y+y0); % draw sphere axis on;
axis equal;
xlabel('z');
ylabel('x');
zlabel('y'); % color
%colormap('white');
%colormap('gray');
colormap('default');
alpha(0.5);

数据文件如下:

{
"Content_name": "TechnicolorMuseum",
"BoundingBox_center": [0.0,0.0,1.65],
"Fps": ,
"Frames_number": ,
"Informative":
{
"Cameras_number": ,
"RigRadius": 0.30
},
"cameras":
[
{
"Name":"camE0",
"Position": [ 0.0777, -0.1429, 1.3872],
"Rotation": [ -61.4676, 40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE1",
"Position": [ 0.1429, 0.2628, 1.7277],
"Rotation": [ 61.4676, -14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE2",
"Position": [ 0.2628, 0.0777, 1.7929],
"Rotation": [ 16.4676, -24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE3",
"Position": [ 0.1429, -0.2628, 1.5723],
"Rotation": [ -61.4676, 14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE4",
"Position": [ 0.0777, 0.1429, 1.9128],
"Rotation": [ 61.4676, -40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE5",
"Position": [ 0.2628, -0.0777, 1.5071],
"Rotation": [ -16.4676, 24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE6",
"Position": [ 0.1429, 0.0777, 1.3872],
"Rotation": [ 28.5324, 40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE7",
"Position": [ 0.0777, 0.2628, 1.5071],
"Rotation": [ 73.5324, 24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE8",
"Position": [ 0.2628, 0.1429, 1.5723],
"Rotation": [ 28.5324, 14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE9",
"Position": [ 0.1429, -0.0777, 1.9128],
"Rotation": [ -28.5324, -40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE10",
"Position": [ 0.0777, -0.2628, 1.7929],
"Rotation": [ -73.5324, -24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE11",
"Position": [ 0.2628, -0.1429, 1.7277],
"Rotation": [ -28.5324, -14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE12",
"Position": [ -0.2628, -0.0777, 1.7929],
"Rotation": [ -163.5324, -24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE13",
"Position": [ -0.0777, -0.1429, 1.9128],
"Rotation": [ -118.5324, -40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE14",
"Position": [ -0.1429, -0.2628, 1.7277],
"Rotation": [ -118.5324, -14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE15",
"Position": [ -0.0777, 0.1429, 1.3872],
"Rotation": [ 118.5324, 40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE16",
"Position": [ -0.2628, 0.0777, 1.5071],
"Rotation": [ 163.5324, 24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE17",
"Position": [ -0.1429, 0.2628, 1.5723],
"Rotation": [ 118.5324, 14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE18",
"Position": [ -0.0777, 0.2628, 1.7929],
"Rotation": [ 106.4676, -24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE19",
"Position": [ -0.2628, -0.1429, 1.5723],
"Rotation": [ -151.4676, 14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE20",
"Position": [ -0.1429, -0.0777, 1.3872],
"Rotation": [ -151.4676, 40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE21",
"Position": [ -0.2628, 0.1429, 1.7277],
"Rotation": [ 151.4676, -14.1095, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE22",
"Position": [ -0.1429, 0.0777, 1.9128],
"Rotation": [ 151.4676, -40.3759, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
},
{
"Name":"camE23",
"Position": [ -0.0777, -0.2628, 1.5071],
"Rotation": [ -106.4676, 24.8121, 0.0000],
"Depthmap": ,
"Background": ,
"Rmin": 0.50,
"Rmax": 25.00,
"Resolution": [,],
"Hor_range": [ -90.0, +90.0 ],
"Ver_range": [ -90.0, +90.0 ]
}
]
}
---------------------
作者:桑来93
来源:CSDN
原文:https://blog.csdn.net/qjh5606/article/details/82017962
版权声明:本文为博主原创文章,转载请附上博文链接!

jsonlab-1.5

链接:https://pan.baidu.com/s/1dZBi5j04dMLW3huxY8uhvQ
提取码:o909
  嗯,希望对有需要的有帮助!

matlab json文件解析 需要下载一个jsonlab-1.5的更多相关文章

  1. Json文件解析(上)

    Json文件解析(上) 代码地址:https://github.com/nlohmann/json 自述文件 alt=GitHub赞助商 data-canonical-src="https: ...

  2. Golang Json文件解析为结构体工具-json2go

    代码地址如下:http://www.demodashi.com/demo/14946.html 概述 json2go是一个基于Golang开发的轻量json文件解析.转换命令行工具,目前支持转换输出到 ...

  3. Json文件解析(下)

    Json文件解析(下) 代码地址:https://github.com/nlohmann/json   从STL容器转换 任何序列容器(std::array,std::vector,std::dequ ...

  4. PHP JSON文件解析并获取key、value,判断key是否存在

    /****************************************************************************** * PHP JSON文件解析并获取key ...

  5. 【微信】微信小程序 微信开发工具中新创建的json文件,编译报错VM1781:2 pages/module/module.json 文件解析错误 SyntaxError: Unexpected end of JSON input

    如果新创建报错:编译报错VM1781:2 pages/module/module.json 文件解析错误  SyntaxError: Unexpected end of JSON input 解决方法 ...

  6. 如何:执行大型 XML 文档的流式转换 大XML文件解析入库的一个方法

    w Parsing Huge XML Files Incrementally http://pclib.github.io/safari/program/python-cookbook/Text/ch ...

  7. NPOI+Json文件解析Excel

    记点笔记,加深印象!最近有个导入Excel工能需要完成,Excel列名是中文的,导入Excel我用的NPOI插件,如果不对Excel做解析,列名有可能会给我带来一些字符方面的麻烦,于是想到了一个比较l ...

  8. Twaver的mono-desiner导出的json文件解析

    以画的交换机为例,其他大概都差不多. 利用Twaver做出交换机模型如图1所示,其中,每一个端口都是一个单独的对象.具体Twaver操作流程参见网址:http://twaver.servasoft.c ...

  9. HBuilder开发移动App——manifest.json文件解析

    以前做过Android App开发,对于各项配置都是在AndroidManifest.xml文件中完成的,包括权限的设定.图标.标签.App的名字.Activity注册等等 使用HBuilder开发移 ...

随机推荐

  1. SparkStreaming流处理

    一.Spark Streaming的介绍 1.       流处理 流式处理(Stream Processing).流式处理就是指源源不断的数据流过系统时,系统能够不停地连续计算.所以流式处理没有什么 ...

  2. Asp.net core 学习笔记 Razor Page

    更新 2019-04-27 最近做了更多的 research 发现微软视乎有意发展 razor page. razor page 的定位是 mvvm, 现在还有个叫 blazor 的东西, 类似用 c ...

  3. C++实现的一些功能代码

    将当前时间输出到txt中: 调用c++中的fstream流文件,用tm结构获取日期和时间,其在time.h中定义 用ofstream的时候,ofstream out(txtpath,ios::app) ...

  4. C语言实验一(2)

    #include<stdio.h>int main(){ char c1,c2; c1=97; c2=98; printf("c1=%c,c2=%c\n",c1,c2) ...

  5. useragent大全

    分享几个常见的User-Agent,复制粘贴过来的,谢谢原创. window.navigator.userAgent 1) Chrome Win7: Mozilla/5.0 (Windows NT 6 ...

  6. javascript高级程序设计第3版——第4章 变量作用域以及内存

  7. kafka producer batch 发送消息

    1. 使用 KafkaProducer 发送消息,是按 batch 发送的,producer 首先把消息放入 ProducerBatch 中: org.apache.kafka.clients.pro ...

  8. Mac下如何配置环境变量JDK

    1.在英文输入法的状态下,按键盘“Ctrl + 空格”组合键,调出Spotlight搜索,在这里可以快速启动终端,输入ter,然后回车,即可打开终端: 2.如果你是第一次配置环境变量,可以使用“tou ...

  9. 微信小程序电商实战(-)商城首页

    首先在app.json中配置页面和底部tabbar { "pages":[ "pages/index/index", "pages/kind/kind ...

  10. springboot解决文件上传大小限制

    (1)在配置文件(application.properties)加入如下代码 springboot2.0以下配置为: spring.http.multipart.maxFileSize = 10Mb ...