﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-</title><link>http://www.cppblog.com/zmj/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 05 Apr 2026 16:20:23 GMT</lastBuildDate><pubDate>Sun, 05 Apr 2026 16:20:23 GMT</pubDate><ttl>60</ttl><item><title>[重点中学] 东北育才学校各部门联系方式</title><link>http://www.cppblog.com/zmj/archive/2019/02/19/216244.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 19 Feb 2019 01:37:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2019/02/19/216244.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216244.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2019/02/19/216244.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216244.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216244.html</trackback:ping><description><![CDATA[<strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校各部门联系方式</strong><strong style="overflow-wrap: break-word;">东北育才学校浑南校区</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市浑南新区高功路2号<br style="overflow-wrap: break-word;" />邮政编码：110179<br style="overflow-wrap: break-word;" />【东北育才学校校部】<br style="overflow-wrap: break-word;" />校务办公室：23783945 | 业务指导部：62341363 | 人力资源部：62341198 | 后勤保障部：62340737 | 教育发展研究所：62341399<br style="overflow-wrap: break-word;" />【东北育才高中部】<br style="overflow-wrap: break-word;" />教学处：62340178 | 学生发展指导处：62340277<br style="overflow-wrap: break-word;" />【东北育才科学高中部】<br style="overflow-wrap: break-word;" />教学处：62341306 | 学生发展指导处：62340166<br style="overflow-wrap: break-word;" />【东北育才超常教育实验部】<br style="overflow-wrap: break-word;" />教学处：62340419<br style="overflow-wrap: break-word;" />【东北育才国际部】<br style="overflow-wrap: break-word;" />教学处：23783940<br style="overflow-wrap: break-word;" />【东北育才悲鸿美术学校】<br style="overflow-wrap: break-word;" />教学、教育处：62341370 | 62341371<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校幼儿园</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市浑南新区高功路1号<br style="overflow-wrap: break-word;" />邮政编码：110179<br style="overflow-wrap: break-word;" />办公电话：62341510<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才外国语学校</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市浑南新区高荣路1号<br style="overflow-wrap: break-word;" />邮政编码：110179<br style="overflow-wrap: break-word;" />教学处：23788397 | 学生发展指导处：23783798<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校北校区</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市和平区南一马路100号<br style="overflow-wrap: break-word;" />邮政编码：110001<br style="overflow-wrap: break-word;" />【东北育才初中部】<br style="overflow-wrap: break-word;" />教学处：62256856 | 学生发展指导处：62256894<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校东关校区</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市大东区东顺城南街育才巷12号<br style="overflow-wrap: break-word;" />邮政编码：110042<br style="overflow-wrap: break-word;" />【东北育才东关模范小学】<br style="overflow-wrap: break-word;" />办公电话：62437003<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校双语校区</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：沈阳市沈北新区沈北路200号<br style="overflow-wrap: break-word;" />邮政编码：110164<br style="overflow-wrap: break-word;" />【东北育才双语小学部】<br style="overflow-wrap: break-word;" />教学处：62328083 | 学生发展指导处：62328173 62328187<br style="overflow-wrap: break-word;" />【东北育才双语初中部】<br style="overflow-wrap: break-word;" />教学处：62328086 | 62328082<br style="overflow-wrap: break-word;" /><strong style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;">东北育才学校实验校区</strong><br style="overflow-wrap: break-word; color: #444444; font-family: Tahoma, &quot;Microsoft Yahei&quot;, Simsun; background-color: #fdfdfd;" />详细地址：抚顺市高科技开发区李石科技城顺大街北段4号<br style="overflow-wrap: break-word;" />邮政编码：113122<br style="overflow-wrap: break-word;" />【东北育才实验学校小学部】<br style="overflow-wrap: break-word;" />教学处：58251488 | 学生发展指导处：58251466<br style="overflow-wrap: break-word;" />【东北育才实验学校中学部】<br style="overflow-wrap: break-word;" />教学处：58251456 | 学生发展指导处：58250001<img src ="http://www.cppblog.com/zmj/aggbug/216244.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2019-02-19 09:37 <a href="http://www.cppblog.com/zmj/archive/2019/02/19/216244.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于深度相机的精度问题</title><link>http://www.cppblog.com/zmj/archive/2019/01/10/216181.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 10 Jan 2019 07:39:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2019/01/10/216181.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216181.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2019/01/10/216181.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216181.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216181.html</trackback:ping><description><![CDATA[<div>https://www.jianshu.com/p/1a916ed3c503</div><br /><div><div><p>常用的三种类型的深度相机<sup><a href="#fn1" id="fnref1">[1]</a></sup>，大致分为以下三种：基于主动投射结构光的深度相机（如<strong>Kinect 1.0</strong>, Intel RealSense, Enshape, Ensenso等）、被动双目相机（如STEROLABS 推出的 <strong>ZED 2K Stereo Camera</strong>, Point Grey 公司推出的 BumbleBee）以及ToF<sup><a href="#fn2" id="fnref2">[2]</a></sup>相机（如微软的<strong>Kinect 2.0</strong>, MESA 的 SR4000 , Google Project Tango 中使用的PMD Tech 的TOF相机，Intel 的 SoftKinect DepthSense, Basler基于松下的芯片开发的TOF相机以及国内一些初创公司基于TI的方案开发的TOF相机等等）</p> <blockquote> <p>目前市面上常有的 3D 相机方案就就是下面3种，对应上面的：<br /> (1) 结构光(Structured-light)，代表公司有奥比中光（国产，比较推荐，性价比可以，也有高分辨率的款），苹果(Prime Sense)，微软 Kinect-1，英特尔RealSense, Mantis Vision 等。<br /> (2) 双目视觉(Stereo)，代表公司 Leap Motion， ZED， 大疆;<br /> (3) 光飞行时间法(TOF)，代表公司微软 Kinect-2，PMD，SoftKinect， 联想Phab。</p> </blockquote> <div> <img src="http://static.zybuluo.com/usiege/nw2lyad2ikqkuk4vdlx3jwr1/image_1cs5el5cb14m9bhr9ts11rvgve4i.png" data-original-src="http://static.zybuluo.com/usiege/nw2lyad2ikqkuk4vdlx3jwr1/image_1cs5el5cb14m9bhr9ts11rvgve4i.png" alt="image_1cs5el5cb14m9bhr9ts11rvgve4i.png-82.7kB" style="cursor: zoom-in;" /><div>image_1cs5el5cb14m9bhr9ts11rvgve4i.png-82.7kB</div> </div> <h2>1. Kinect</h2> <p>先给出结论，<strong>KinectV2的精度在2mm~4mm左右</strong>，距离越近精度越高，越远精度稍微差点；kinectV1误差约<strong>2mm~30mm</strong>。</p> <p><a href="https://ieeexplore.ieee.org/document/7251485" target="_blank" rel="nofollow">Kinectv2 for Mobile Robot Navigation: Evaluationand Modeling</a></p> <ul> <li>Kinect v2在不同位置的精度问题</li> </ul> <div> <img src="http://static.zybuluo.com/usiege/vvzip2kg0mvhqzyiekssyy45/image_1cs6h8fbdokn1ljf1npuogg1g2b5p.png" data-original-src="http://static.zybuluo.com/usiege/vvzip2kg0mvhqzyiekssyy45/image_1cs6h8fbdokn1ljf1npuogg1g2b5p.png" alt="image_1cs6h8fbdokn1ljf1npuogg1g2b5p.png-1587.5kB" style="cursor: zoom-in;" /><div>image_1cs6h8fbdokn1ljf1npuogg1g2b5p.png-1587.5kB</div> </div> <p>如上图所示，右侧大三角是KinectV2在纵向（垂直于地面）的精度分布，下侧大三角是KinectV2在水平面（平行于地面）上的精度分布。在绿色区域精度最高，误差<strong>小于2mm</strong>，在黄色区域误差在<strong>2~4mm</strong>，红色区域误差<strong>大于4mm</strong>。所以在设计交互场景时，在黄色区域以内会达到最好的效果（3.5m内）。如果对精度要求很高，如控制机械，最好在绿色区域进行交互。</p> <h2>2 Kinect v2和Kinect v1</h2> <div> <img src="http://static.zybuluo.com/usiege/dtqesw77jft8329nqssqrj5x/image_1cs5gdtqv1r19e2m1ufcgal15a75c.png" data-original-src="http://static.zybuluo.com/usiege/dtqesw77jft8329nqssqrj5x/image_1cs5gdtqv1r19e2m1ufcgal15a75c.png" alt="性能表对比" style="cursor: zoom-in;" /><div>性能表对比</div> </div> <p>Kinect v2的rgb视场（FOV<sup><a href="#fn3" id="fnref3">[3]</a></sup>）是84.1 x 53.8，关于FOV的建模和模型可以<a href="http://www.smeenk.com/webgl/kinectfovexplorer.html" target="_blank" rel="nofollow">参考</a>。</p> <div> <img src="http://static.zybuluo.com/usiege/k6xs97dxiheiib6r2m8bynbz/image_1cs6hgs884u61c4cs061tp61d9466.png" data-original-src="http://static.zybuluo.com/usiege/k6xs97dxiheiib6r2m8bynbz/image_1cs6hgs884u61c4cs061tp61d9466.png" alt="image_1cs6hgs884u61c4cs061tp61d9466.png-274.2kB" style="cursor: zoom-in;" /><div>image_1cs6hgs884u61c4cs061tp61d9466.png-274.2kB</div> </div> <p>如图所示，KinectV1随着距离增加，误差指数性增加，在距离达到4m时，kinectV1误差<strong>接近0.2m</strong>。而KinectV2的误差几乎不随距离增加而变化。V2比V1追踪准确度好20%。V2可以在户外进行人体跟踪，最远到4m。V2在近距离有比V1高2倍的精度，在6m有高数十倍的精度。</p> <ul> <li><p>kinectv1和kinectv2比较</p></li> <li><p>|KinectV1|KinectV2<br /> ----|----|----<br /> 检测范围(Range of Detecton)|0.8&#8211;6.0m|0.5 &#8211;4.5m<br /> 深度误差(depth Uncertainty)|2mm-30mm|&lt;0.5% of range<br /> 角度(Angle，horizontal-vertical)|57-43|70-60</p></li> </ul> <h2>3. LeapMotion</h2> <p>LeapMotion的精度平均下来是<strong>0.7mm</strong>的精度，也是达不到所谓的0.01mm的。</p> <p><a href="https://github.com/usiege/CASIA/blob/master/paper-pointcloud/sensors-13-06380.pdf" target="_blank" rel="nofollow">Analysis of the Accuracy and Robustness of the Leap<br /> Motion Controller</a></p> <p>上面的论文对初步版本中的Leap Motion控制器进行研究，分别在静态与动态设置下的精度和准确性，考虑到人手的可达到的平均约为0.4mm，实验用设备使用参考笔，位置精度可达0.2mm，且参考笔对仪器精度测量无可观察到的影响。在基于静态设置的测量下，获得了期望的3D位置与<strong>小于0.2mm</strong>的测量位置之间的与轴无关的偏差。在动态情况下，独立于平面，可以获得<strong>小于2.5mm</strong>的精度（平均1.2毫米）。重复性<strong>平均小于0.17毫米</strong>。在基于姿势的用户界面方面，在实际条件下不可能实现0.01mm的理论精度，而是高精度（总平均精度为<strong>0.7mm</strong>）。</p> <h2>最后比较一下以上设备的优缺点</h2> <h3>1. Microsoft Kinect</h3> <div> <img src="http://static.zybuluo.com/usiege/zqfzq1qjirtgmj2gxubcxni6/image_1cs835f4eiaa4gb1ln31cndcb2an.png" data-original-src="http://static.zybuluo.com/usiege/zqfzq1qjirtgmj2gxubcxni6/image_1cs835f4eiaa4gb1ln31cndcb2an.png" alt="image_1cs835f4eiaa4gb1ln31cndcb2an.png-99.9kB" style="cursor: zoom-in;" /><div>image_1cs835f4eiaa4gb1ln31cndcb2an.png-99.9kB</div> </div> <p>优点：</p> <ul> <li>可以获取深度数据（320＊240）、rgb</li> <li>数据（640＊480）、声音、骨骼节点（20个）</li> <li>拥有三套 SDK：微软 SDK、OpenNI、libfreenect</li> <li>后两个 SDK 是跨平台，支持各种开发语言</li> <li>价格便宜</li> <li>社区成熟，开发资源丰富</li> </ul> <p>缺点：</p> <ul> <li>传感器分辨率不够，看不清手指</li> <li>由于使用结构光技术，深度传感器的可视范围无法重叠</li> <li>OpenNI 和 libfreenect 虽然跨平台，但是功能远不如微软 SDK</li> <li>设备尺寸大，需要一坨电源线</li> <li>致命缺点，微软已宣布停止生产 Kinect 一代</li> </ul> <h3>2. Microsoft Kinect One</h3> <div> <img src="http://static.zybuluo.com/usiege/x15jth33tgjvm8ne69b8341w/image_1cs83c41h1bpip0qjqvc2s1aub4.png" data-original-src="http://static.zybuluo.com/usiege/x15jth33tgjvm8ne69b8341w/image_1cs83c41h1bpip0qjqvc2s1aub4.png" alt="image_1cs83c41h1bpip0qjqvc2s1aub4.png-84.5kB" style="cursor: zoom-in;" /><div>image_1cs83c41h1bpip0qjqvc2s1aub4.png-84.5kB</div> </div> <p>优点：</p> <ul> <li>分辨率更大、可以看到更广阔的场景</li> <li>可以检测到的人体关节点更多（25个），能看清手指</li> <li>拥有两套 SDK：微软 SDK、libfreenect2</li> <li>可以开发 Windows Store 应用</li> </ul> <p>缺点：</p> <ul> <li>libfreenect2 基本不能检测骨骼，功能缺太多，同时 OpenNI 也不支持它，因此局限于 Windows 平台</li> <li>设备尺寸比一代更大，需要一坨电源线，比一代贵一些</li> <li>致命缺点：只能运行在 64 位 Windows 8 系统上，必须使用 USB 3.0 端口</li> </ul> <h3>3. Intel / Creative / SoftKinetic</h3> <div> <img src="http://static.zybuluo.com/usiege/mz6hk7qh58fxw74xu9038ye2/image_1cs83s6uv6941lg0gaonlg1ocp19.png" data-original-src="http://static.zybuluo.com/usiege/mz6hk7qh58fxw74xu9038ye2/image_1cs83s6uv6941lg0gaonlg1ocp19.png" alt="image_1cs83s6uv6941lg0gaonlg1ocp19.png-259.3kB" style="cursor: zoom-in;" /><div>image_1cs83s6uv6941lg0gaonlg1ocp19.png-259.3kB</div> </div> <p>优点：</p> <ul> <li>小巧，普通 USB 摄像头的尺寸</li> <li>不需要外界电源线</li> <li>近距离使用，可实现表情分析和手势识别</li> </ul> <p>缺点：</p> <ul> <li>不适合远距离交互，也无法检测完整的身体</li> <li>只能在中高端的 Intel CPU 上才能运行</li> </ul> <h3>4. Leap Motion</h3> <div> <img src="http://static.zybuluo.com/usiege/hacbua5n3k64vafha0g1j1gx/image_1cs83t6bukpppr9f021dtt1cdo1m.png" data-original-src="http://static.zybuluo.com/usiege/hacbua5n3k64vafha0g1j1gx/image_1cs83t6bukpppr9f021dtt1cdo1m.png" alt="image_1cs83t6bukpppr9f021dtt1cdo1m.png-170.4kB" style="cursor: zoom-in;" /><div>image_1cs83t6bukpppr9f021dtt1cdo1m.png-170.4kB</div> </div> <p>优点：</p> <ul> <li>小巧，一根 usb 线就可以使用</li> <li>跨平台</li> <li>支持的开发语言比较多，甚至通过 WebSocket</li> <li>实现了浏览器中的 JavaScript API</li> <li>跟踪手指和手掌，精度较高</li> </ul> <p>缺点：</p> <ul> <li>检测范围小，手臂酸疼（见上图）</li> <li>不能检测身体和脸部</li> <li>作为生产力工具，完全无法替代鼠标键盘</li> <li>致命缺点：找不到合适的使用场景</li> </ul> <h3>5. PrimeSense / Apple / 华硕（ASUS）</h3> <div> <img src="http://static.zybuluo.com/usiege/oy42h0f0vsdbzjpjkybh5dma/image_1cs8479dm6sncqr1ulgb1e1l5r23.png" data-original-src="http://static.zybuluo.com/usiege/oy42h0f0vsdbzjpjkybh5dma/image_1cs8479dm6sncqr1ulgb1e1l5r23.png" alt="image_1cs8479dm6sncqr1ulgb1e1l5r23.png-80.6kB" style="cursor: zoom-in;" /><div>image_1cs8479dm6sncqr1ulgb1e1l5r23.png-80.6kB</div> </div> <p>和 Kinect 一代的优缺点类似，</p> <hr /> <hr />   <ol> <li id="fn1"> <p><a href="https://zhuanlan.zhihu.com/p/28274727" target="_blank" rel="nofollow">https://zhuanlan.zhihu.com/p/28274727</a> <a href="#fnref1">&#8617;</a></p> </li> <li id="fn2"> <p><a href="https://baike.baidu.com/item/TOF/19952376?fr=aladdin" target="_blank" rel="nofollow">https://baike.baidu.com/item/TOF/19952376?fr=aladdin</a> <a href="#fnref2">&#8617;</a></p> </li> <li id="fn3"> <p><a href="http://www.coloreye.cn/wiki/doc-view-716.html" target="_blank" rel="nofollow">http://www.coloreye.cn/wiki/doc-view-716.html</a> <a href="#fnref3">&#8617;</a></p></li></ol></div><br /><br />作者：消失的指针<br />链接：https://www.jianshu.com/p/1a916ed3c503<br />來源：简书<br />简书著作权归作者所有，任何形式的转载都请联系作者获得授权并注明出处。</div><img src ="http://www.cppblog.com/zmj/aggbug/216181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2019-01-10 15:39 <a href="http://www.cppblog.com/zmj/archive/2019/01/10/216181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Kinect开发教程一：OpenNI的安装与开发环境配置</title><link>http://www.cppblog.com/zmj/archive/2018/12/26/216145.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 26 Dec 2018 09:43:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/12/26/216145.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216145.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/12/26/216145.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216145.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216145.html</trackback:ping><description><![CDATA[<h1><div><span style="font-size: 14pt; font-weight: normal;">https://blog.csdn.net/chenxin_130/article/details/6693390</span></div><span style="font-weight: normal;"><br /></span><div><span style="font-size: 14pt; font-weight: normal;">小斤注：关于OpenNI2.X版本的安装与开发环境配置，请参考《Kinect开发教程六：OpenNI2简介、安装与VS开发环境配置》</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">-----------------------------------------------------------------------</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; Kinect作为新一代的体感设备，小斤就不多介绍咯，微软日前也发布了相应的官方SDK，用以开发Kinect在PC上的应用。但就目前的情况而言，微软的KinectSDK只能在Win 7平台上使用，因此小斤选择了OpenNI作为Kinect开发的第一块踏脚石，它是目前已被广泛使用和认可的开源Kinect开发库。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">准备</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;首先大家需要下载三样东西：</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;第一，OpenNI ，小斤在这里下载：http://www.openni.org/Downloads/OpenNIModules.aspx，选择OpenNI Binaries，注意要下载Development Edition，这样才有Sample可以测试查看。此外，源码也可以在GitHub上看到：https://github.com/OpenNI/OpenNI</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;第二，SensorKinect，它就是Kinect的驱动了，可以在https://github.com/avin2/SensorKinect的Bin中找到。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;第三，NITE，这是PrimeSense 提供的中间件，可以分析Kinect读取的资料，输出人体动作等等。目前在http://www.openni.org/Downloads/OpenNIModules.aspx，选择OpenNI Compliant Middleware Binaries就能够下载了。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">安装</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">【1】下载完毕后，先把Kinect放在一边，安装OpenNI。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">(小斤安装OpenNI后，安装SensorKinect过程中，会弹出&#8221;Please install OpenNI version&#8230;.&#8221;之类的错误，重启后再一次点击SensorKinect安装就解决了。有同学提示说，安装OpenNI的Windows用户一定要用管理员身份跑安装程序才行，没有的话有一部分文件无法写入，会导致之后的错误。)</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">【2】安装SensorKinect驱动，装完，把Kinect插上，此时系统就会自动开始搜索驱动了，如果没有搜索到，那么需要指定驱动目录了。假设SensorKinect默认安装在默认路径，指定驱动目录C:\ProgramFiles\Prime Sense\Sensor\Driver。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; 驱动安装成功的话，在设备管理器中，会出现:</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">【3】安装NITE，装完后，由于NITE定义的320*240分辨率与SensorKinect的640*480不同，这边有个关键步骤，假设安装在默认路径：</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; 从"c:\Program Files\PrimeSense\Sensor\SampleXMLs\NITE\Data\" 里复制所有XML文件到 "c:\ProgramFiles\Prime Sense\NITE\Data\" 覆盖</span></div><div><span style="font-size: 14pt; font-weight: normal;">　　从"c:\ProgramFiles\Prime Sense\Sensor\SampleXMLs\OPENNI\Data" 里复制所有XML文件到 "c:\Program Files\OpenNI\Data" 覆盖</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; 此外，NITE是需要序列号的，但其官网免费提供了一个：0KOIk2JeIBYClPWVnMoRKn5cdY4=</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;我们只要将"c:\Program Files\Prime Sense\NITE\Data\"目录下所有配置文件，把Licenses部分替换即可：</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">　　&lt;Licenses&gt;&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; 　　　&lt;License vendor="PrimeSense"key="0KOIk2JeIBYClPWVnMoRKn5cdY4="/&gt;&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">　　&lt;/Licenses&gt;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">测试</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">【OpenNI】</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;如果安装在默认路径下，测试程序可以在C:\Program Files\OpenNI\Samples\Bin\Release下找到，这里小斤使用的是NiViewer.exe和NiSimpleViewer.exe，都是显示深度图，如果运行没问题就可以咯。另外，NiUserTracker这个程序也很有趣，可以跟踪你的人体，前提是它捕捉到你人体后，你做出一个标定动作（举起双手）并维持一段时间。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; SimpleViewer:</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;UserTracker:</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; 如果安装一切正常，但这些例子无法显示结果，可以关闭防火墙试试，某些防火墙的设置会阻拦OpenNI的组件读取摄像头。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">【NITE】</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;同样的，如果安装在默认路径下，测试程序可以在C:\Program Files\OpenNI\Samples\Bin\Release下找到，小斤玩了下StickFigure，这个程序能在一个空间中显示出骨架。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">VS开发环境</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;要使用VS进行开发的话，需要配置include和lib路径。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;进入VS，点击菜单Tools，进入Options。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;在Projects and Solutions中，选择VC++Directories。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;假设OpenNI安装在默认路径下，则include files加入C:\Program Files\OpenNI\Include，Library files加入C:\ProgramFiles\OpenNI\Lib。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;这样VS的开发环境就配置好了。如果建立了OpenNI的开发项目，则还需要在项目属性&#8212;&#8212;Linker&#8212;&#8212;Input 中的Additional Denpendencies，加入openNI.lib。</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;（以上配置在VS2010中有些出入，include和library可能被移到项目属性中配置）</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;">&nbsp;</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;与OpenNI的Sample使用OpenGL不同，小斤之后的教程范例中，会使用OpenCV进行图像的输入输出，以简化程序（如果你看了OpenNI Sample的代码，会发现代码被OpenGL占了一大半）。大家可以在http://www.opencv.org.cn/上找到安装配置方法，小斤就不赘述了。（当然大家也可以直接无视范例中的OpenCV输出部分，把OpenNI读取的数据直接print出来。）</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">----------------------------------</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">作者：小斤（陈忻）</span></div><div><span style="font-weight: normal;"><br /></span></div><div><span style="font-size: 14pt; font-weight: normal;">本文属于原创文章，如需转载引用请注明原文作者和链接，谢谢。</span></div><div><span style="font-size: 14pt; font-weight: normal;">---------------------&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">作者：小斤陈&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">来源：CSDN&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">原文：https://blog.csdn.net/chenxin_130/article/details/6693390&nbsp;</span></div><div><span style="font-size: 14pt; font-weight: normal;">版权声明：本文为博主原创文章，转载请附上博文链接！</span></div></h1><img src ="http://www.cppblog.com/zmj/aggbug/216145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-12-26 17:43 <a href="http://www.cppblog.com/zmj/archive/2018/12/26/216145.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenNI1.5 VS2013配置环境后，编译会出现这个错误：</title><link>http://www.cppblog.com/zmj/archive/2018/12/26/216144.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 26 Dec 2018 09:39:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/12/26/216144.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216144.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/12/26/216144.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216144.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216144.html</trackback:ping><description><![CDATA[<h1><a id="cb_post_title_url" href="https://www.cnblogs.com/asmer-stone/p/5537111.html" style="margin: 0px; padding: 0px; outline: none; color: #21759b; text-decoration-line: none; transition: all 0.4s linear 0s;"></a></h1><div>https://www.cnblogs.com/asmer-stone/p/5537111.html<br /><br /><div><div><div>#error : Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!<span style="white-space:pre">	</span>解决方案</div><div>OpenNI1.5 VS2013配置环境后，编译会出现这个错误：</div><div></div><div>错误&nbsp; &nbsp; 4&nbsp; &nbsp; error C1189: #error :&nbsp; Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!&nbsp; &nbsp; c:\program files\openni\include\XnPlatform.h&nbsp; &nbsp; 57&nbsp; &nbsp; 1&nbsp; &nbsp; test</div><div>原因是OpenNI的 XnPlatform.h里边有一段版本检查代码:</div><div></div><div>复制代码</div><div>#ifndef RC_INVOKED</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #if _MSC_VER &lt; 1300 // Before MSVC7 (2003)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endif</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #if _MSC_VER &gt; 1600 // After MSVC8 (2010)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endif</div><div>&nbsp; &nbsp; #endif</div><div>复制代码</div><div>解决方案：</div><div></div><div>用管理员身份运行VS，打开项目，找到报错位置（会定向到XnPlatform.h），把1600改为1900， 保存即可</div></div></div></div><div style="margin: 0px; line-height: 1.7; font-family: &quot;Helvetica Neue&quot;, Helvetica, Verdana, Arial, sans-serif; background-color: #ffffff;"><div id="cnblogs_post_body" style="margin: 0px 0px 20px; word-break: break-word;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"></p></div></div><img src ="http://www.cppblog.com/zmj/aggbug/216144.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-12-26 17:39 <a href="http://www.cppblog.com/zmj/archive/2018/12/26/216144.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>全变分（TV）模型原理与C++实现</title><link>http://www.cppblog.com/zmj/archive/2018/11/29/216100.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 29 Nov 2018 02:47:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/29/216100.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216100.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/29/216100.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216100.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216100.html</trackback:ping><description><![CDATA[<div>https://blog.csdn.net/cyh706510441/article/details/45194223</div><br /><div>本文介绍了TV模型的基本原理，并给出了C++代码实现。</div><div>一、TV模型原理</div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div>二、C++实现</div><div></div><div>关于Matlab的程序实现，有一个经典的主页： http://visl.technion.ac.il/~gilboa/PDE-filt/tv_denoising.html</div><div></div><div>有博主改成了C++代码：见经典的变分法图像去噪的C++实现</div><div></div><div>另有博主改成了更简洁的版本：见【图像处理】全分发TV图像去噪</div><div></div><div>但精简版的有个问题：image[i][j] += dt*(tmp_num/tmp_den+ lam*(image0[i][j] - image[i][j]));&nbsp;</div><div></div><div>直接在image中迭代，这有问题，最后得到的去噪图像跟MATLAB得到的去噪图像有细微差别，对两幅图像做差值可发现差别。</div><div></div><div>本文代码基本参照上面的版本，把代码修改为（之前公式有误，已修改 2015年4月23日）：</div><div></div><div>void CImageObj::Total_Variation(int iter, double dt, double epsilon, double lambda)</div><div>{</div><div><span style="white-space:pre">	</span>int i, j;</div><div><span style="white-space:pre">	</span>int nx = m_width, ny = m_height;</div><div><span style="white-space:pre">	</span>double ep2 = epsilon * epsilon;</div><div>&nbsp;</div><div><span style="white-space:pre">	</span>double** I_t = NewDoubleMatrix(nx, ny);</div><div><span style="white-space:pre">	</span>double** I_tmp = NewDoubleMatrix(nx, ny);</div><div><span style="white-space:pre">	</span>for (i = 0; i &lt; ny; i++)</div><div><span style="white-space:pre">		</span>for (j = 0; j &lt; nx; j++)</div><div><span style="white-space:pre">			</span>I_t[i][j] = I_tmp[i][j] = (double)m_imgData[i][j];</div><div>&nbsp;</div><div><span style="white-space:pre">	</span>for (int t = 0; t &lt; iter; t++)</div><div><span style="white-space:pre">	</span>{</div><div><span style="white-space:pre">		</span>for (i = 0; i &lt; ny; i++)</div><div><span style="white-space:pre">		</span>{</div><div><span style="white-space:pre">			</span>for (j = 0; j &lt; nx; j++)</div><div><span style="white-space:pre">			</span>{</div><div><span style="white-space:pre">				</span>int iUp = i - 1, iDown = i + 1;</div><div><span style="white-space:pre">				</span>int jLeft = j - 1, jRight = j + 1;&nbsp; &nbsp; // 边界处理</div><div><span style="white-space:pre">				</span>if (0 == i) iUp = i; if (ny - 1 == i) iDown = i;</div><div><span style="white-space:pre">				</span>if (0 == j) jLeft = j; if (nx - 1 == j) jRight = j;</div><div>&nbsp;</div><div><span style="white-space:pre">				</span>double tmp_x = (I_t[i][jRight] - I_t[i][jLeft]) / 2.0;</div><div><span style="white-space:pre">				</span>double tmp_y = (I_t[iDown][j] - I_t[iUp][j]) / 2.0;</div><div><span style="white-space:pre">				</span>double tmp_xx = I_t[i][jRight] + I_t[i][jLeft] - 2 * I_t[i][j];</div><div><span style="white-space:pre">				</span>double tmp_yy = I_t[iDown][j] + I_t[iUp][j] - 2 * I_t[i][j];</div><div><span style="white-space:pre">				</span>double tmp_xy = (I_t[iDown][jRight] + I_t[iUp][jLeft] - I_t[iUp][jRight] - I_t[iDown][jLeft]) / 4.0;</div><div><span style="white-space:pre">				</span>double tmp_num = tmp_yy * (tmp_x * tmp_x + ep2) + tmp_xx * (tmp_y * tmp_y + ep2) - 2 * tmp_x * tmp_y * tmp_xy;</div><div><span style="white-space:pre">				</span>double tmp_den = pow(tmp_x * tmp_x + tmp_y * tmp_y + ep2, 1.5);</div><div>&nbsp;</div><div><span style="white-space:pre">				</span>I_tmp[i][j] += dt*(tmp_num / tmp_den + lambda*(m_imgData[i][j] - I_t[i][j]));</div><div><span style="white-space:pre">			</span>}</div><div><span style="white-space:pre">		</span>}&nbsp; // 一次迭代</div><div>&nbsp;</div><div><span style="white-space:pre">		</span>for (i = 0; i &lt; ny; i++)</div><div><span style="white-space:pre">			</span>for (j = 0; j &lt; nx; j++)</div><div><span style="white-space:pre">			</span>{</div><div><span style="white-space:pre">				</span>I_t[i][j] = I_tmp[i][j];</div><div><span style="white-space:pre">			</span>}</div><div>&nbsp;</div><div><span style="white-space:pre">	</span>} // 迭代结束</div><div>&nbsp;</div><div><span style="white-space:pre">	</span>// 给图像赋值</div><div><span style="white-space:pre">	</span>for (i = 0; i &lt; ny; i++)</div><div><span style="white-space:pre">		</span>for (j = 0; j &lt; nx; j++)</div><div><span style="white-space:pre">		</span>{</div><div><span style="white-space:pre">			</span>double tmp = I_t[i][j];</div><div><span style="white-space:pre">			</span>tmp = max(0, min(tmp, 255));</div><div><span style="white-space:pre">			</span>m_imgData[i][j] = (unsigned char)tmp;</div><div><span style="white-space:pre">		</span>}</div><div>&nbsp;</div><div><span style="white-space:pre">	</span>DeleteDoubleMatrix(I_t, nx, ny);</div><div><span style="white-space:pre">	</span>DeleteDoubleMatrix(I_tmp, nx, ny);</div><div>}</div><div>---------------------&nbsp;</div><div>作者：cyh706510441&nbsp;</div><div>来源：CSDN&nbsp;</div><div>原文：https://blog.csdn.net/cyh706510441/article/details/45194223&nbsp;</div><div>版权声明：本文为博主原创文章，转载请附上博文链接！</div><img src ="http://www.cppblog.com/zmj/aggbug/216100.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-29 10:47 <a href="http://www.cppblog.com/zmj/archive/2018/11/29/216100.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何把PDF变为6寸的尺寸</title><link>http://www.cppblog.com/zmj/archive/2018/11/23/216076.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 23 Nov 2018 01:09:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/23/216076.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216076.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/23/216076.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216076.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216076.html</trackback:ping><description><![CDATA[<p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">方法如下：</p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">1、用Acrobat打开一个任意<a href="https://www.baidu.com/s?wd=PDF%E6%96%87%E6%A1%A3&amp;tn=SE_PcZhidaonwhc_ngpagmjz&amp;rsv_dl=gh_pc_zhidao" target="_blank" style="color: #3f88bf; text-decoration-line: none;">PDF文档</a>；</p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">2、菜单--文件--打印配置，打印机选择Adobe PDF，点击右侧的&#8220;属性&#8221;，跳出&#8221;Adobe&nbsp;<a href="https://www.baidu.com/s?wd=PDF%E6%96%87%E6%A1%A3&amp;tn=SE_PcZhidaonwhc_ngpagmjz&amp;rsv_dl=gh_pc_zhidao" target="_blank" style="color: #3f88bf; text-decoration-line: none;">PDF文档</a>属性&#8221;界面</p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">3、在点击&#8221;Adobe PDF页面大小&#8220;右侧的&#8221;添加&#8221;</p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"><a href="https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/1c950a7b02087bf4efbe58eef6d3572c11dfcf63.jpg" target="_blank" title="点击查看大图" rel="nofollow" style="color: #3f88bf; text-decoration-line: none; display: block; position: relative; width: 481px; margin: 0px auto;"><img src="https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=f5576974fff2b211e47b8d48fab04900/1c950a7b02087bf4efbe58eef6d3572c11dfcf63.jpg" esrc="https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D450%2C600/sign=5511f0b761380cd7e64baae994748102/1c950a7b02087bf4efbe58eef6d3572c11dfcf63.jpg" style="border: 0px; max-width: 100%; max-height: 340px; vertical-align: bottom; border-radius: 6px; display: block; cursor: auto;"  alt="" /></a></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">4、在跳出的&#8221;添加自定义页面大小&#8220;中，如图示添加&#8220;6寸&#8221;纸张类型，并保存</p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"><a href="https://gss0.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/b17eca8065380cd7bdfbaeeaa544ad34588281cb.jpg" target="_blank" title="点击查看大图" rel="nofollow" style="color: #3f88bf; text-decoration-line: none; display: block; position: relative; width: 463px; margin: 0px auto;"><img src="https://gss0.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=b05ae86fc8bf6c81f76224ee8c0e9d0d/b17eca8065380cd7bdfbaeeaa544ad34588281cb.jpg" esrc="https://gss0.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D450%2C600/sign=35008509b53533faf5e39b2a9de3d129/b17eca8065380cd7bdfbaeeaa544ad34588281cb.jpg" style="border: 0px; max-width: 100%; max-height: 340px; vertical-align: bottom; border-radius: 6px; display: block; cursor: auto;"  alt="" /></a></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;"></p><p style="margin: 26px 0px; padding: 0px; color: #333333; font-family: &quot;PingFang SC&quot;, &quot;Lantinghei SC&quot;, &quot;Microsoft YaHei&quot;, arial, 宋体, sans-serif, tahoma; font-size: 16px; background-color: #ffffff;">5、用adobe&nbsp;<a href="https://www.baidu.com/s?wd=pdf%E6%89%93%E5%8D%B0%E6%9C%BA&amp;tn=SE_PcZhidaonwhc_ngpagmjz&amp;rsv_dl=gh_pc_zhidao" target="_blank" style="color: #3f88bf; text-decoration-line: none;">pdf打印机</a><a href="https://www.baidu.com/s?wd=%E6%89%93%E5%8D%B0pdf&amp;tn=SE_PcZhidaonwhc_ngpagmjz&amp;rsv_dl=gh_pc_zhidao" target="_blank" style="color: #3f88bf; text-decoration-line: none;">打印pdf</a>&#8594;纸张大小选择&#8220;6寸&#8221;即可。</p><img src ="http://www.cppblog.com/zmj/aggbug/216076.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-23 09:09 <a href="http://www.cppblog.com/zmj/archive/2018/11/23/216076.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>动量守恒与能量守恒相矛盾吗？</title><link>http://www.cppblog.com/zmj/archive/2018/11/20/216070.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 20 Nov 2018 08:32:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/20/216070.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216070.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/20/216070.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216070.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216070.html</trackback:ping><description><![CDATA[<div>https://www.zhihu.com/question/21540160<br /><br /><div><div><ul><li>证明末动能小于初动能： </li></ul><p>牛顿定律 <img src="https://www.zhihu.com/equation?tex=%5Cmathbf%7BF+%7D_%7Bi+%7D%3Dm+%5Cmathbf%7Ba+%7D_%7Bi+%7D%3Dm+_%7Bi+%7D%5Cfrac%7B%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+%7D%7B%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%7D" alt="\mathbf{F }_{i }=m \mathbf{a }_{i }=m _{i }\frac{\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, }{\, \mathrm{d } \, t  \, }" eeimg="1" /> ，Fi是第i个物体受的合力</p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%3Dm+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+" alt="\Rightarrow \mathbf{F }_{i }\, \mathrm{d } \, t  \, =m _{i }\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5Cmathbf%7BF+%7D_%7Bi+%7D%5Ccdot+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%3D%5Cmathbf%7BF+%7D_%7Bi+%7D%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%3Dm+_%7Bi+%7D%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+" alt="\Rightarrow \mathbf{F }_{i }\cdot \dot{\mathbf{r }}_{i }\, \mathrm{d } \, t  \, =\mathbf{F }_{i }\cdot \, \mathrm{d } \, \mathbf{r }_{i } \, =m _{i }\dot{\mathbf{r }}_{i }\cdot \, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5Cmathbf%7BF+%7D_%7Bi+%7D%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%3D%5C%2C+%5Cmathrm%7Bd+%7D+%5Cleft%28+%5Cfrac%7B1+%7D%7B2+%7Dm+_%7Bi+%7D%7B%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D%7D%5E%7B2+%7D%5Cright%29++%5C%2C+" alt="\Rightarrow \mathbf{F }_{i }\cdot \, \mathrm{d } \, \mathbf{r }_{i } \, =\, \mathrm{d } \left( \frac{1 }{2 }m _{i }{\dot{\mathbf{r }}_{i }}^{2 }\right)  \, " eeimg="1" /></p><p>咱们用T表动能</p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5Cleft%28+%5Cfrac%7B1+%7D%7B2+%7Dm+_%7Bi+%7D%7B%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D%7D%5E%7B2+%7D%5Cright%29++%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+T+_%7Bi+%7D+%5C%2C+%5C%3B+" alt="\Rightarrow \sum _{i }\mathbf{F }_{i }\cdot \, \mathrm{d } \, \mathbf{r }_{i } \, \; =\sum _{i }\, \mathrm{d } \left( \frac{1 }{2 }m _{i }{\dot{\mathbf{r }}_{i }}^{2 }\right)  \, \; =\sum _{i }\, \mathrm{d } \, T _{i } \, \; " eeimg="1" /></p><p>而 <img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+i+%5Cright%29+%7D%7D+%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%5C%3B+%2B%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+e+%5Cright%29+%7D%7D+%5Ccdot+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7Br+%7D_%7Bi+%7D+%5C%2C+%5C%3B+" alt="\sum _{i }\mathbf{F }_{i }\cdot \, \mathrm{d } \, \mathbf{r }_{i } \, \; =\sum _{i }{\mathbf{F }_{i }}^{{\left( i \right) }} \cdot \, \mathrm{d } \, \mathbf{r }_{i } \, \; +\sum _{i }{\mathbf{F }_{i }}^{{\left( e \right) }} \cdot \, \mathrm{d } \, \mathbf{r }_{i } \, \; " eeimg="1" /> i表内，e表外</p><p><img src="https://www.zhihu.com/equation?tex=%3D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+W+_%7B%E5%A4%96+%7D+%5C%2C+%2B%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+W+_%7B%E5%86%85+%7D+%5C%2C+" alt="=\, \mathrm{d } \, W _{外 } \, +\, \mathrm{d } \, W _{内 } \, " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+W+_%7B%E5%A4%96+%7D+%5C%2C+%2B%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+W+_%7B%E5%86%85+%7D+%5C%2C+%3D%5Csum+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+T+_%7Bi+%7D+%5C%2C+%5C%3B+" alt="\Rightarrow \, \mathrm{d } \, W _{外 } \, +\, \mathrm{d } \, W _{内 } \, =\sum _{i }\, \mathrm{d } \, T _{i } \, \; " eeimg="1" /></p><p>积个分</p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+W+_%7B%E5%A4%96+%7D%2BW+_%7B%E5%86%85+%7D%3D%5Csum+_%7Bi+%7D%5CDelta+T+_%7Bi+%7D%5C%3B+" alt="\Rightarrow W _{外 }+W _{内 }=\sum _{i }\Delta T _{i }\; " eeimg="1" /> 这是动能定理</p><p>如果非弹性碰撞的话，物体在受挤压力的时候向内凹陷，一定有内力负功，还有很少摩擦力，按物理语言，这些功转成了热</p><p><img src="https://www.zhihu.com/equation?tex=W+_%7B%E5%A4%96+%7D%2BW+_%7B%E5%86%85+%7D%3D-Q+%3C+0+" alt="W _{外 }+W _{内 }=-Q < 0 " eeimg="1" /></p><p>所以动能关系</p><p><img src="https://www.zhihu.com/equation?tex=%7B%5Cleft%28+%5Csum+_%7Bi+%7DT+_%7Bi+%7D%5C%3B+%5Cright%29+%7D_%7B%E6%9C%AB+%7D%3C+%7B%5Cleft%28+%5Csum+_%7Bi+%7DT+_%7Bi+%7D%5C%3B+%5Cright%29+%7D_%7B%E5%88%9D+%7D" alt="{\left( \sum _{i }T _{i }\; \right) }_{末 }< {\left( \sum _{i }T _{i }\; \right) }_{初 }" eeimg="1" /></p><p><br /></p><ul><li>动量守恒：</li></ul><p><img src="https://www.zhihu.com/equation?tex=%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%3Dm+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+" alt="\mathbf{F }_{i }\, \mathrm{d } \, t  \, =m _{i }\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5CRightarrow+%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7Dm+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+%5C%3B+" alt="\Rightarrow \sum _{i }\mathbf{F }_{i }\, \mathrm{d } \, t  \, \; =\sum _{i }m _{i }\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, \; " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+i+%5Cright%29+%7D%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+%2B%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+e+%5Cright%29+%7D%7D+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+" alt="\sum _{i }\mathbf{F }_{i }\, \mathrm{d } \, t  \, \; =\sum _{i }{\mathbf{F }_{i }}^{{\left( i \right) }}\, \mathrm{d } \, t  \, \; +\sum _{i }{\mathbf{F }_{i }}^{{\left( e \right) }} \, \mathrm{d } \, t  \, \; " eeimg="1" /></p><p>而物体间内力是成对出现的</p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+i+%5Cright%29+%7D%7D%5C%3B+%3D%5Csum+_%7Bi+%5Cneq+j+%7D%5Cmathbf%7BF+%7D_%7Bi+j+%7D%5C%3B+" alt="\sum _{i }{\mathbf{F }_{i }}^{{\left( i \right) }}\; =\sum _{i \neq j }\mathbf{F }_{i j }\; " eeimg="1" /></p><p>我们还有牛顿第三定律：</p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%5Cneq+j+%7D%5Cmathbf%7BF+%7D_%7Bi+j+%7D%5C%3B+%3D0+" alt="\sum _{i \neq j }\mathbf{F }_{i j }\; =0 " eeimg="1" /></p><p>所以合力的冲量元即为合外力的冲量元</p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+e+%5Cright%29+%7D%7D+%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+" alt="\sum _{i }\mathbf{F }_{i }\, \mathrm{d } \, t  \, \; =\sum _{i }{\mathbf{F }_{i }}^{{\left( e \right) }} \, \mathrm{d } \, t  \, \; " eeimg="1" /></p><p>用Ii表示第i个物体受合外力的冲量</p><p><img src="https://www.zhihu.com/equation?tex=%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7BI+%7D_%7Bi+%7D+%5C%2C+%3D%7B%5Cmathbf%7BF+%7D_%7Bi+%7D%7D%5E%7B%7B%5Cleft%28+e+%5Cright%29+%7D%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+" alt="\, \mathrm{d } \, \mathbf{I }_{i } \, ={\mathbf{F }_{i }}^{{\left( e \right) }}\, \mathrm{d } \, t  \, " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7D%5Cmathbf%7BF+%7D_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+t++%5C%2C+%5C%3B+%3D%5Csum+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7BI+%7D_%7Bi+%7D+%5C%2C+%5C%3B+%3D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7BI+%7D+%5C%2C+" alt="\sum _{i }\mathbf{F }_{i }\, \mathrm{d } \, t  \, \; =\sum _{i }\, \mathrm{d } \, \mathbf{I }_{i } \, \; =\, \mathrm{d } \, \mathbf{I } \, " eeimg="1" /></p><p>所以动量定理的微分式我们也有了，I是体系合外力的冲量</p><p><img src="https://www.zhihu.com/equation?tex=%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cmathbf%7BI+%7D+%5C%2C+%3D%5Csum+_%7Bi+%7Dm+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+%5C%3B+" alt="\, \mathrm{d } \, \mathbf{I } \, =\sum _{i }m _{i }\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, \; " eeimg="1" /></p><p>碰撞的话，一瞬间质点系的合外力为零</p><p><img src="https://www.zhihu.com/equation?tex=%5Cmathbf%7BI+%7D%3D%5Cmathbf%7B0+%7D" alt="\mathbf{I }=\mathbf{0 }" eeimg="1" /></p><p>自然有</p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7Dm+_%7Bi+%7D%5C%2C+%5Cmathrm%7Bd+%7D+%5C%2C+%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D+%5C%2C+%5C%3B+%3D%5Cmathbf%7B0+%7D" alt="\sum _{i }m _{i }\, \mathrm{d } \, \dot{\mathbf{r }}_{i } \, \; =\mathbf{0 }" eeimg="1" /></p><p>所以积分后就有我们的动量守恒律：</p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7Dm+_%7Bi+%7D%5Cdot%7B%5Cmathbf%7Br+%7D%7D_%7Bi+%7D%5C%3B+%3D%E5%B8%B8+" alt="\sum _{i }m _{i }\dot{\mathbf{r }}_{i }\; =常 " eeimg="1" /></p><p><img src="https://www.zhihu.com/equation?tex=%5Csum+_%7Bi+%7Dm+_%7Bi+%7D%5Cmathbf%7Bv+%7D_%7Bi+%7D%5C%3B+%3D%E5%AE%88%E6%81%92%E9%87%8F+" alt="\sum _{i }m _{i }\mathbf{v }_{i }\; =守恒量 " eeimg="1" /></p></div><br /><br />作者：沈飞<br />链接：https://www.zhihu.com/question/21540160/answer/469870033<br />来源：知乎<br />著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。</div></div><img src ="http://www.cppblog.com/zmj/aggbug/216070.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-20 16:32 <a href="http://www.cppblog.com/zmj/archive/2018/11/20/216070.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>双目视觉三维重建框架</title><link>http://www.cppblog.com/zmj/archive/2018/11/14/216063.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 14 Nov 2018 01:30:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/14/216063.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216063.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/14/216063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216063.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216063.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://blog.csdn.net/u014652390/article/details/79139010一、图像坐标：我想和世界坐标谈谈(A)玉米竭力用轻松具体的描述来讲述双目三维重建中的一些数学问题。希望这样的方式让大家以一个轻松的心态阅读玉米的《计算机视觉学习笔记》双目视觉数学架构系列博客。这个系列博客旨在捋顺一下已标定的双目视觉中的数学主线。数学推导是有着几分枯燥的，但奇妙的计算机...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2018/11/14/216063.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/216063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-14 09:30 <a href="http://www.cppblog.com/zmj/archive/2018/11/14/216063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于双目立体视觉的一些总结（二）</title><link>http://www.cppblog.com/zmj/archive/2018/11/13/216060.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 13 Nov 2018 06:54:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/13/216060.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216060.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/13/216060.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216060.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216060.html</trackback:ping><description><![CDATA[<div>https://blog.csdn.net/u014629875/article/details/51340144<br /><br /><div>上一篇只是对于双目立体视觉做了一个简单的介绍，这里就我在做这个的时候碰到的一些问题做一个梳理。</div><div></div><div>1.</div><div></div><div>首先要纠正一下之前一个错误：cvRemap函数只接受灰度图。其实这个函数要求src与dst大小格式通道必须一致就行，并不需要一定为灰度数据。当时下这个结论主要是因为被OpenCV的图像矩阵数据格式搞得很晕，为了先出个结果。后来有了要输出三通道数据的需要，倒是研究了一下OpenCV图像的数据格式。&nbsp;</div><div>矩阵元素类型包括了两部分信息，首先是元素数据的类型，还有就是该元素包含的通道个数。</div><div></div><div>/*Mat_&lt;uchar&gt;对应的是CV_8U，Mat_&lt;uchar&gt;对应的是CV_8U，Mat_&lt;char&gt;对应的是CV_8S，Mat_&lt;int&gt;对应的是CV_32S，Mat_&lt;float&gt;对应的是CV_32F，Mat_&lt;double&gt;对应的是CV_64F*/</div><div></div><div>#define CV_8U&nbsp; &nbsp;0</div><div>#define CV_8S&nbsp; &nbsp;1&nbsp; &nbsp;</div><div>#define CV_16U&nbsp; 2</div><div>#define CV_16S&nbsp; 3</div><div>#define CV_32S&nbsp; 4</div><div>#define CV_32F&nbsp; 5</div><div>#define CV_64F&nbsp; 6</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>灰度图就用CV_8U，三通道图就用CV_8UC3，像我得出的视差图数据就用CV_16S来存储，三维坐标信息的数据就用CV_32FC3的类型，总之按需求定。</div><div></div><div>2.</div><div></div><div>通过双目获取物体的三维信息之后，我的目标是把这个三维信息投影到地面平面上进行分析，所以需要建立空间坐标系与地面平面坐标系之间的转化关系。&nbsp;</div><div>由于我只需要一个投影面，并不需要关注这个面是不是就是地面，只需要与地面平行即可，所以并不需要事先测定地面，这样的话建立转化就简单了很多。</div><div></div><div>从左片中取一些地面上的像素点，计算出它们在空间坐标系中的三维坐标，用最小二乘拟合出这些点所在的平面Ax+By+Cz = D；</div><div>空间坐标系是以左相机光心为原点，视轴为Z轴，基线为X轴（方向指向右相机）的右手系。由于我只要求一个投影平面，坐标系可以任意，不妨取上述拟合平面Ax+By+Cz = D与Z轴的交点为地面平面坐标系的原点o，与X轴的交点作为x轴正半轴上的点，由此可建立一个地面投影面的坐标系。</div><div>几个坐标点：o（0，0，D）；x（DADA，0，0）；Y（-DA，D+DA2BD+DA2B，0）。可得到几个坐标向量：ox = （DADA，0，-D）；oy = （-DA，D+DA2BD+DA2B，-D）；oz = （A，B，C）；</div><div>假设空间中有一个点S（Xs，Ys，Zs）；向量oS = （Xs，Ys，Zs - D）；现在要求S在xoy平面上的投影，记作p。oS在oz上的投影为h = os&#8901;oz|oz|&#8901;ozos&#183;oz|oz|&#183;oz；所以op = oS - h，得到op之后求它在ox和oy上的投影即可得到投影面上的二维坐标。</div><div>这样三维信息就投影到了地面上，可以进行分析了。</div><div></div><div>3.</div><div></div><div>我需要把相机拍摄的运动物体（行人）提取出来，目前用的最多的有两种方法：&nbsp;</div><div>（1）基于背景建模：&nbsp;</div><div>利用背景建模方法，提取出前景运动的目标，在目标区域内进行特征提取，然后利用分类器进行分类，判断是否包含行人；</div><div></div><div>（2）基于统计学习的方法：&nbsp;</div><div>目前行人检测最常用的方法，根据大量的样本构建行人检测分类器。提取的特征主要有目标的灰度、边缘、纹理、颜色、梯度直方图等信息。</div><div></div><div>由于当前时间较紧，现阶段只有背景建模提取前景的方法，后续会尝试将两者结合使用。&nbsp;</div><div>我用的是最简单的方法，即帧差法，有两种普遍的方法，一种是前后帧相减，一种是三帧法，简要代码如下：</div><div></div><div>/*前后帧相减*/</div><div>VideoCapture video("../camera.avi");</div><div>Mat img1, img2, gray1, gray2, grayDiff;</div><div>int diff_threshold = 20;&nbsp; //帧差阈值</div><div></div><div>while(1)</div><div>{</div><div>&nbsp; &nbsp; video.read(img1);</div><div>&nbsp; &nbsp; objectDetector(img1);</div><div>&nbsp; &nbsp; cvtColor(img1,gray1,CV_BGR2GRAY);</div><div>&nbsp; &nbsp; video.read(img2);</div><div>&nbsp; &nbsp; cvtColor(img2,gray2,CV_BGR2GRAY);</div><div>&nbsp; &nbsp; subtract(gray1,gray2,grayDiff);</div><div></div><div>&nbsp; &nbsp; for(int i = 0; i &lt; grayDiff.rows; ++i)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for(int j = 0; j &lt; grayDiff.cols; ++j)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( abs(grayDiff.at&lt;uchar&gt;(i,j)) &gt;= diff_threshold )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff.at&lt;uchar&gt;(i,j) = 255;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff.at&lt;uchar&gt;(i,j) = 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; imshow("background",gray1);</div><div>&nbsp; &nbsp; imshow("zhencha",grayDiff);</div><div></div><div>&nbsp; &nbsp; char c = cvWaitKey(33);</div><div>&nbsp; &nbsp; if(c == 27)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>}</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>10</div><div>11</div><div>12</div><div>13</div><div>14</div><div>15</div><div>16</div><div>17</div><div>18</div><div>19</div><div>20</div><div>21</div><div>22</div><div>23</div><div>24</div><div>25</div><div>26</div><div>27</div><div>28</div><div>29</div><div>30</div><div>31</div><div>32</div><div>33</div><div>34</div><div>35</div><div>36</div><div></div><div>/*三帧法*/</div><div>VideoCapture video("../camera.avi");</div><div>Mat img1, img2, gray1, gray2;</div><div>Mat img3, gray3, grayDiff1, grayDiff2;</div><div>int diff_threshold = 20;&nbsp; //帧差阈值</div><div></div><div>while(1)</div><div>{</div><div>&nbsp; &nbsp; video.read(img1);</div><div>&nbsp; &nbsp; video.read(img2);</div><div>&nbsp; &nbsp; video.read(img3);</div><div>&nbsp; &nbsp; cvtColor(img1,gray1,CV_BGR2GRAY);</div><div>&nbsp; &nbsp; cvtColor(img2,gray2,CV_BGR2GRAY);</div><div>&nbsp; &nbsp; cvtColor(img3,gray3,CV_BGR2GRAY);</div><div></div><div>&nbsp; &nbsp; subtract(gray1,gray2,grayDiff1);</div><div>&nbsp; &nbsp; subtract(gray2,gray3,grayDiff2);</div><div></div><div>&nbsp; &nbsp; for(int i = 0; i &lt; grayDiff1.rows; ++i)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for(int j = 0; j &lt; grayDiff2.cols; ++j)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( abs(grayDiff1.at&lt;uchar&gt;(i,j)) &gt;= diff_threshold )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff1.at&lt;uchar&gt;(i,j) = 255;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff1.at&lt;uchar&gt;(i,j) = 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( abs(grayDiff2.at&lt;uchar&gt;(i,j)) &gt;= diff_threshold )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff2.at&lt;uchar&gt;(i,j) = 255;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grayDiff2.at&lt;uchar&gt;(i,j) = 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; bitwise_and(grayDiff1,grayDiff2,grayDiff);//和运算</div><div>&nbsp; &nbsp; imshow("background",img2);</div><div>&nbsp; &nbsp; imshow("zhencha",grayDiff);</div><div>&nbsp; &nbsp; char c = cvWaitKey(33);</div><div>&nbsp; &nbsp; if(c == 27)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>}</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>10</div><div>11</div><div>12</div><div>13</div><div>14</div><div>15</div><div>16</div><div>17</div><div>18</div><div>19</div><div>20</div><div>21</div><div>22</div><div>23</div><div>24</div><div>25</div><div>26</div><div>27</div><div>28</div><div>29</div><div>30</div><div>31</div><div>32</div><div>33</div><div>34</div><div>35</div><div>36</div><div>37</div><div>38</div><div>39</div><div>40</div><div>41</div><div>42</div><div>43</div><div>44</div><div>45</div><div>46</div><div>47</div><div>48</div><div>得到前景之后就可以利用之前建立的坐标系转换得到人在地面上的投影，即我需要使用的深度信息。&nbsp;</div><div></div><div>---------------------&nbsp;</div><div>作者：Array03&nbsp;</div><div>来源：CSDN&nbsp;</div><div>原文：https://blog.csdn.net/u014629875/article/details/51340144&nbsp;</div><div>版权声明：本文为博主原创文章，转载请附上博文链接！</div></div><img src ="http://www.cppblog.com/zmj/aggbug/216060.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-13 14:54 <a href="http://www.cppblog.com/zmj/archive/2018/11/13/216060.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于双目立体视觉的一些总结（一）</title><link>http://www.cppblog.com/zmj/archive/2018/11/13/216059.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 13 Nov 2018 06:52:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/13/216059.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216059.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/13/216059.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216059.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216059.html</trackback:ping><description><![CDATA[<div>https://blog.csdn.net/u014629875/article/details/51227534</div><div>由于项目和毕设的需要，最近在做一些立体视觉的东西，总算是把立体视觉建立起来了，中途查了很多相关资料，这里做一个总结。</div><div></div><div>1.简介：</div><div>双目视觉是模拟人类视觉原理，使用计算机被动感知距离的方法。从两个或者多个点观察一个物体，获取在不同视角下的图像，根据图像之间像素的匹配关系，通过三角测量原理计算出像素之间的偏移来获取物体的三维信息。得到了物体的景深信息，就可以计算出物体与相机之间的实际距离，物体3维大小，两点之间实际距离。</div><div></div><div>2.建立立体视觉</div><div>为了精确地求得某个点在三维空间里的深度信息，我们需要获得的参数有焦距f、视差d、摄像头中心距Tx；&nbsp;</div><div>为了获得某个点的X坐标和Y坐标，还需要知道左右像平面的坐标系与立体坐标系中原点的偏移cx和cy。&nbsp;</div><div>因此我们需要进行下列三个步骤：相机标定，图像校正，立体匹配。</div><div></div><div>相机标定</div><div>标定目的：获取相机的内参（焦距，图像中心，畸变系数等）和外参（R（旋转）矩阵T（平移）矩阵）&nbsp;</div><div>相机标定需要采集标定数据，通常使用打印棋盘格的纸作为特制的标定参照物，摄像头获取该物体的图像，并由此计算摄像头的内外参数。</div><div>相机标定有两种方法：&nbsp;</div><div>方法一：Bouguet的Matlab标定工具箱（http://www.vision.caltech.edu/bouguetj/calib_doc/）；有比较详细的介绍和使用方法，用起来还是比较方便的，只不过做完标定要继续的话要把标定结果存入xml导入OpenCV再进行。&nbsp;</div><div>方法二：OpenCV的cvStereoCalibrate；在《学习OpenCV》第11，12章有比较详细的介绍。12章后有相关程序代码。</div><div>双目图像校正</div><div>双目校正是根据摄像头定标后获得的单目内参数据（焦距、成像原点、畸变系数）和双目相对位置关系（旋转矩阵和平移向量），分别对左右视图进行消除畸变和行对准，使得左右视图的成像原点坐标一致、两摄像头光轴平行、左右成像平面共面、对极线行对齐。将左右视图调整成完全平行对准的理想形式（如下图）。&nbsp;</div><div>&nbsp;&nbsp;</div><div>校正反映到图像上就是要把消除畸变后的两幅图像严格地行对应，使得两幅图像的对极线恰好在同一水平线上，这样一幅图像上任意一点与其在另一幅图像上的对应点就必然具有相同的行号，只需在该行进行一维搜索即可匹配到对应点。下图来自于Stefano Mattoccia&nbsp;</div><div>&#8220;Stereo vision: algorithms and applications&#8221;http://vision.deis.unibo.it/~smatt/Seminars/StereoVision.pdf&nbsp;</div><div>（这个ppt对立体视觉做了一个很详尽的讲述，读了可以对立体视觉方面有一个比较好的了解）&nbsp;</div><div></div><div>我在这部分用的是OpenCV中的cvStereoRectify，得出校准参数之后用cvRemap来校准输入的左右图像。这里要提一下cvRemap这个函数src与dst大小格式通道必须一致，所以在使用之前要先对左右图像做处理。</div><div></div><div>立体匹配</div><div>立体匹配主要是通过找出每对图像间的对应关系，根据三角测量原理，得到视差图；在获得了视差信息后，根据投影模型很容易地可以得到原始图像的深度信息和三维信息。&nbsp;</div><div>立体匹配是建立立体视觉中最重要的一环，立体匹配的效果直接影响得到的三维信息。&nbsp;</div><div>由于现在只是使用了OpenCV的BM方法和SGBM方法，并没有做深入的了解，所以关于这方面后续会再写篇博客讨论一下这方面的问题。&nbsp;</div><div>BM方法：</div><div></div><div>CvStereoBMState *BMState = cvCreateStereoBMState();</div><div>assert(BMState != 0);</div><div></div><div>BMState-&gt;preFilterSize=41;</div><div>BMState-&gt;preFilterCap=31;</div><div>BMState-&gt;SADWindowSize=41;</div><div>BMState-&gt;minDisparity=-64;</div><div>BMState-&gt;numberOfDisparities=128;</div><div>BMState-&gt;textureThreshold=10;</div><div>BMState-&gt;uniquenessRatio=10;</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>10</div><div>SGBM方法：</div><div></div><div>cv::StereoSGBM sgbm;</div><div>sgbm.preFilterCap = 63;</div><div>int SADWindowSize=11;</div><div>int cn = 1;</div><div>sgbm.SADWindowSize = SADWindowSize &gt; 0 ? SADWindowSize : 3;</div><div>sgbm.P1 = 4*cn*sgbm.SADWindowSize*sgbm.SADWindowSize;</div><div>sgbm.P2 = 32*cn*sgbm.SADWindowSize*sgbm.SADWindowSize;</div><div>sgbm.minDisparity = 0;</div><div>sgbm.numberOfDisparities = 32;</div><div>sgbm.uniquenessRatio = 10;</div><div>sgbm.speckleWindowSize = 100;</div><div>sgbm.speckleRange = 32;</div><div>sgbm.disp12MaxDiff = 1;</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>10</div><div>11</div><div>12</div><div>13</div><div>立体匹配后得到视差图后获取三维信息的方式（世界坐标系是以左相机光心为原点，光轴为Z轴，基线为X轴的右手系）&nbsp;</div><div>这里有一点要注意，立体匹配得出的视差结果是以16位符号数的形式的存储的，出于精度需要，所有的视差在输出时都扩大了16倍(2^4)，因此，在实际求距离时，cvReprojectTo3D出来的X/W,Y/W,Z/W都要乘以16 (也就是W除以16)，才能得到正确的三维坐标信息。&nbsp;</div><div>一个简单的输出某个像素点三维信息的例子：</div><div></div><div>cvReprojectImageTo3D(disp,depth,&amp;_Qtest);//_Qtest是双目校正得到的Q矩阵</div><div>Point p;</div><div>p.x = 400;</div><div>p.y = 300;</div><div></div><div>Mat tempDepth = Mat(depth);</div><div>cout &lt;&lt; "in world coordinate: " &lt;&lt; tempDepth.at&lt;Vec3f&gt;(p)*16 &lt;&lt; endl;</div><div>---------------------&nbsp;</div><div>作者：Array03&nbsp;</div><div>来源：CSDN&nbsp;</div><div>原文：https://blog.csdn.net/u014629875/article/details/51227534&nbsp;</div><div>版权声明：本文为博主原创文章，转载请附上博文链接！</div><img src ="http://www.cppblog.com/zmj/aggbug/216059.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-13 14:52 <a href="http://www.cppblog.com/zmj/archive/2018/11/13/216059.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>双目立体视觉的数学原理</title><link>http://www.cppblog.com/zmj/archive/2018/11/13/216057.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 13 Nov 2018 06:31:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/13/216057.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216057.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/13/216057.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216057.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216057.html</trackback:ping><description><![CDATA[<div>1.前言戏说</div><div>双目立体视觉是基于视差原理，由多幅图像获取物体三维几何信息的方法。在机器视觉系统中，双目视觉一般由双摄像机从不同角度同时获取周围景物的两幅数字图像，或有由单摄像机在不同时刻从不同角度获取周围景物的两幅数字图像，并基于视差原理即可恢复出物体三维几何信息，重建周围景物的三维形状与位置。</div><div>双目视觉有的时候我们也会把它称为体视，是人类利用双眼获取环境三维信息的主要途径。从目前来看，随着机器视觉理论的发展，双目立体视觉在机器视觉研究中发回来看了越来越重要的作用。本篇帖子主要研究了双目视觉的数学原理。</div><div>2.双目立体视觉的数学原理</div><div>双目立体视觉是基于视差，由三角法原理进行三维信息的获取，即由两个摄像机的图像平面和北侧物体之间构成一个三角形。一直两个摄像机之间的位置关系，便可以获得两摄像机公共视场内物体的三维尺寸及空间物体特征点的三维坐标。所以，双目视觉系统一般由两个摄像机构成。</div><div>2.1 双目立体视觉三维测量原理</div><div></div><div>上图所示为简单的平视双目立体成像原理图，两摄像机的投影中心连线的距离，即基线距离B。两摄像机在同一时刻观看时空物体的同一特征点P，分别在&#8220;左眼&#8221;和&#8220;右眼&#8221;上获取了点P的图像，他们的坐标分别为Pleft=（Xleft,Yleft）；Pright=（Xright,Yright）。将定两摄像机的图像在同一平面上，则特征点P的图像坐标的Y坐标一定是相同的，即Yleft = Yright =Y。由三角几何关系可以得到如下关系式：</div><div></div><div>则视差为：Disparity=Xleft-Xright.由此可以计算出特征点P在摄像机坐标系下的三维坐标：</div><div></div><div>因此，左摄像机像面上的任意一点只要能在右摄像机像面上找到对应的匹配点，就完全可以确定该点的三维坐标。这种方法是点对点的运算，像平面上所有点只要存在相应的匹配点，就可以参与上述运算，从而获取对应的三维坐标。</div><div>2.2 双目立体视觉数学模型</div><div></div><div>在分析了最简单的平视双目立体视觉的三维测量原理基础上，现在我们就有能力来考虑一般情况。如上图所示，设左摄像机O-xyz位于世界坐标系原点，且没有发生旋转，图像坐标系为Ol-X1Y1，有效焦距为fl；右摄像机坐标系为Or-xyz，图像坐标系为Or-XrYr，有效焦距为fr。那么根据摄像机的投射模型我们就能得到如下关系式：</div><div>&nbsp;&nbsp;</div><div>因为O-xyz坐标系与Or-xryrzr坐标系之间的位置关系可通过空间转换矩阵MLr表示为：</div><div></div><div>同理，对于O-xyz坐标系中的空间点，两个摄像机面点之间的对应关系可以表示为：</div><div></div><div>于是，空间点三维坐标可以表示为</div><div></div><div>因此，只要我们通过计算机标定技术获得左右计算机内参数/焦距fr,fl和空间点在左右摄像机中的图像坐标，就能够重构出被测点的三维空间坐标。</div><div>---------------------&nbsp;</div><div>作者：沈子恒&nbsp;</div><div>来源：CSDN&nbsp;</div><div>原文：https://blog.csdn.net/shenziheng1/article/details/52883536&nbsp;</div><div>版权声明：本文为博主原创文章，转载请附上博文链接！</div><img src ="http://www.cppblog.com/zmj/aggbug/216057.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-13 14:31 <a href="http://www.cppblog.com/zmj/archive/2018/11/13/216057.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>最小二乘法拟合圆公式推导及其实现</title><link>http://www.cppblog.com/zmj/archive/2018/11/05/216035.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 05 Nov 2018 05:33:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/11/05/216035.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216035.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/11/05/216035.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216035.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216035.html</trackback:ping><description><![CDATA[<div>https://blog.csdn.net/Jacky_Ponder/article/details/70314919<br /><br /><div>1.1最小二乘拟合圆介绍与推导</div><div>最小二乘法(least squares analysis)是一种数学优化技术，它通过最小化误差的平方和找到一组数据的最佳函数匹配。最小二乘法是用最简的方法求得一些绝对不可知的真值，而令误差平方之和为最小来寻找一组数据的最佳匹配函数的计算方法，最小二乘法通常用于曲线拟合 (least squares fitting) 。最小二乘圆拟合方法是一种基于统计的检测方法，即便是图像中圆形目标受光照强度不均等因素的影响而产生边缘缺失，也不会影响圆心的定位和半径的检测，若边缘定位精确轮廓清晰，最小二乘法可实现亚像素级别的精确拟合定位。</div><div></div><div>这里有拟合圆曲线的公式推导过程和vc实现。</div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div>1.2VC实现的代码</div><div>[cpp] view plain copy</div><div>&lt;code class="language-cpp"&gt;void CViewActionImageTool::LeastSquaresFitting()&nbsp;&nbsp;</div><div>{&nbsp;&nbsp;</div><div>&nbsp; &nbsp; if (m_nNum&lt;3)&nbsp;&nbsp;</div><div>&nbsp; &nbsp; {&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; }&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; int i=0;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X1=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double Y1=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X2=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double Y2=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X3=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double Y3=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X1Y1=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X1Y2=0;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double X2Y1=0;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; for (i=0;i&lt;m_nNum;i++)&nbsp;&nbsp;</div><div>&nbsp; &nbsp; {&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X1 = X1 + m_points[i].x;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Y1 = Y1 + m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X2 = X2 + m_points[i].x*m_points[i].x;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Y2 = Y2 + m_points[i].y*m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X3 = X3 + m_points[i].x*m_points[i].x*m_points[i].x;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Y3 = Y3 + m_points[i].y*m_points[i].y*m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X1Y1 = X1Y1 + m_points[i].x*m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X1Y2 = X1Y2 + m_points[i].x*m_points[i].y*m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; X2Y1 = X2Y1 + m_points[i].x*m_points[i].x*m_points[i].y;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; }&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double C,D,E,G,H,N;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double a,b,c;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; N = m_nNum;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; C = N*X2 - X1*X1;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; D = N*X1Y1 - X1*Y1;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; E = N*X3 + N*X1Y2 - (X2+Y2)*X1;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; G = N*Y2 - Y1*Y1;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; H = N*X2Y1 + N*Y3 - (X2+Y2)*Y1;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; a = (H*D-E*G)/(C*G-D*D);&nbsp;&nbsp;</div><div>&nbsp; &nbsp; b = (H*C-E*D)/(D*D-G*C);&nbsp;&nbsp;</div><div>&nbsp; &nbsp; c = -(a*X1 + b*Y1 + X2 + Y2)/N;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; double A,B,R;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; A = a/(-2);&nbsp;&nbsp;</div><div>&nbsp; &nbsp; B = b/(-2);&nbsp;&nbsp;</div><div>&nbsp; &nbsp; R = sqrt(a*a+b*b-4*c)/2;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; m_fCenterX = A;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; m_fCenterY = B;&nbsp;&nbsp;</div><div>&nbsp; &nbsp; m_fRadius = R;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; return;&nbsp;&nbsp;</div><div>}&lt;/code&gt;&nbsp;&nbsp;</div><div>---------------------&nbsp;</div><div>作者：Jacky_Ponder&nbsp;</div><div>来源：CSDN&nbsp;</div><div>原文：https://blog.csdn.net/Jacky_Ponder/article/details/70314919&nbsp;</div><div>版权声明：本文为博主原创文章，转载请附上博文链接！</div></div><img src ="http://www.cppblog.com/zmj/aggbug/216035.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-11-05 13:33 <a href="http://www.cppblog.com/zmj/archive/2018/11/05/216035.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Math concepts / 数学概念</title><link>http://www.cppblog.com/zmj/archive/2018/10/24/216021.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 24 Oct 2018 07:25:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/10/24/216021.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/216021.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/10/24/216021.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/216021.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/216021.html</trackback:ping><description><![CDATA[ https://www.codelast.com/math-concepts-%E6%95%B0%E5%AD%A6%E6%A6%82%E5%BF%B5/
这里记录了我在学习过程中遇到或总结的一些基础数学概念，保存于此，与需要者共享。
Following are some basic math concepts I read or summarized in my learning process, I wrote them down here to share with those who need them.
（1）奇异函数
奇异函数是一种理想化的函数，它具有一个或多个间断点，在这些点上无法确定函数或其导数值。常用的有阶跃函数和冲激函数。
（2）奇点
所有不满足整体性质的个别点，在数学上都可以称为奇点。
如果奇点出现在分母极限为0的情况，通常来说就是产生无穷大解的表达式，在这种情况下数学计算失效。 
在复变函数中，奇点的定义：若函数（复变函数）f(z)在某点z0不解析，但在z0的任一邻域内都有f(z)的解析点，则z0称为f(z)的奇点（singular point）。
&#8220;奇点&#8221;是复变函数里的一个概念。在一个区域内可导的复变函数，称为这个区域内的解析函数，如果一个复变函数在挖掉点z的区域内解析，但在点z处不解析，则z称为这个解析函数的奇点。解析函数的奇点总是孤立的，奇点按其性质，可以分为：可去奇点、极点和本性奇点三大类。 
（3）病态多项式
&#8220;病态多项式&#8221;是与病态代数方程的概念相关的。
在代数方程中，有的多项式系数有微小扰动时其根变化很大，这种根对系数变化的敏感性称为不稳定性（instability），这种方程就是病态多项式方程。通常重根的方程是病态的，有几个根彼此很靠近，则这些根对系数的扰动也是敏感的，有时根看起来分隔得很好，但同样可能是病态的&#8212;&#8212;这段话来自《现代应用数学手册：计算与数值分析卷》一书。
由于在计算机数值算法中，求根过程总是通过迭代来完成的，而迭代过程又是通过一个初始解，不断地修改这个解，最后达到某个收敛标准为止，而一个病态多项式的系数微小变化就会引起根的很大变化，因此在迭代过程中可能导致求出的根不可信。
病态多项式的一个例子：
p(x)=(x&#8722;1)(x&#8722;2)(x&#8722;3)&#8943;(x&#8722;7)=x7&#8722;28x6+322x5&#8722;1960x4+6769x3&#8722;13132x2+13068x&#8722;5040
（4）超线性收敛
如果一种方法（这里指算法），是以前一次迭代的一阶幂乘以一个小于1的因子的速度收敛，则称这种方法为线性收敛（例如二分法），而以高阶幂收敛的方法称为超线性收敛。
具体描述：
设算法产生点列 {x(k)}，收敛到解 x&#8727;，且x(k)&#8800;x&#8727;,&#8704;k ，则
A）线性收敛：&#8741;&#8741;x(k+1)&#8722;x&#8727;&#8741;&#8741;&#8741;&#8741;x(k)&#8722;x&#8727;&#8741;&#8741;<1 ，当k充分大时成立
B）超线性收敛：limk&#8594;&#8734;&#8741;&#8741;x(k+1)&#8722;x&#8727;&#8741;&#8741;&#8741;&#8741;x(k)&#8722;x&#8727;&#8741;&#8741;=0
C）二阶收敛：&#8707;&#945;>0 ，当k充分大时有： &#8741;&#8741;x(k+1)&#8722;x&#8727;&#8741;&#8741;&#8741;&#8741;x(k)&#8722;x&#8727;&#8741;&#8741;2&#8804;&#945;
我们知道上面的符号||&#8230;&#8230;||是范数的符号，范数可以用来度量向量之间的距离。对最简单的情况&#8212;&#8212;一维向量来说&#8212;&#8212;上面的各个相减的式子就可以表示两点之间的距离。
（5）卷积
http://www.codelast.com/?p=994
（6）最小二乘的理论依据
http://www.codelast.com/?p=1027
（7）Powell算法
http://www.codelast.com/?p=388
（8）黄金比例搜索算法
http://www.codelast.com/?p=434
（9）奇异方程组
行退化或列退化的方程组称为奇异方程组。
（10）奇异值分解
一种处理奇异问题的方法，有时能将奇异问题转为非奇异问题来解决。
在很长时间内，奇异值分解都无法并行处理（虽然 Google 早就有了MapReduce 等并行计算的工具，但是由于奇异值分解很难拆成不相关子运算，即使在 Google 内部以前也无法利用并行计算的优势来分解矩阵）。
2007年初，Google 中国的张智威博士和几个中国的工程师及实习生已经实现了奇异值分解的并行算法，这是 Google中国对世界的一个贡献。
（11）主元
在解线性方程组时，通过加减乘除，将系数矩阵的a00，a11，a22，&#8230;&#8230;（即主对角线上的元素）化为单位矩阵的形式（其他元素均化为零），在每一次计算过程中，用作除数的元素即为主元/主元素。如果计算过程中完全没有&#8220;行交换&#8221;或&#8220;列交换&#8221;，则这种方法称为&#8220;不选主元&#8221;的方法。
（12）完全主元法 & 部分主元法
在解线性方程组的选主元法中，如果只有行交换操作，则称该方法为部分主元法；如果行交换和列交换操作都有，则称该方法为完全主元法。
（13）矩阵的初等变换
a、交换矩阵的两行（列）；
b、用一个不为零的数乘矩阵的某一行(列)；
c、用一个数乘矩阵某一行（列）加到另一行（列）上。
（14）外推法
一种 &#8220;根据已知的数值推断已知数值范围以外的数值&#8221; 的方法。
（15）Ridders求导算法
http://www.codelast.com/?p=1419
（16）线性/非线性规划
第一次看到这个名词的时候，你一定有一种它好高深的感觉，但实际上它不过是&#8220;最优化&#8221;问题的一种&#8220;特例&#8221;罢了。当最优化问题中的自变量的定义域是有限维空间中的一个子集时，这种问题就称为线性/非线性规划。举个简单的例子来说，对一个自变量为1维的函数f(x)=ax+b，自变量的定义域为（1, 9.8），它是1维空间的一个子集，那么，通过最优化方法来求解a、b的问题，就称为线性规划。但是要注意，当x只能取几个值时，例如x只能取1、5、9.8这几个值，则这种最优化问题就不叫线性/非线性规划了，而是叫组合优化。有时候这些界限划分得很清晰的概念反而让人觉得很混淆，我认为它们确实对理解问题起到了负面的作用。
平常看到的很多资料中，对这些类似的概念故弄玄虚的解释什么的，最让人不舒服了！
（17）凸集
凸集在最优化领域占有重要地位。其数学定义是：设有N维空间的子集D，如果对于任意的向量（也可以说是N维空间中的点）X1，X2&#8712;D，以及任意的实数a&#8712;[0, 1]，都有aX1+(1-a)X2&#8712;D，则称D为凸集。凸集的几何意义是：如果D为非空集合，则连接D中任意两个点X1、X2的线段仍属于该集合。
这似乎有点令人费解：aX1+(1-a)X2与两点之间的连线有什么关系呢？它表示连接这两点的线段上的任意一点。简单推导如下：假设X为线段X1X2上的任一点，则向量X2X（向量应该打上箭头，但是为了书写方便，我就省略了）平行于向量X2X1，且0&#8804; |X2X| &#8804; |X2X1| 。因此，存在a&#8712;[0, 1]，使得 X2X = a X2X1，即：X - X2 = a (X1 - X2)，即 X = aX1+(1-a)X2 。由于X是线段X1X2上任一点，因此前面的结论不言自明。
（18）半正定矩阵
n&#215;n的矩阵M，若对于任意非零的x&#8712;Rn，有xTMx&#8805;0，则称M为半正定矩阵。
（19）奇异矩阵
首先，一个矩阵必须是方阵，才有奇异或非奇异的概念。其次，若该矩阵的行列式为0，则其为奇异矩阵，否则就是非奇异矩阵。
可逆矩阵是非奇异矩阵，非奇异矩阵也是可逆矩阵。
（20）最速下降法/steepest descent，牛顿法/newton，共轭方向法/conjugate direction，共轭梯度法/conjugate gradient，etc.
http://www.codelast.com/?p=2573
（21）水平集
假设X&#8712;Rn，则集合S = {X&#8712;Rn| f(X) &#8804; a}称为一个水平集，其中a为常数。
（22）由两两线性无关的列向量构成的矩阵是满秩的
先看wikipedia的定义，就很容易明白了：两两线性无关的列向量构成的矩阵必然是满秩的。
（23）线性流形
&#8220;流形&#8221;（manifold）是数学中用于描述几何形体的一个概念，它是指局部具有欧几里得空间性质的空间。 欧几里得空间就是最简单的流形的实例。欧几里得空间也被理解为线性流形。
这个词听起来挺怪的，我想，要记住它，可以从表面含义来看：&#8220;流形&#8221;&#8212;&#8212;流动的形状，光滑的；&#8220;线性&#8221;&#8212;&#8212;连续的。结合起来，N维欧几里得空间Rn就是这么回事。
（24）满秩与正定的一个关系
设C为满秩矩阵，A为正定的实对称矩阵，则CTAC是正定的。因此可推出：若C是由两两线性无关的向量构成的矩阵（则其为满秩的），则CTAC正定。
（25）二次型
二次型是一些变量上的二次齐次多项式。齐次多项式是指各项的总次数均相同的多项式 ，例如 x5+ 2x3y2+ 9xy4就是一个五次的双变元（x和y）齐次多项式，其各项的总次数都是5。
（26）正定二次型
设有实二次型 f = XTAX，若对于任何X&#8800;0，都有 f(X)>0，则称 f 为正定二次型，并且称对称矩阵A为正定的。反之，若 f(X)<0，则称 f 为负定二次型。
（27）正定矩阵均可逆，并且其逆也是正定矩阵
（28）柯西不等式/柯西-施瓦茨不等式/Cauchy&#8211;Schwarz inequality
相当有用的一个不等式，表达式如下：
若把这个式子写成两个向量u，v的形式，则为：
（29）大O和小o：同阶无穷小与高阶无穷小
大O和小o分别代表同阶无穷小与高阶无穷小，注意不要弄混了。例如，&#946;与&#945;是同阶无穷小，记作&#946;=O(&#945;)；&#946;是比&#945;高阶的无穷小，记作&#946;=o(&#945;) 。
（30）稀疏矩阵：元素大部分为0的矩阵
（31）关于正定矩阵共轭的非零向量组线性无关
（32）实对称矩阵A正定的充分必要条件是存在可逆矩阵C，使得 A=CTC。由于可逆矩阵是正定矩阵，所以对称正定矩阵A满足：存在正定矩阵D，使得A=DTD
（33）每一个秩一矩阵都可以化为一个列向量与一个行向量之积
例如A为n&#215;n的秩一矩阵，则存在n&#215;1向量u，v，使得A=uvT
（34）驻点及鞍点
驻点：一阶导数为0的点。它包括3种类型：极小点、极大点、鞍点。
鞍点：沿某些方向是极小点；沿另一些方向是极大点，这样的点称为鞍点。想像一下马鞍的形状：马鞍凹下去的那部分的最低点，就是鞍点的一个例子（图片来源于网络，感谢原作者）：
（35）雅可比矩阵（Jacobi matrix）不一定是方阵（n&#215;n的矩阵）
（36）无解的线性方程组被称为是不相容的，有一或无穷多个解的线性方程组被称为是相容的
（37）若一个矩阵经过一系列行初等变换可以变成另一个矩阵，则称这两个矩阵是行等价的
（38）一元二次方程ax2+bx+c=0(a&#8800;0)的求根公式
<img src ="http://www.cppblog.com/zmj/aggbug/216021.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-10-24 15:25 <a href="http://www.cppblog.com/zmj/archive/2018/10/24/216021.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Qt中使用sleep</title><link>http://www.cppblog.com/zmj/archive/2018/10/09/215998.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 09 Oct 2018 09:33:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/10/09/215998.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215998.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/10/09/215998.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215998.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215998.html</trackback:ping><description><![CDATA[<div>https://blog.csdn.net/tingsking18/article/details/5304254<br /><div>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">关于</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数，我们先来看一下他的作用：</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数是使调用</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数的线程休眠，线程主动放弃时间片。当经过指定的时间间隔后，再启动线程，继续执行代码。</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数并不能起到定时的作用，主要作用是延时。在一些多线程中可能会看到</span><span style="margin: 0px;">sleep(0);</span><span style="margin: 0px; font-family: 宋体;">其主要目的是让出时间片。</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数的精度非常低，当系统越繁忙的时候它精度也就越低，有时候我们休眠</span><span style="margin: 0px;">1</span><span style="margin: 0px; font-family: 宋体;">秒，可能</span><span style="margin: 0px;">3</span><span style="margin: 0px; font-family: 宋体;">秒后才能继续执行。它的精度取决于线程自身优先级、其他线程的优先级，以及线程的数量等因素，所以说</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数是不能用来精确计时的。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">Qt</span><span style="margin: 0px; font-family: 宋体;">为我们提供了几个可以用于线程</span><span style="margin: 0px;">Sleep</span><span style="margin: 0px; font-family: 宋体;">的函数，分别是：</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">void QThread::sleep ( unsigned long secs )<span style="margin: 0px;">&nbsp;&nbsp; </span>[static protected] </span></p>  <p style="margin: 0px;"><span style="margin: 0px;">void QThread::msleep ( unsigned long msecs )<span style="margin: 0px;">&nbsp;&nbsp; </span>[static protected]</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">void QThread::usleep ( unsigned long usecs )<span style="margin: 0px;">&nbsp;&nbsp; </span>[static protected]</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的单位分别是秒、毫秒、微秒。</span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">但是现在问题出来了，请仔细看上面的函数定义，函数的访问权限都是</span><span style="margin: 0px;">protected</span><span style="margin: 0px; font-family: 宋体;">，这就意味着，我们必须在</span><span style="margin: 0px;">QThread</span><span style="margin: 0px; font-family: 宋体;">或者他的继承类中使用这三个函数。</span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">但是我们可能需要在非继承</span><span style="margin: 0px;">QThread</span><span style="margin: 0px; font-family: 宋体;">的类中来使用</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数。那这该这么办呢？下面我就给大家提供几种解决方法。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">1.<span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>processEvents</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>QTime dieTime = QTime::currentTime().addMSecs(svalue);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>while( QTime::currentTime() &lt; dieTime )</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>QCoreApplication::processEvents(QEventLoop::AllEvents, 100);</span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">调用</span><span style="margin: 0px;">processEvents</span><span style="margin: 0px; font-family: 宋体;">会让</span><span style="margin: 0px;">Qt</span><span style="margin: 0px; font-family: 宋体;">继续处理线程所在的消息队列中未处理的消息，直到消息队列中没有消息可以处理。当进行长时间的操作的时候可以调用此函数</span><span style="margin: 0px;">(</span><span style="margin: 0px; font-family: 宋体;">比方说拷贝文件</span><span style="margin: 0px;">)</span><span style="margin: 0px; font-family: 宋体;">。这个函数可能和我们要使用</span><span style="margin: 0px;">msleep</span><span style="margin: 0px; font-family: 宋体;">的本意有差别，但是使用它可以在</span><span style="margin: 0px;">svalue</span><span style="margin: 0px; font-family: 宋体;">时间内处理</span><span style="margin: 0px;">events</span><span style="margin: 0px; font-family: 宋体;">，从而达到类似</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的目的。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">2.<span style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>QWaitCondition</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>QWaitCondition wait;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>wait.wait(time);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">wait</span><span style="margin: 0px; font-family: 宋体;">的单位是</span><span style="margin: 0px;">milliseconds</span><span style="margin: 0px; font-family: 宋体;">，但是</span><span style="margin: 0px;">wait</span><span style="margin: 0px; font-family: 宋体;">和</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的作用是不同的。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">sleep()</span><span style="margin: 0px; font-family: 宋体;">方法是使线程停止一段时间的方法。在</span><span style="margin: 0px;">sleep </span><span style="margin: 0px; font-family: 宋体;">时间间隔期满后，线程不一定立即恢复执行。这是因为在那个时刻，其它线程可能正在运行而且没有被调度为放弃执行，除非</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">(a)</span><span style="margin: 0px; font-family: 宋体;">&#8220;醒来&#8221;的线程具有更高的优先级。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">(b)</span><span style="margin: 0px; font-family: 宋体;">正在运行的线程因为其它原因而阻塞。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">wait()</span><span style="margin: 0px; font-family: 宋体;">会使调用它的线程暂停执行，被调对象进入等待状态，直到被唤醒或等待时间到。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">3.<span style="margin: 0px;">&nbsp;&nbsp; </span><span style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="margin: 0px; font-family: 宋体;">查看</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的源代码，使用</span><span style="margin: 0px;">Qt</span><span style="margin: 0px; font-family: 宋体;">在</span><span style="margin: 0px;">win</span><span style="margin: 0px; font-family: 宋体;">下和</span><span style="margin: 0px;">*nix</span><span style="margin: 0px; font-family: 宋体;">下的</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">函数。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">Windows</span><span style="margin: 0px; font-family: 宋体;">下的</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的代码为：</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">void QThread::sleep(unsigned long secs)</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">{</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>::Sleep(secs * 1000);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">}</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的单位为秒。</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">*nix</span><span style="margin: 0px; font-family: 宋体;">下</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的代码为：</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">void QThread::sleep(unsigned long secs)</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">{</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>struct timeval tv;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>gettimeofday(&amp;tv, 0);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>struct timespec ti;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>ti.tv_sec = tv.tv_sec + secs;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>ti.tv_nsec = (tv.tv_usec * 1000);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>thread_sleep(&amp;ti);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">}</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">&nbsp;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">static void thread_sleep(struct timespec *ti)</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">{</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_mutex_t mtx;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_cond_t cnd;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">&nbsp;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_mutex_init(&amp;mtx, 0);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">&nbsp;<span style="margin: 0px;">&nbsp;&nbsp; </span>pthread_cond_init(&amp;cnd, 0);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">&nbsp;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_mutex_lock(&amp;mtx);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>(void) pthread_cond_timedwait(&amp;cnd, &amp;mtx, ti);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_mutex_unlock(&amp;mtx);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">&nbsp;</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_cond_destroy(&amp;cnd);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;"><span style="margin: 0px;">&nbsp;&nbsp;&nbsp; </span>pthread_mutex_destroy(&amp;mtx);</span></p>  <p style="margin: 0px;"><span style="margin: 0px;">}</span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">我们可以对这两个函数进行简单的封装，从而达到真正的</span><span style="margin: 0px;">sleep</span><span style="margin: 0px; font-family: 宋体;">的作用。</span></p>  <p style="margin: 0px;">&nbsp;</p>  <p style="margin: 0px;"><span style="margin: 0px;">---------------------</span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">作者：</span><span style="margin: 0px;">tingsking18 </span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">来源：</span><span style="margin: 0px;">CSDN </span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">原文：</span><span style="margin: 0px;">https://blog.csdn.net/tingsking18/article/details/5304254?utm_source=copy </span></p>  <p style="margin: 0px;"><span style="margin: 0px; font-family: 宋体;">版权声明：本文为博主原创文章，转载请附上博文链接！</span></p>  </div><strong></strong><em></em><u></u><sub></sub><sup></sup><strike></strike></div><img src ="http://www.cppblog.com/zmj/aggbug/215998.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-10-09 17:33 <a href="http://www.cppblog.com/zmj/archive/2018/10/09/215998.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>北京中通数字高尔夫公司</title><link>http://www.cppblog.com/zmj/archive/2018/09/14/215932.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 14 Sep 2018 09:03:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/09/14/215932.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215932.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/09/14/215932.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215932.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215932.html</trackback:ping><description><![CDATA[<h1><div style="display: inline-block;"><div class="company-digest" name="anchor" id="anchor" style="margin: 20px 0px 0px; padding-bottom: 25px; position: relative; color: #333333; font-family: Arial, simsun, sans-serif; font-size: 12px; font-weight: 400; background-color: #ffffff;"><div id="unifyprompt" class="information" style="margin: 0px;"><div class="summary" style="margin: 0px;"><div>http://www.digitgolf.com/news/golf/84.html<br />北京中通数字高尔夫以国家飞行仿真模拟实验室为技术依托，主要从事计算机仿真软件开发及相关工程的设计、实施和服务，是国内最早研发、生产和销售模拟高尔夫系统的高科技公司及中国最大的高尔夫模拟器销售商。 中通数字高尔夫也是EDH公司中国区合作伙伴，EDH全球领先的高尔夫雷达产品FlightScope高尔夫雷达中国市场总代理商。 http://www.digitgolf.com/</div><span style="display: block; text-align: right;"><a action="editsummaryhref" style="color: #0268cd;">编辑摘要</a></span></div></div></div><div id="content" style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><div style="margin: 0px; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;</div><div style="margin: 0px; text-align: center;"><strong>中通数字高尔夫，高尔夫模拟器与高尔夫雷达专业服务商</strong></div><div style="margin: 0px; text-align: center;"><strong><br /></strong></div><div style="margin: 0px; text-align: center;"><strong><div class="img img_c" style="margin: 0px; padding: 3px; background: #f7f7f7; color: #666666; position: relative; z-index: 0; width: 600px;"><a title="认识中通数字高尔夫" href="http://tupian.hudong.com/a3_77_19_21300534095629134380196821532_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="认识中通数字高尔夫" alt="认识中通数字高尔夫" src="http://a3.att.hudong.com/77/19/21300534095629134380196821532_950.jpg" width="803" style="border: 0px; width: 600px;" /></a><span style="font-size: 12px; font-weight: normal; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">认识中通数字高尔夫<strong>&nbsp;</strong></span></div></strong></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp;认识中通数字高尔夫</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;北京中通数字高尔夫以国家飞行仿真模拟实验室为技术依托，主要从事计算机仿真软件开发及相关工程的设计、实施和服务，是国内最早研发、生产和销售模拟高尔夫系统的高科技公司及中国最大的高尔夫模拟器销售商。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 基于北京中通数字高尔夫的多年模拟系统的开发实施经验，EDH公司与北京中通数字高尔夫在中国进行了广泛的合作，共同成立了北京数字化球场制作研发中心、软件研发中心。EDH公司指定中通数字高尔夫公司为其全球领先的FlightScope高尔夫雷达产品在中国市场的总代理，全面负责FlightScope相关产品在中国的销售、安装及售后服务。&nbsp; 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;　&nbsp;</p><a name="1" style="color: #0268cd; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></div></div></h1><h3 style="margin: 0px; padding: 0px; font-size: 14px;">&nbsp; &nbsp; 产品介绍 　</h3><h1><div style="display: inline-block;"><div style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><a name="3" style="color: #0268cd; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></div></div></h1><h3 style="margin: 0px; padding: 0px; font-size: 14px;">&nbsp; &nbsp; 一、&nbsp;DigitGolf模拟器&nbsp;</h3><h1><div style="display: inline-block;"><div style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　　弹道测量技术 DigitGolf室内模拟器的问世，将室内高尔夫模拟器推向一个全新的发展阶段。特有的军用雷达技术在高尔夫中模拟器中的运用，使DigitGolf成为众多高尔夫爱好者争抢的热门产品。&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 超大的画面，不拉伸、不变形，13M超大视角，可全景浏览真实球场！&nbsp;当您置身于13M的场景中，发现球道并没有变宽，影像依然精细流畅时，您才能真正体会到3D建模绘制的画面究竟有多么神奇!&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;DigitGolf是中国室内高尔夫行业发展最迅猛的企业，成立以来我们一直致力于高尔夫模拟器的研发和制造，现如今，产品在全球销量始终处于第一。我们为您提供足不出户、畅打世界知名球场的顶级高尔夫模拟器系统，并有两种性能卓越的高尔夫雷达产品供您选择，可满足您室内外的高尔夫需求。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; 产品特征 ：</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; 全球唯一采用EDH军用雷达技术，可进行弹道、侧旋、倒旋、挥杆等数据的精确捕捉。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; 全球唯一测量精准度达到99.9%的模拟器。&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><div class="img img_c" style="margin: 0px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; width: 455px;"><a title="DigitGolf模拟器" href="http://tupian.hudong.com/a4_52_25_21300534095629134380251625478_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="DigitGolf模拟器" alt="DigitGolf模拟器" src="http://a4.att.hudong.com/52/25/21300534095629134380251625478_950.jpg" width="455" style="border: 0px; width: 455px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">DigitGolf模拟器</span></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp; DigitGolf&nbsp;性能</strong>&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;1.一套模拟器，可供多位球员同时练习&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;2.&nbsp;多达36种比赛计分模式 &nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;3.&nbsp;差点评分调整&nbsp; 最佳球位和最远距离比赛</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;4.&nbsp;客户自定义打法（任意选择球洞、次序和次数</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;5.&nbsp;旗杆位置多样选择</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;6.&nbsp;动力增强选择&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;7.&nbsp;海拔高度自定义选择&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;8.&nbsp;果岭环境选择&nbsp; 　　&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>视频分析功能：</strong>DigitGolf最新的视频分析系统，设计用于与DigitGolf模拟器软件相结合。具有录制挥杆动作视频的功能，包括对视频进行划线、评注、录制CD、和上传到个人网页。&nbsp; 　　 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 &nbsp;<strong>用于娱乐中心：</strong>室内高尔夫球娱乐中心运作成功的关键是吸引客户和保持客源。DigitGolf模拟器被证明，每套模拟器都产生了最高的收入，并在本行业中具有最高的整体利用率，能帮助客户吸引顾客并保持娱乐性&nbsp; 　　 　　 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 &nbsp;<strong>动作分析系统：</strong>可以支持多达4个可选&nbsp;摄像机或任何单火线数字视频摄像机。&nbsp;　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;<strong>重心分析系统</strong>：提供精确的身体重心移动和平衡分析,极大地改善教学、安装和学习过程。 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;　&nbsp;<strong>数据分析：</strong>在线数据追踪软件可以让每位客户保有个人网页，存储所有发射监控器记录的数据。&nbsp; 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;</p><a name="5" style="color: #0268cd; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></div></div></h1><h3 style="margin: 0px; padding: 0px; font-size: 14px;">&nbsp; &nbsp;二、 UnionGolf模拟器&nbsp;</h3><h1><div style="display: inline-block;"><div style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><div style="margin: 0px;"></div><div style="margin: 0px;"><div class="img img_c" style="margin: 0px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; width: 505px;"><a title="UnionGolf模拟器" href="http://tupian.hudong.com/a0_21_22_21300534095629134380227035214_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="UnionGolf模拟器" alt="UnionGolf模拟器" src="http://a0.att.hudong.com/21/22/21300534095629134380227035214_950.jpg" width="505" style="border: 0px; width: 505px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">UnionGolf模拟器</span></div></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;　　<strong>横空出世&#183;新产品 　</strong>　 &nbsp;&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 经过10年的潜心研发和精雕细琢，中通数字高尔夫全新推出了革命性产品&#8212;&#8212;&#8212;UnionGolf室内&nbsp;模拟高尔夫。毫无疑问，在高尔夫模拟器领域中，UnionGolf高尔夫以其创造力和研发能力，处于行&nbsp;业的最顶端。结合三维量化追踪技术，在技术、科技、创新、销售和客户服务方面均傲视群雄，引&nbsp;领潮流。&nbsp; 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　&#9733;中国最大的室内高尔夫供应商 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　&#9733;测量精度达99.9% 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　&#9733;全球领先的3D引擎技术 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　&#9733;可以直接测量旋转的模拟器&nbsp; 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><div class="img img_r" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 600px;"><a title="UnionGolf模拟器" href="http://tupian.hudong.com/a4_83_21_21300534095629134380214828837_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="UnionGolf模拟器" alt="UnionGolf模拟器" src="http://a4.att.hudong.com/83/21/21300534095629134380214828837_950.jpg" width="600" style="border: 0px; width: 600px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">UnionGolf模拟器</span></div><br /><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>本质&#183;真实性和娱乐性&nbsp;</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　UnionGolf在真实性与娱乐性方面积累了不可或缺的经验，我们不断完善真实性与娱乐性，这些都会影响您对模拟器的体验。这些可以影响的因素包括：可见的精确度、画面的飘动感。 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#9733;&nbsp;独有的距洞最近和开球距离最远比赛形式是非常有诱惑力的。&nbsp; 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;学校、酒店、会所、家庭均适用。&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;引人注目的娱乐设施，可以吸引更多的客户。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;甚至在淡季也能保持强势的应用。&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;激发兴趣的娱乐经验，在任何赛事上，都具有杰出的吸引力。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;在赛事游戏中增加了娱乐性。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&#9733;&nbsp;也可以与家庭影院结合。&nbsp; 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;　<strong>追求完美&#183;室内模拟高尔夫</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 UnionGolf高尔夫推出第一台模拟器时就定下了宏伟目标，即重新定位模拟器，时刻把客户服务作为重要使命引领本行业的发展。在这些目标激励下，UG将继续增加研发投入，健全销售体系，并且不断将新技术引入新产品，不断提高客户服务水平，确保客户所使用的UnionGolf模拟器的先进性。UnionGolf模拟器之所以优越，重点在于它如何让你为之心醉。&nbsp;&nbsp;</p><div class="img img_c" style="margin: 0px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; width: 462px;"><a title="3D多普雷技术（军用雷达技术）" href="http://tupian.hudong.com/a2_72_24_21300534095629134380242526730_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="3D多普雷技术（军用雷达技术）" alt="3D多普雷技术（军用雷达技术）" src="http://a2.att.hudong.com/72/24/21300534095629134380242526730_950.jpg" width="462" style="border: 0px; width: 462px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">3D多普雷技术（军用雷达技术）</span></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>　 技术&#183;三维多普勒军用雷达</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 UnionGolf采用EDH公司的三维多普勒跟踪雷达技术(采用军用雷达技术)。已经申请专利的相控阵跟踪技术在设备中的使用，将UnionGolf的软件效果完美的展现，这意味着您将获得比任何同类产品更加精准的测量和跟踪数据。&nbsp;如果您希望找出自己高尔夫挥杆的分析数据，希望得到自己击球后的反馈，那么，三维多普勒跟踪雷达是您最好的选择。&nbsp;专业的服务团队，我们拥有从事技术调试工作多年的工程团队！最丰富的经验，最专业的技术为您量身打造独属于您的模拟器。24小时客服热线、48小时上门服务，我们做的不是产品，而是事业...&nbsp; 　　 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><a name="7" style="color: #0268cd; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></div></div></h1><h3 style="margin: 0px; padding: 0px; font-size: 14px;">　三、FlightScope&nbsp;X1雷达探测器 　</h3><h1><div style="display: inline-block;"><div style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><div style="margin: 0px;"></div><div style="margin: 0px;"><div class="img img_r" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 300px;"><a title="FlightScope X1 " href="http://tupian.hudong.com/a4_52_32_21300534095629134380327252222_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="FlightScope X1 " alt="FlightScope X1 " src="http://a4.att.hudong.com/52/32/21300534095629134380327252222_s.jpg" style="border: 0px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">FlightScope X1</span></div></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;全球唯一采用军用雷达技术(3D多普勒) 的高尔夫雷达品牌。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;Flightscope&nbsp;X1&nbsp;凭借优良的3D多普勒雷达技术，以每秒30000(帧)的雷达波频率，精准有效地测量您的每次完美挥杆数据。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;全球唯一测量精准度达到99.9%的立体测量仪器。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;全方位多点精准测量球速、杆速、倒旋、侧旋、落点、总距离、飞行高度等一系列挥杆数据。&nbsp;十几年以来，在全球销量始终处于领先位置.&nbsp;它可外接世界各种著名客户端软件，让您足不出户畅打全球著名球场.&nbsp;Flightscope&nbsp;X1&nbsp;可与姿势分析、重力分析、重心分析、视频分析等系统完美结合。&nbsp; 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>　 有效利用空间 　</strong></p><div class="img img_r" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 300px;"><strong><a title="Flightscope X1,占用空间小，用于室内监测" href="http://tupian.hudong.com/a2_15_30_21300534095629134380300861478_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="Flightscope X1,占用空间小，用于室内监测" alt="Flightscope X1,占用空间小，用于室内监测" src="http://a2.att.hudong.com/15/30/21300534095629134380300861478_s.jpg" style="border: 0px;" /></a><span style="font-size: 12px; font-weight: normal; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">Flightscope X1,占用空间小，用于室内监测</span></strong></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 Flightscope&nbsp;X1雷达安装部署于模拟器屏幕后80cm处，测量范围广阔、拆装简易方便、损耗极小，无辐射。&nbsp;打球时，球可以放置于通道垫的任何位置，其都可以进行挥杆的精准测量，准确度可达到99.9%。&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>Flightscope&nbsp;X1第三方标签扫描监测结果报告</strong>&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 通过连接扫描工具，Flightscope&nbsp;X1可以自动识别球杆型号,无需用户手动输入;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 在球具检测过程中，Flightscope&nbsp;X1可以快读阅读生产厂家在器材设备上标注的参数；</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　 　X1在测量之后会把所监测到的数据自动生成一个监测结果分析报告，它包含X1监测到的所有数据，如球杆材质、球属性、飞行、跟踪图像、挥杆数据及其它科学测试结果等等。这些数据方便球友了解自己所使用的球杆、球的性能及自己的击球情况。　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &#8730;.&nbsp;Flightscope&nbsp;X1集合诸多优势于一体，除了监测击球、挥杆外，它能够精准地分析各种木杆、铁杆、挖起杆及推杆的性能，给球友提供专业的器材配置建议；&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　　&#8730;.&nbsp;凭借高品质的3D跟踪雷达技术，Flightscope&nbsp;X1为球友带来精准的监测性能和数据可信度，并且极具价格优势；&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;<strong>精准监测，不受约束</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">&nbsp;　　Flightscope&nbsp;X1相控阵雷达传感器整个的监控过程由电磁波来完成，是世界上最精确的球迹弹道测量仪。Flightscope&nbsp;X1运用扩展排列测量系统，能够精确地测量任何条件下任何材质的高尔夫球的各项数据指标，而不受以下各项因素的限制： 　</span></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">　&#183;球的类型、杆的类型&nbsp;（包括使用任何球与任何球杆）&nbsp;</span></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">　&#183;转速比率&nbsp;（杆速与球速的比值&nbsp;也称：甜蜜点） 　</span></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">　&#183;海拔高度&nbsp;（安装场地的所处的位置的海拔高度） 　</span></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">　&#183;适度的天气条件&nbsp;（不论任何天气状况等不影响打球）&nbsp;</span> 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>　SIM传感器可测量的数据：</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;公司的SIM传感器应用专业的相控阵雷达技术，以每秒钟30000周期的惊人速度来测量运动中球杆与球的各项数据。 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">　SIM传感器通过出厂时的一次性校对，在使用的过程中几乎不需要再进行任何的调试，并且极少出现故障，即使出现故障，也可在短短的15分钟内排除。 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;　传感器系统的升级更新可直接通过邮件形式，也可在开机状态下自动下载。 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>Flightscope&nbsp;X1优势</strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>1、电磁波监控，精确测量不受外界影响：</strong>X1采用相控阵雷达传感器，整个监控过程由电磁波来完成，是世界上最精确的球迹弹道测量仪。它运用扩展排列测量系统能够精确地测量任何条件下、任何材质高尔夫球的各项数据指标，而不受球的类型、转速比率、海拔高度、天气条件等因素的限制。 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>2、全轨迹测量，精准度高达99%&nbsp;</strong>：一些感应器只能同时测量几个点或一些点，从局部的点推算球道轨迹，精确度不高。相控阵雷达传感器测量成千上万的点,&nbsp;完成对整个轨迹的测量，在球的飞行过程中不断测量垂直角度、水平角度和球的速度，所以弹道的测量精确度可达99%。 　　 　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>3、体积小、拆装方便：</strong>我们的传感器体积精巧，仅有普通辞海大小，其位于大屏幕的后部，拆装简易方便。 　　</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;<strong>4、调试简单，升级便捷：</strong>传感器通过出厂时的一次性校对，在使用的过程中几乎不需要再进行任何的调试，并且极少出现故障，即使出现故障，也可在短短的15分钟内排除。另外，传感器系统的升级、更新可直接通过邮件形式，也可通过自动下载的方式。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><div class="img img_r" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 600px;"><a title="Flightscope X2" href="http://tupian.hudong.com/a3_15_27_21300534095629134380274022487_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="Flightscope X2" alt="Flightscope X2" src="http://a3.att.hudong.com/15/27/21300534095629134380274022487_950.jpg" width="950" style="border: 0px; width: 600px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">Flightscope X2，便携设计，室内、户外都可以使用</span></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><div style="margin: 0px;"></div>&nbsp; &nbsp;&nbsp;<p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><a name="9" style="color: #0268cd; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></div></div></h1><h3 style="margin: 0px; padding: 0px; font-size: 14px;">&nbsp; 三、FlightScopeX2</h3><h1><div style="margin: 0px; clear: both; overflow: hidden; zoom: 1; font-size: 14px; line-height: 25px; word-wrap: break-word; width: 780px; color: #333333; font-family: Arial, simsun, sans-serif; font-weight: 400; background-color: #ffffff;"><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">&nbsp; &nbsp; FlightScopeX2雷达探测仪是中通高尔夫从EDH公司引进的全球最先进的高尔夫雷达，这是世界上目前唯一使用军用雷达技术的高尔夫雷达产品。它可以实现无线连接，摆脱了必须与台式电脑连接的弊端。与iphone、ipad、ipod、android手机等便携设备连接，让监测更简单、便捷。X2可以满足室内球的监测，也可以在户外使用，近年来国外很多职业球员更青睐X2，因为它可以在户外随时随地地实现高尔夫球的追踪及挥杆监测。</span><span style="color: red; background-color: yellow;"> X2可以精准追踪球的飞行整个轨迹，并准确测量球倒旋、侧旋、距离、杆面角度、挥杆速度、杆头速度&nbsp;、水平球杆路径&nbsp;、垂直球杆路径、挥杆路线、推杆加速度&nbsp;、杆面高度（离地面）&nbsp;、脚趾或脚后跟打击位置等多种数据</span>。在球具测评上，它能迅速识别球杆材质，分析挥杆数据，是高尔夫教练、球友、球具工坊的好帮手。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; &nbsp;<span style="white-space: pre;">FlightScope推出新一代雷达产品X2，&nbsp;您只要通过iPhone或者iPad就能观看&nbsp;和测量自己的挥杆、球速以及杆速等参&nbsp;数，摆脱与有线电脑连接才能使用的缺&nbsp;点。更小巧，更方便。<br />便携式雷达X2将带给您更进一步的精准&nbsp;测量！</span></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;&nbsp;<strong>FlightScopeX2 优势<br /></strong></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;1、电动水平脚&nbsp;<br />&nbsp; &nbsp;2、 商业可充电的镍氢电池 &nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;3、 延长到10小时电池寿命&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;4 、无线网路（Wi-Fi无线）连接&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;5 、蓝牙网络连接&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;6、 可连接电视等显示器&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;7 、兼容Android安卓系统手机、iPad、iPhone等便携设备&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp;三维多普勒跟踪雷达工作原理</strong><br />&nbsp;&#9670;&nbsp;振荡器&nbsp;生成微波信号&nbsp;天线&nbsp;辐射信号&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#9670;&nbsp;运动物体&nbsp;干扰信号&nbsp;反映能量&nbsp;运动转变</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#9670;&nbsp;相控阵天线&nbsp;检测反馈信号&nbsp;比较相位 &nbsp;<br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; 探测技术原理</strong><br />&nbsp; &nbsp;FlightScope的3D球跟踪技术，成功的秘诀在于已经申请专利的相控阵跟踪技术在设备中的使用。FlightScope&nbsp;3D追踪装置主要在于它的雷达技术（采用军用雷达技术）。 这意味着您将获得比任何同类产品更加精准的球测量和跟踪数据。 如果您希望找出自己高尔夫挥杆的分析数据，希望得到自己击球后的反馈，那么，三维多普勒跟踪雷达是您最好的选择。 综合性击球监视器</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;FlightScope&nbsp;X2&nbsp;不仅是击球监测器，X2代表了击球监视器产品类的重大突破，它集多种特性于一身，是非常吸引人的产品。 &#183;作为一种室内击球监测器，X2提供了关于球杆和球的广泛而且准确的数据。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#183;X2完全是一种3D装置，比2D系统的功能更强。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#183;在户外，X2作为一种长距离弹道跟踪装置，采用的是许多OEM和打高尔夫组织使用的相矩阵雷达技术。</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#183;但是成本相对较低。 &#183;X2无线网路（Wi-Fi无线）连接。&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp;&#183;X2兼容Android安卓系统手机、iPad、iPhone等便携设备.</p><div img_r"="" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 300px;"><a title="X2可监测多项数据" href="http://tupian.hudong.com/a3_44_28_21300534095629134380286340625_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="X2可监测多项数据" alt="X2可监测多项数据" src="http://a3.att.hudong.com/44/28/21300534095629134380286340625_s.jpg" style="border: 0px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">X2可监测多项数据</span></div><br /><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;<strong>X2可以直接测量：</strong><br />&#183;<span style="background-color: yellow;">球的周转率&nbsp;&#183;球的旋转&nbsp;&#183;球的上升&nbsp;&#183;球的垂直发球角度&nbsp;&#183;球的高度&nbsp;&#183;球的射程&nbsp;&#183;杆头速度&nbsp;&#183;水平球杆路径&nbsp;&#183;垂直球杆路径&#183;挥杆路线&nbsp;&#183;杆面扣角&nbsp;&#183;推杆速度&nbsp;&#183;推杆加速度&nbsp;&#183;杆面高度（离地面）&nbsp;&#183;脚趾或脚后跟打击位置等多种数据。</span><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><span style="background-color: yellow;">X2可以精准的测量出您的挥杆杆速、球速采用电磁感应雷达技术，可以准确鉴别高尔夫球的倒旋、侧旋</span>。它能够在几秒钟内进行设定，并且在更短的时间内进行校准。对多次纪录结果进行平均，就是高尔夫球者使用某特定推杆挥杆的结果。这种产品的灵敏度可以使指导者或者球杆调试人员确定杆面扣角或者推杆头方向和加速度每分钟的变化。在练习模式下，可以测量出您的挥杆加速度，从而进行校准。 &nbsp;</p><div img_r"="" style="margin: 10px 0px 10px 20px; padding: 3px; background: #f7f7f7; color: #666666; text-align: center; position: relative; z-index: 0; float: right; clear: right; width: 300px;"><a title="X2精准监测，让练球更有效" href="http://tupian.hudong.com/a0_40_29_21300534095629134380291684815_jpg.html?prd=zhengwenye_left_neirong_tupian" target="_blank" style="color: #0268cd; text-decoration-line: none;"><img title="X2精准监测，让练球更有效" alt="X2精准监测，让练球更有效" src="http://a0.att.hudong.com/40/29/21300534095629134380291684815_s.jpg" style="border: 0px;" /></a><span style="font-size: 12px; display: block; overflow: hidden; line-height: 18px; padding-top: 10px; clear: both; margin-top: -7px;">X2精准监测，让练球更有效</span></div><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp;用户认知<br /></strong>&nbsp; &nbsp;2010年美国PGA秋季博览会最佳新产品&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;2011年美国PGA博览会官方指定高尔夫追踪产品&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;圆石滩高尔夫学院唯一指定的高尔夫追踪用品&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;圣路易斯Golf&nbsp;Discount店面指定用品&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; 2012年BMW&nbsp;PGA锦标赛官方使用产品&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;Titleist大多数店面都设有为世界最好球员和高尔夫爱好者提供的高尔夫帮手&#8212;&#8212;X2。&nbsp; &nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><br /></p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;<strong>访问中通数字高尔夫公司网站</strong>：http://golf.digitgolf.com/&nbsp; &nbsp;&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp;关注中通数字高尔公司微博，即时了解行业动态</strong>：http://weibo.com/digitgolf &nbsp; &nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp;<strong>阅读中通数字高尔夫新浪博客：</strong>http://blog.sina.com.cn/u/2659198553&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;"><strong>&nbsp; &nbsp;联系中通数字高尔夫公司：</strong>&nbsp;&nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 销售电话：010-6267-0916 &nbsp;&nbsp;010-6267-0523 &nbsp; 客&nbsp;服：010-6267-0663 &nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 网&nbsp;址：http://golf.digitgolf.com/ &nbsp;&nbsp;</p><p style="margin: 0px; padding: 7px 0px; word-wrap: break-word; word-break: break-all;">&nbsp; &nbsp; 邮&nbsp;箱：winni@digitgolf.com&nbsp;&nbsp;</p></div></h1><img src ="http://www.cppblog.com/zmj/aggbug/215932.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-09-14 17:03 <a href="http://www.cppblog.com/zmj/archive/2018/09/14/215932.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>计算机图形学发展前景怎么样，现在研究领域一般都分哪些？</title><link>http://www.cppblog.com/zmj/archive/2018/09/13/215923.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 13 Sep 2018 00:56:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/09/13/215923.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215923.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/09/13/215923.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215923.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215923.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 王洋子豪软件工程师, 关注图形学，并行计算以及深度学习391 人赞同了该回答感谢邀请。这个话题太大了，我本人了解的就并不全面，研究的更只是其中一个很小的分支。不过我可以尽量尝试着讲一下。计算机图形学各个领域的目标或许不同，但最终的形式都是渲染(即绘制)在二维的显示设备上的图像。下面是一个简单（可能并不完全）的分类：计算机图形学-领域及分支：1 绘制1.1 真实感绘制(非实时)1.1.1 光线追踪(...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2018/09/13/215923.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215923.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-09-13 08:56 <a href="http://www.cppblog.com/zmj/archive/2018/09/13/215923.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>中国古代数学与西方数学有什么不同？</title><link>http://www.cppblog.com/zmj/archive/2018/06/08/215712.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 08 Jun 2018 07:39:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/06/08/215712.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215712.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/06/08/215712.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215712.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215712.html</trackback:ping><description><![CDATA[<p class="MsoNormal" style="text-indent: 21pt; line-height: 150%;"><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; &nbsp;中国古代对于世界的认识是循环闭合的体系，千变万化的现象背后存在着某种联系，它们相互依赖；而西方对于世界的认识是基于直链单向的因果，从一般的抽象化的概念与产生的衍生来解释特殊的现象。这两种思考导致了根本性的区别，那就是中国古代注重对于事物的理解，利用一个现象去解释另一个现象，发掘内在关联；而西方更注重于逻辑，建立一般理论将所有的现象统一于理论之下。进而我们能理解，为何西方可以诞生近代公理化，高度抽象化的数学体系，而中国数学则不成体系，以原始形态呈现在数学家面前。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;
line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　基于以上理解，我们不难理解，虽然中西方数学的起源非常类似，都是基于对于生活实践中遇到的问题进行归纳和理性的处理，然而中国数学的发展一直在延续前人的研究传统，即以直观现象或实例为基础，并加以运用。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;
line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　需要指出的是，西方近现代数学发展（从<span lang="EN-US" style="color: #993366; font-size: 18pt;">16</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪开始），与西方现代科学发展的传统，并非是直接继承从古希腊时期开始，由几何原本奠定下的公理化研究方法。事实上当我们考察无论是近代数学还是物理学的发展之初，都基于对经验事实的依赖和大胆的猜测与想象。从这一点上，中西方差异在于，西方率先使用一般的，抽象的方式来解释特殊问题，坚信世界所有的现象可以被统一在数中。不仅如此，他们善于从复杂的现象中归纳出&#8220;优美的性质&#8221;，并且坚信优美，简单的理论是世界的终极解释。所以<span lang="EN-US" style="color: #993366; font-size: 18pt;">16</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪初，数学与科学的蓬勃发展中，无不透露出对于这种朴素哲学观的贯彻。比如开普勒，早期的天文学，数学的探索者，在其重要著作《世界的和谐》中指出，将天文学与音乐完美结合在一起的可能性，并且被看作是世界的和谐。而这种朴素认识论正是西方近现代科学的开端。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;
line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　第二个重要问题是数学体系的建立和推演。必须承认的一点是，在体系的建立和推演上，中西方数学早早地分道扬镳。以《九章算术》为例，从内容上，中国古代数学问题的核心在于对实际问题的解释和再利用，故而卷分类以&#8220;方田&#8221;，&#8220;粟米&#8221;，&#8220;衰分&#8221;&#8220;少广&#8221;，&#8220;商功&#8221;等等实际生活场景进行分类。但是从数学内容上，九章算术不仅处理了大量复杂问题，而且包含了重要的哲学思想（如极限，分割，组合等）。最为流传的例子即&#8220;祖暅原理&#8221;，即判断两个物体的体积相同，可用&#8220;幂势既同，则积不容异&#8221;
这一原则进行判断，并且利用这个原理求出&#8220;牟合方盖&#8221;体积（所谓&#8220;牟合方盖&#8221;是指相同的两个圆柱正交围出的立体形）而这个立体形的体积求解是无法用初等数学解决，严格来说应使用微积分才能完全解决。而从其论述中，我们能看到朴素的积分思想，也展现了古代数学家杰出的数学直觉。同时，在研究的领域上有极大的弹性，从初等代数，初等数论到初等几何学（基于现代数学的观点）中的各个问题都有涉猎，并且给出了认识解决问题的重要思考。如卷八方程篇的开篇问题，即利用方程组思想解决问题，而以西方数学观点来看，所利用的正是高斯消元法。
再如广为乐道的中国剩余定理，以及勾股定理，涉及到了初等数学中大量重要核心命题。但是，从推导上，我们所给出的叙述性解释为主，而并非推导和计算。事实上，在《九章算术》中，只有遇到实际例子和少数公式上会进行计算，而原理性内容作为理解出现。
在这种情况下，数学的发展仅仅依靠极少数数学家不加证明的洞察给出进步，对于体系的发展本身是致命的。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;
color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　而在西方，数学的发展在初期也是大胆而富有想象力的，不过他们并没有停留于理解，而是用相对细致的逻辑链组织成数学语言表达出来。数学的活力最早是在艺术家的手上复活，无论是绘画（透视画法对射影几何的影响），音乐理论发展，激发了人们的思维。<span lang="EN-US" style="color: #993366; font-size: 18pt;">16,17</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪数学家的工作时常是不严谨，甚至也没有任何数学公理基础的保证，如欧拉关于很多无穷级数的处理，都是基于一些朴素的认识，从形式上获得灵感便不加证明的使用。这个阶段的数学，思想上的推动力其实与中国古代数学家一样，依赖于数学家的直觉进行研究。但是，之所以西方数学在经历相似时期之后有爆炸性发展，原因有二。其一，使用抽象符号对数学进行描述，使得数学从实际问题中解放出来，可以自由地组合，用简单方式刻画复杂事物，发挥想象力，不再受制于具象。其二，相对中国古代数学，西方数学家更重视逻辑链的建立，所以从因到果的过程更细致，为之后的研究打下坚实铺垫。而我们津津乐道的数学公理化与抽象化的工作都不是在早期完成，而是在<span lang="EN-US" style="color: #993366; font-size: 18pt;">18</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪开始被越来越多数学家重视。分析学的诞生事实上就是数学家对于精细逻辑链的探索，为微积分打下坚实理论基础，同时揭示了大量显然命题正确性的由来，使得人们对微积分体系认识更为深刻。与此同时物理学的蓬勃发展推动了大量计算技术的发展，将微积分应用至实际研究中去变成了一种共识。进入<span lang="EN-US" style="color: #993366; font-size: 18pt;">19</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪后，一方面微积分席卷了几乎原来所有的初等数学分支，另一方面近代代数学的发展提供了抽象工具，如群论，用以解释方程解而诞生的理论，所以接下来发展的数学分支变成了群论，复变函数论，几何学也焕发新的光芒。进入<span lang="EN-US" style="color: #993366; font-size: 18pt;">20</span></span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">世纪后，无论是公理化还是抽象化的工作都达到了顶峰，数学家意识到各个数学分支间是有紧密联系的，拓扑学，集合论，抽象代数的发展将零碎的研究和数学分支网罗在相互联系的，统一的架构中，真正成为一套体系。
从这一点上，中国古代数学传统是不可能演化出这样的体系的，其原因不仅仅在于认识论的不同，而是一个更深刻的问题。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;
color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　在《世界的重新创造》一文中提出，由于中国文化并未有真正的文化移植而导致中国科学的发展注定是不够好的论点，我是完全支持的。其一，截然不同的文化交流和碰撞会给两个文明都带来新的启示。其二，西方的文字系统更适合抽象性思维，而汉语由于其强大的组合能力和良好的直观性导致并未产生新的符号系统对数学进行描述，故而也很难进行复杂抽象的计算与推导。但是笔者认为，关键问题在于，为何中国古代数学与西方数学体系为何没有发生碰撞。从历史时期上来说，中国数学发展和西方数学发展存在一个大的时间差。中国数学的研究发源早，公元三世纪就已经有杰出的数学成果（九章算术最早成书亦是此时，由刘徽编纂成书）。而古希腊数学虽然亦有杰出成就，但是明显影响覆盖的范围远远不到东亚，最多至两河流域，再传入印度境内，而那已经时至公元八世纪。唐宋数学高度发达，并且九章算术逐渐演变为东亚的最重要的数学教科书。而在同时期的欧洲却在经历中世纪，以教会对世界解释权的垄断为主。一直到十三十四世纪时，经由印度，阿拉伯地区将数学原籍传回西欧社会，西方数学才开始发展，然而此时的中国是由蒙古人所统治的时期，数学发展明显受阻。进入十五世纪后，数学在欧洲开始复兴，进入蓬勃发展期，但中国数学却仍不温不火，并且越来越具有偏向性，在这一时期决定了中西方数学的差距。纵观来看，中西方数学发展的断档期对于双方的交流有很强的阻碍，没能在同一时期站在大致相似的高度上形成交流。
从政治上来说，中国古代数学的存在意义实则是为政治服务，所以研究注重实用性，偏向性，对于实际问题的解决很有一套，但是对建立系统性理论没有太大的热情。相较于西方对数学形而上的认识，中国的数学&#8220;合为时而用&#8221;，是可以&#8220;货与帝王家&#8221;的才能，如果没有政治支持，那么数学就没有发展土壤。也正因如此，中国的数学家也少之又少，数学文化的传播也并不是随心所欲。重要的，高级的计算技巧是不可能流入民间，自然也不可能催生中国整体上的数学发展。同时，即使在一部分重要的文献如论语，老子，周易等先后传入西方世界，然而东方的数学智慧却未曾到欧洲传播。而从研究方式和工具上，中国数学重视计算，重视实际结果。比如历法上的成就，所依托的正是极高的计算技巧。而这些技巧所依托的符号系统，相较于任何古代数学文明都是先进的。因为简易，而且是组合式的，再通过归纳，简写（比如百，千，万，亿的概念产生，再比如百万，千万，亿万这样的组合概念的产生），我们可以方便直观的表示极多数字，这对计算技巧的研究很有帮助。所以即使西方的符号体系，数字体系传入中国，但是在计算上的优越性必然导致这些不能取代千年沉淀的文字。<span lang="EN-US">&nbsp;<br /></span></span><span lang="EN-US" style="font-size:12.0pt;
line-height:150%;font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;;color:#363636"><br />
</span><span style="font-size: 18pt; line-height: 150%; font-family: 微软雅黑, sans-serif; color: #993366; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">　　而今有很多对比中西方科学发展的探讨，很多的目的在于给中国古代科技科学正名，提振民族自信心，这一点无可厚非，但是我们应本着客观公正的态度探讨。如果将核心观点始终立足于两套文化系统的不同上，进而找到一个平等的平衡点，笔者认为大可不必。无论是以前提出的&#8220;倘若假以时日中国也能发展到西方同样程度的科学&#8221;，还是现在提出的&#8220;中国的科学广义上是格致学，生命博物学&#8221;，其实都是在避重就轻地谈问题。且不论西方列强以武力手段打开中国的大门是否是导致中国本土科学流产的原因，就算是在双方互不干涉的前提下，科学的基础学科数学的发展速度就不在一个层次上。中国的数学发展是累积式的，线性的，是稳步发展的，但是西方数学的发展是爆炸式的，好比指数函数，只会发展的越来越快，这就是巨大差距。再有从广义科学角度上切入的观点，基本是上升至哲学层面的认识，不能仅仅停留于探讨不同的思路和想法就长舒一口气，认为找到了平等就可以安心一些。对于现在的学习科学，研究科学的中国人来说，如何汲取古代智慧是非常重要的。这绝不是要抛弃科学的方法论，而是用不同于西方机械唯心论的角度认识世界。值得借鉴的一案便是数学家吴文俊所发展的&#8220;吴方法&#8221;。吴文俊教授从古代算法思想入手，通过构建程序证明了大量初等几何学，射影几何学内容，取得了非凡的成果。而在科学分支庞杂林立的现代，大体量的科学系统其实反而成了限制人们继续探索的阻碍，如何从中国古代的整体观来认识科学，是一个很可能成功，也极为重要的课题。某种程度上，我们应该庆幸中国的哲学思想与西方并立，或许将带给世界最重要的启示。</span><span lang="EN-US" style="font-size:12.0pt;line-height:150%"><o:p></o:p></span></p><br /><span style="color: #993366; background-color: #ffffff; font-size: 18pt;"> </span><img src ="http://www.cppblog.com/zmj/aggbug/215712.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-06-08 15:39 <a href="http://www.cppblog.com/zmj/archive/2018/06/08/215712.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>极简西方数学史</title><link>http://www.cppblog.com/zmj/archive/2018/06/04/215700.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 04 Jun 2018 06:20:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/06/04/215700.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215700.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/06/04/215700.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215700.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215700.html</trackback:ping><description><![CDATA[<div>https://www.jianshu.com/p/f439a3542256<br /><br /><h1>极简西方数学史</h1><div data-note-content="" style="box-sizing: border-box; color: #2f2f2f; font-size: 16px; line-height: 1.7; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; background-color: #ffffff; word-break: break-word !important;"><div style="box-sizing: border-box;"><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 440px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 439.969px;"></div><div data-width="600" data-height="440" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 439.969px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-3cdfaeab30184427.jpg" src="//upload-images.jianshu.io/upload_images/3159686-3cdfaeab30184427.jpg" data-original-width="600" data-original-height="440" data-original-format="image/jpeg" data-original-filesize="111293" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 根据考古研究，我们已知最早的文明，两河文明，已经让初等数学在他们的生活中起到了不小的作用。巴比伦人的天文知识渊博而精确，例如关于太阳月，他们定出的值与真实值之间只差一秒。他们不光熟悉十进制，在计算大数的时候还补充了一种以六十为基数的进位制。一块距今约4300年的泥板表明，巴比伦人那时已经知道如何度量矩形、特殊三角形的面积，以及正多面体的体积。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 在外来者当中，有些人把苏美尔的影响和知识带到了埃及，在这里，文明也达到了很高的成就。因为纸草书的存在，我们对埃及的了解比对巴比伦的要多。埃及人对数学有着广泛的贡献，他们完成了基本的算数四则运算，并把它们推广到分数上，并且有了求近似平方根的方法。他们已经有了算数级数，几何级数，立体图形求积，初等三角函数以及二次方程的知识。然而，无论是巴比伦人还是埃及人，都没有对自然现象进行耐心仔细的考察，拥有概括推理的能力，因此这些古老的文明中并没有产生真正意义上的科学。<br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 228px; max-height: 236px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 236px;"></div><div data-width="228" data-height="236" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 228px; height: 236px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-0ec2e937259b5813.jpg" src="//upload-images.jianshu.io/upload_images/3159686-0ec2e937259b5813.jpg" data-original-width="228" data-original-height="236" data-original-format="image/jpeg" data-original-filesize="27836" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 虽然希腊人从古代文化中继承了大量资料，不过几乎所有人都承认，爱琴海的艾奥尼亚海岸是今天一切科学的起源。巴比伦人和埃及人从未想到过为了知识本身而去寻求知识的行为，而正是这种概念促使了&#8220;希腊的科学奇迹&#8221;的发生，这之中最惊人的进步便发生在数学上，并为其以后的发展奠定了永久的基础。以泰勒斯为首的艾奥尼亚学派将几何学等知识从埃及和巴比伦带回希腊，并提出了很多命题和基本原理。公元前6世纪末，由于波斯的入侵，人们向西方逃难，意大利和西西里岛变成了新的学术中心。建立于意大利南部的毕达哥拉斯学派把数学研究变成了一种自由教育的形式，整个数学变得更抽象，更加脱离经济生活需要了。毕达哥拉斯学派对数学发展产生了巨大影响，历时达两个世纪之久。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 波斯于公元前480年被希腊联军击败后，雅典成为了世界经济和文化中心。这时出现了旨在教育国民，转播文化的哲人派，他们的思考对尺规作图等几何问题的发展影响很大，其中就有芝诺那些关于无限的著名悖论。波斯游牧民族的威胁消除后，雅典与斯巴达之间的同盟就被猜忌与不和取代了。伯罗奔尼撒战争一直延续到公元前404年，那一年雅典被迫投降。这段时期是苏格拉底和柏拉图的时代。与老师苏格拉底醉心于国家和伦理不同，柏拉图在游历期间对数学产生了浓厚的兴趣。因此对后世影响深远的柏拉图学园的哲学也成了数学的哲学。伟大的学者，哲学家亚里士多德也是柏拉图学园的学生，他让人们明白了公理，公设和定义之间的区别，他的著作包含很多重要的定理。亚里士多德留下的大量著作，直接统治了后来的&#8220;复兴时期&#8221;的所有学说，即使那些错误的力学原理一直持续到16世纪。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 554px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 553.969px;"></div><div data-width="600" data-height="554" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 553.969px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-273d4df72a48fabe.jpg" src="//upload-images.jianshu.io/upload_images/3159686-273d4df72a48fabe.jpg" data-original-width="600" data-original-height="554" data-original-format="image/jpeg" data-original-filesize="107068" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 马其顿于公元前338年彻底击败雅典后，雅典城再也没能复兴起来。两年后，马其顿的新国王亚历山大大帝开始着手征服世界，建立了巨大而短暂的帝国。公元前332年，他在尼罗河畔建立了亚历山大城。这座城市后来的统治者托勒密与亚历山大大帝一样都是亚里士多德的学生，亚历山大城很快成为了新的经济与文化中心。从那以后，亚历山大这种学术中心的地位延续了千年，直到公元641年遭到阿拉伯人的洗劫。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 亚历山大城的学者中，有三个人决定了此后数百年数学的进程：欧几里得，阿基米德与阿波罗尼奥斯。于公元前320年由欧几里得编写的《几何原本》是欧式几何的奠基之作。欧几里得使用了公理化的方法，这一方法后来成了建立任何知识体系的典范，在两千年间被奉为必须遵守的严密思维的范例。阿基米德被称为古代最伟大的数学家。他的发现涉猎极广，如给出许多求几何图形重心，包括由一抛物线和其网平行弦线所围成图形的重心的方法，还有采用不断分割法求椭球体、旋转抛物体等的体积，这种方法已具有积分计算的雏形。阿波罗尼奥斯是天才的几何学家，著有《圆锥曲线》一书，它将圆锥曲线的性质网罗殆尽，几乎使后人没有插足的余地。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 450px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 450px;"></div><div data-width="600" data-height="450" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 450px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-976a7932566c2ee4.jpg" src="//upload-images.jianshu.io/upload_images/3159686-976a7932566c2ee4.jpg" data-original-width="600" data-original-height="450" data-original-format="image/jpeg" data-original-filesize="64098" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 公元元年以后，虽然在亚历山大的数学研究还在继续着，但人们对于这门学科的兴趣在逐渐减弱。希腊科学的黄金时代正在消褪，取而代之的是极端实际与不关心智慧追求的罗马文化，随后则是长达一千年的中世纪。这是黑暗的时代，希腊先哲们的荣光似乎远离了这块土地，无论是数学，还是其他思想，大都处于停滞乃至衰落状态。然而，天翻地覆的巨变正在缓缓酝酿着，而最终带来的，将是一场彻底的光明与复兴。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 388px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 388.016px;"></div><div data-width="600" data-height="388" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 388px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-8d7143451c2db9fd.jpg" src="//upload-images.jianshu.io/upload_images/3159686-8d7143451c2db9fd.jpg" data-original-width="600" data-original-height="388" data-original-format="image/jpeg" data-original-filesize="54272" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 虽然文艺复兴被普遍认为是&#8220;人类从来没有经历过的最伟大的、进步的变革&#8221;，不过对于数学而言，智慧的火焰在黑暗时期也在不停地涌现，反抗着。东方的拜占庭帝国一直维持着一个学术背景，保存了不少希腊学术著作。阿拉伯人崛起后，很快从东西方的合流中发展出了高度的文化，希腊文化也由此保留。基督教征服西班牙后，阿拉伯文化被西欧所利用，大量希腊著作被译为拉丁文。中国的指南针传到西方后，提高航海技术的强烈需要极大地影响了天文学和数学两门基础科学。不过中世纪的人们过于尊敬亚里士多德的权威地位，以至于出现了纯粹解释历史文献的学问。这与自然科学的理念背道而驰，在这样的气氛里，数学只能勉强维持下来。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 350px; max-height: 334px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 334px;"></div><div data-width="350" data-height="334" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 350px; height: 334px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-8a17e964c219baa5.jpg" src="//upload-images.jianshu.io/upload_images/3159686-8a17e964c219baa5.jpg" data-original-width="350" data-original-height="334" data-original-format="image/jpeg" data-original-filesize="48949" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 1453年，君士坦丁堡被土耳其人攻陷。继承了罗马和希腊，绵延千年的拜占庭帝国覆灭。许多学者带着著作来到意大利避难，受到了美第奇家族的欢迎。西方终于能够直接看到希腊经典著作的原文，而整个西方世界也揭开了那个最有名的繁盛时期。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 数学在这个全面复兴的局面中没有落后，不久它就获得了自从希腊文化衰落以来从未有过的领导地位。以前一直被忽视的算数开始兴起，三次和四次方程的解已经得出，负数甚至虚数获得了应有的地位，三角学开始作为一门独立学科出现，而属于物理学范畴却对本文及其重要的一个事实是：沉寂了18个世纪的力学，终于开始吸引人们的注意了。文艺复兴始于当时最强盛的意大利和德国，汉萨联盟仍然控制着北方的贸易，而佛罗伦萨和威尼斯正处于繁荣昌盛的顶峰。法国的重要性直到16世纪末才表现出来，并牢牢占据领导地位达一个世纪之久。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 291px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 291px;"></div><div data-width="600" data-height="291" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 291px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-ff4d92440cc810aa.jpg" src="//upload-images.jianshu.io/upload_images/3159686-ff4d92440cc810aa.jpg" data-original-width="600" data-original-height="291" data-original-format="image/jpeg" data-original-filesize="75135" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 1600年可能是数学史上最重要的一个世纪的开端。笛卡尔在此四年前出生，随后又有帕斯卡尔和费马诞生。这三个人注定要改变整个数学面貌。在16世纪，大多数数学科目都有了具体的进展，不过新世纪的开始预告了一个更为壮观的发展。代数在几何上的运用使笛卡尔让解析几何臻于完善，帕斯卡尔发展了射影几何，小数和对数的应用提升了计算方法，费马等人开始研究数论和概率论，古代极微分割方法被引人几何学，并最终导致了微积分的发明。在开普勒等前人的基础上，笛卡尔和费马分别发明了解析几何。笛卡尔的《几何学》是论述解析几何的一部经典之作。而对于概率论最早的探索，要归功于费马和帕斯卡尔。这一研究经过了漫长的历史，直到如今，仍然在吸引着众多科学家的注意力。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 随着数学的稳步前进，力学一直落在后面。虽然阿基米德指出过正确的方向，但在1800年来取得的进展很小。不过16世纪末开始，由于出现了机器，力学原理的研究终于开始了。伽利略，笛卡尔，惠更斯等人对这门学科做了极大的拓展。不过在他们手里，力学已经达到了这样的高度：如果不发明新的，更有力的方法，就几乎不可能取得进一步进展了，而同时期的数学的处境也差不多。幸运的是，这种现象并没有被耽搁很久，因为在1642年，牛顿出生了。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 600px; max-height: 450px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 450px;"></div><div data-width="600" data-height="450" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 450px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-8b7afd2cc957529d.jpg" src="//upload-images.jianshu.io/upload_images/3159686-8b7afd2cc957529d.jpg" data-original-width="600" data-original-height="450" data-original-format="image/jpeg" data-original-filesize="100634" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 微积分并非没有前身突然产生的，它是许多学者长期探索的思想结晶。在确定曲线图形的面积问题上，阿基米德曾用到了穷竭法，从中可以清楚地看到无穷小的分析原理，2000年后卡瓦列里又恢复了这方面的探索，经过托里拆利，费马，惠更斯，沃利斯等人的推广与改进，形成了积分学中求和的形式。在做曲线切线的问题上，阿基米德的螺线切线之后，笛卡尔和费马又做出了发展。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 牛顿的万有引力定律与二项式定理是伟大的贡献，而其不朽著作《原理》标志着经典力学体系的建立。其全书贯穿了流数，也就是微积分的概念。牛顿的重要性在于，他集各家之大成，提出了变化率，微分与积分互逆等微积分的基本概念，并把这个方法变成了一个完整的工具体系。在德国，微积分的原理是由莱布尼兹发展起来的。根据莱布尼兹自述，他是在1674年发明微积分的，牛顿声称他逐渐攻下流数是在1666年。由此，英国与欧洲大陆数学家分道扬镳，这是科学史上不幸的一章。在这场争论中，莱布尼兹的记法被用到了今天，而现在人们公认牛顿和莱布尼兹是各自独立创建微积分的。微积分的创立，标志着世界进入一个新纪元。从17世纪起，科学就开始将原来以基督教为中心的文化变革成现在这样以科学为中心的文化。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 590px; max-height: 413px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 413px;"></div><div data-width="590" data-height="413" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 590px; height: 413px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-7348381111f743c3.jpg" src="//upload-images.jianshu.io/upload_images/3159686-7348381111f743c3.jpg" data-original-width="590" data-original-height="413" data-original-format="image/jpeg" data-original-filesize="82501" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 1640年英国资产阶级革命后，英国确立了君主立宪制，世界进入了近代史时期。1701年普鲁士王国成立，1776年美国独立，1789年法国大革命，封建制度的衰亡和资本主义的成长是这一时期的中心内容，英国、德国、法国成为这一时期数学家的主要家园。在17世纪后半叶，数学取得了惊人的进展，微积分是强有力的工具，但必须批判地考察其基础。这就是下一个世纪的主要工作之一。在18世纪，数学的主流是由微积分发展起来的数学分析。数学分析的发展使力学和天体力学深化，而后者的课题又成了数学分析发展的动力。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 从数学家的角度而言，18世纪是&#8220;英雄的时代&#8221;，各路豪杰尽显威名，包括科学史上著名的伯努利家族；几乎对每个数学分支都做出了重要贡献的欧拉；赋予微积分清楚严谨的基础的柯西；18世纪最顶级的数学家拉格朗日；此外还有泰勒，麦克劳林，斯特林，兰登，傅里叶，等等，他们为发展微积分做出了突出贡献。而蒙日，卡诺和彭塞列则创立了近代几何的开端。拉格朗日于1766年受腓特烈大帝邀请来到柏林。这20年里，他的作品浩如烟海，并酝酿了他最伟大的著作《分析力学》。 当时，法国土地上的复兴气象正开始生成，巴黎再度成为数学教育中心。拉普拉斯和拉格朗日一样是分析学大师，他在天文力学上取得了惊人的成果，著有《天体力学》一书。 随着拿破仑的铁骑横扫欧陆，这个时代也是法国历史上科学成就最丰富的时代之一。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 400px; max-height: 343px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 343px;"></div><div data-width="400" data-height="343" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 400px; height: 343px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-5ec3e9e7c38e338e.jpg" src="//upload-images.jianshu.io/upload_images/3159686-5ec3e9e7c38e338e.jpg" data-original-width="400" data-original-height="343" data-original-format="image/jpeg" data-original-filesize="50143" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">18世纪末，法兰西的土地上已经取得了最大进展。随着19世纪的到来，德国很快跃居首位。高斯，阿贝尔，伽罗华等人发扬了费马在代数上的贡献。高斯是这个时代乃至所有时代最伟大的数学家，他对数学的严密性有更高的要求，他全面发展了纯粹数学和应用数学的所有领域。 由于高斯进行了各种各样的研究，数学已经变得越来越高度专门化了，更加脱离了经济生活的需要，学者们开始培养起为数学而研究数学的兴趣。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;">&nbsp; 1897年召开了国际数学家大会，揭开了20世纪纯粹数学大发展的时代，数学的分支很快变得越来越多，其中每个都是需要专家来研究的一门科目。企图涉猎整个领域的最后一人是庞加莱，目前来看，即使有第二个高斯出现，他能否涉及极少几个分支而显得游刃有余，那都是值得怀疑的。数学已经发展成为一个如此巨大的结构，对各个学科起着基石作用，而如今我们可以毫不含糊地说：数学就是一切科学之王。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px;"><div style="box-sizing: border-box; z-index: 100; position: relative; background-color: transparent; transition: background-color 0.1s linear; margin: 0px auto; max-width: 470px; max-height: 452px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 451.984px;"></div><div data-width="470" data-height="452" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 470px; height: 451.984px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/3159686-17d908989abb8880.jpg" src="//upload-images.jianshu.io/upload_images/3159686-17d908989abb8880.jpg" data-original-width="470" data-original-height="452" data-original-format="image/jpeg" data-original-filesize="58763" style="box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; height: auto; cursor: zoom-in; transition: all 0.15s linear; display: block; z-index: 100; filter: blur(0px); opacity: 1;"  alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; word-break: break-word !important;"><a href="https://www.jianshu.com/p/7bd82637135e" target="_blank" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;">极简日本漫画史</a></p></div></div></div><img src ="http://www.cppblog.com/zmj/aggbug/215700.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-06-04 14:20 <a href="http://www.cppblog.com/zmj/archive/2018/06/04/215700.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>自然科学/匀速圆周运动</title><link>http://www.cppblog.com/zmj/archive/2018/05/30/215695.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 30 May 2018 09:24:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/05/30/215695.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215695.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/05/30/215695.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215695.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215695.html</trackback:ping><description><![CDATA[<div><div>https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8</div><h1>自然科学/匀速圆周运动</h1><div id="bodyContent" style="position: relative; line-height: 1.6; font-size: 14.24px; z-index: 0; color: #222222; font-family: sans-serif;"><div id="siteSub" style="display: inline; font-size: 13.1008px;">维基教科书，自由的教学读本</div><div id="contentSub" dir="ltr" style="font-size: 12px; line-height: 1.2em; margin: 0px 0px 1.4em 1em; color: #54595d; width: auto;"><span style="display: block;">&lt;&nbsp;<a href="https://zh.wikibooks.org/wiki/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6" title="自然科学" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">自然科学</a></span></div><div id="jump-to-nav" style="overflow: hidden; height: 0px; zoom: 1; user-select: none; margin-top: -1.4em; margin-bottom: 1.4em;"><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#mw-head" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"></a><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#p-search" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"></a></div><div id="mw-content-text" dir="ltr" style="direction: ltr;"><div><div id="toc" style="border: 1px solid #a2a9b1; background-color: #f8f9fa; padding: 7px; font-size: 13.528px; display: table; zoom: 1;"><div dir="ltr" style="direction: ltr;"><h2>目录</h2><span style="user-select: none; font-size: 13.528px;">&nbsp;[<a role="button" tabindex="0" style="color: #0645ad; background: none; cursor: pointer;">隐藏</a>]&nbsp;</span></div><ul style="list-style-type: none; margin: 0.3em 0px; padding: 0px; list-style-image: none;"><li tocsection-1"="" style="margin-bottom: 0.1em;"><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#%E5%8C%80%E9%80%9F" style="text-decoration-line: none; color: #0b0080; background: none;"><span style="display: table-cell; text-decoration: inherit; padding-left: 0px; padding-right: 0.5em; color: #222222;">1</span><span style="display: table-cell; text-decoration: inherit;">匀速</span></a></li><li tocsection-2"="" style="margin-bottom: 0.1em;"><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#%E5%8A%A0%E9%80%9F%E5%BA%A6%E5%92%8C%E5%90%91%E5%BF%83%E5%8A%9B" style="text-decoration-line: none; color: #0b0080; background: none;"><span style="display: table-cell; text-decoration: inherit; padding-left: 0px; padding-right: 0.5em; color: #222222;">2</span><span style="display: table-cell; text-decoration: inherit;">加速度和向心力</span></a></li><li tocsection-3"="" style="margin-bottom: 0.1em;"><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#%E7%BA%BF%E9%80%9F%E5%BA%A6%E5%92%8C%E8%A7%92%E9%80%9F%E5%BA%A6" style="text-decoration-line: none; color: #0b0080; background: none;"><span style="display: table-cell; text-decoration: inherit; padding-left: 0px; padding-right: 0.5em; color: #222222;">3</span><span style="display: table-cell; text-decoration: inherit;">线速度和角速度</span></a></li><li tocsection-4"="" style="margin-bottom: 0.1em;"><a href="https://zh.wikibooks.org/zh-sg/%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8#%E4%BC%AA%E7%9F%A2%E9%87%8F" style="text-decoration-line: none; color: #0b0080; background: none;"><span style="display: table-cell; text-decoration: inherit; padding-left: 0px; padding-right: 0.5em; color: #222222;">4</span><span style="display: table-cell; text-decoration: inherit;">伪矢量</span></a></li></ul></div><h2><span id="匀速">匀速</span><span style="user-select: none; font-size: small; margin-left: 1em; vertical-align: baseline; line-height: 1em; white-space: nowrap; unicode-bidi: isolate;"><span style="margin-right: 0.25em; color: #54595d;">[</span><a href="https://zh.wikibooks.org/w/index.php?title=%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8&amp;action=edit&amp;section=1" title="编辑小节：匀速" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">编辑</a><span style="margin-left: 0.25em; color: #54595d;">]</span></span></h2><p style="margin: 0.5em 0px; line-height: inherit;">匀速圆周运动，顾名思义，物体以&#8220;匀速&#8221;做圆周运动。如果你已经将矢量的概念理解透彻，那么你一定应该知道，这里的&#8220;匀速&#8221;绝不是指速度，因为物体做曲线运动，速度无时无刻没有变化。我们之后会提到，这里的速度实际上是指线速度，也就是物体运动的速率。为了方便表述，在本章中，我们直接用圆心来称呼物体做圆周运动的轨迹圆的圆心。 匀速圆周运动是一类重要的运动，广泛存在于自然界中。很多的运动，都可以被视作匀速圆周运动，如行星上某一天随着行星自传绕自转中心的运动，就可以被视作匀速圆周运动。</p><h2><span id="加速度和向心力">加速度和向心力</span><span style="user-select: none; font-size: small; margin-left: 1em; vertical-align: baseline; line-height: 1em; white-space: nowrap; unicode-bidi: isolate;"><span style="margin-right: 0.25em; color: #54595d;">[</span><a href="https://zh.wikibooks.org/w/index.php?title=%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8&amp;action=edit&amp;section=2" title="编辑小节：加速度和向心力" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">编辑</a><span style="margin-left: 0.25em; color: #54595d;">]</span></span></h2><div tright"="" style="clear: right; float: right; margin: 0.5em 0px 1.3em 1.4em; width: auto; border-color: #f8fcff;"><div style="border: 1px solid #c8ccd1; padding: 3px; background-color: #f8f9fa; font-size: 13.528px; text-align: center; overflow: hidden; width: 222px;"><a href="https://zh.wikibooks.org/wiki/File:%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png" style="text-decoration-line: none; color: #0b0080; background: none;"><img alt="" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png/220px-%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png" width="220" height="221" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/1d/%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png/330px-%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png 1.5x, //upload.wikimedia.org/wikipedia/commons/1/1d/%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png 2x" data-file-width="423" data-file-height="424" style="border: 1px solid #c8ccd1; vertical-align: middle; background-color: #ffffff;" /></a><div style="border: 0px; line-height: 1.4em; padding: 3px; font-size: 12.8516px;"><div style="float: right; margin-left: 3px; font-size: 12.209px; margin-right: 0px;"><a href="https://zh.wikibooks.org/wiki/File:%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8.png" title="放大" style="text-decoration-line: none; color: #0b0080; background: linear-gradient(transparent, transparent), url(&quot;data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 11 15%22 width=%2215%22 height=%2211%22%3E %3Cg id=%22magnify-clip%22 fill=%22%23fff%22 stroke=%22%23000%22%3E %3Cpath id=%22bigbox%22 d=%22M1.509 1.865h10.99v7.919h-10.99z%22/%3E %3Cpath id=%22smallbox%22 d=%22M-1.499 6.868h5.943v4.904h-5.943z%22/%3E %3C/g%3E %3C/svg%3E&quot;); display: block; text-indent: 15px; white-space: nowrap; overflow: hidden; width: 15px; height: 11px; user-select: none;"></a></div>示例图1 匀速圆周运动的向心力公式推导</div></div></div><p style="margin: 0.5em 0px; line-height: inherit;">做匀速圆周运动的物体，速度无时无刻没有变化，因此肯定有一个加速度来改变速度，我们现在来探究这个加速度究竟是怎样的一个加速度。</p><p style="margin: 0.5em 0px; line-height: inherit;">如示例图1所示的匀速圆周运动，在<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/02d3006c4190b1939b04d9b9bb21006fb4e6fa4a" aria-hidden="true" alt="t_{0}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 1.894ex; height: 2.343ex;" />时刻，物体运动的速度为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ebe4391971d74f437e66bb14c44677c0837a10b4" aria-hidden="true" alt="{\displaystyle {\boldsymbol {v_{0}}}}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 2.495ex; height: 2.009ex;" />,并且在经过<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8c28867ecd34e2caed12cf38feadf6a81a7ee542" aria-hidden="true" alt="\Delta t" style="border: 0px; vertical-align: -0.338ex; margin: 0px; display: inline-block; width: 2.775ex; height: 2.176ex;" />后的<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cb0768c0bd659f2f84fb5ef9f4b74f336123d915" aria-hidden="true" alt="{\displaystyle t_{1}}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 1.894ex; height: 2.343ex;" />时刻，速度为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d1bff5ed76563d86a81a4a66f41a34a326607a6b" aria-hidden="true" alt="{\displaystyle {\boldsymbol {v_{1}}}}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 2.495ex; height: 2.009ex;" />，这段时间物体运动的轨迹圆弧所对的圆心角为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af" aria-hidden="true" alt="\theta " style="border: 0px; vertical-align: -0.338ex; margin: 0px; display: inline-block; width: 1.09ex; height: 2.176ex;" />，且无论在任何时刻，物体运动的速率都为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e07b00e7fc0847fbd16391c778d65bc25c452597" aria-hidden="true" alt="{\displaystyle v}" style="border: 0px; vertical-align: -0.338ex; margin: 0px; display: inline-block; width: 1.128ex; height: 1.676ex;" />。如果我们以A为原点，AG为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" aria-hidden="true" alt="{\displaystyle y}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 1.155ex; height: 2.009ex;" />轴负方向，<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ebe4391971d74f437e66bb14c44677c0837a10b4" aria-hidden="true" alt="{\displaystyle {\boldsymbol {v_{0}}}}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 2.495ex; height: 2.009ex;" />方向为<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/87f9e315fd7e2ba406057a97300593c4802b53e4" aria-hidden="true" alt="x" style="border: 0px; vertical-align: -0.338ex; margin: 0px; display: inline-block; width: 1.33ex; height: 1.676ex;" />轴正方向建立平面直角坐标系，则有<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/98214187f4110ef2123e291d3b9b7a31b5ea50aa" aria-hidden="true" alt="{\displaystyle {\boldsymbol {v_{0}}}=(v,0)}" style="border: 0px; vertical-align: -0.838ex; margin: 0px; display: inline-block; width: 10.727ex; height: 2.843ex;" />，<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bcc9ec6261b2c46ea7c80f8c3a2941d610a94f19" aria-hidden="true" alt="{\displaystyle {\boldsymbol {v1}}=(v\cos \theta ,v\sin \theta )}" style="border: 0px; vertical-align: -0.838ex; margin: 0px; display: inline-block; width: 20.548ex; height: 2.843ex;" />。</p><p style="margin: 0.5em 0px; line-height: inherit;"></p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a4902ff35be2939ad937201628e5cd1c1b89b370" aria-hidden="true" alt="{\displaystyle {\begin{aligned}\Delta {\boldsymbol {v}}&amp;={\boldsymbol {v_{1}}}-{\boldsymbol {v0}}\\&amp;=(v\cos \theta -v,v\sin \theta )\\\end{aligned}}}" style="border: 0px; vertical-align: -2.338ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 25.866ex; height: 5.843ex;" /></div>现在我们假设我们考虑的<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8c28867ecd34e2caed12cf38feadf6a81a7ee542" aria-hidden="true" alt="\Delta t" style="border: 0px; vertical-align: -0.338ex; display: inline-block; width: 2.775ex; height: 2.176ex;" />值很小，那么此时<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af" aria-hidden="true" alt="\theta " style="border: 0px; vertical-align: -0.338ex; display: inline-block; width: 1.09ex; height: 2.176ex;" />也非常小，此时有<div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d3cbff22fd5652432137c88353b59a5d6ed5edd2" aria-hidden="true" alt="{\displaystyle \cos \theta \approx 1}" style="border: 0px; vertical-align: -0.338ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 8.85ex; height: 2.176ex;" /></div>而<div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9a604432d08fc1bd289e40ba08eed0c7ec697ea3" aria-hidden="true" alt="{\displaystyle \sin \theta \approx \theta }" style="border: 0px; vertical-align: -0.338ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 8.522ex; height: 2.176ex;" /></div>请注意，上述公式来自于微分，如果你对微分的内容并不熟悉，请你比较线段GD以及<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af" aria-hidden="true" alt="\theta " style="border: 0px; vertical-align: -0.338ex; display: inline-block; width: 1.09ex; height: 2.176ex;" />所对的弧来感受，你也可以用类似于GeoGebra的开源数学图形计算软件作图直观感受一下。当<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8c28867ecd34e2caed12cf38feadf6a81a7ee542" aria-hidden="true" alt="\Delta t" style="border: 0px; vertical-align: -0.338ex; display: inline-block; width: 2.775ex; height: 2.176ex;" />趋近于0时，我们认为上述&#8220;&#8776;&#8221;是可以被视作&#8220;=&#8221;的。因此有，<p style="margin: 0.5em 0px; line-height: inherit;"></p><p style="margin: 0.5em 0px; line-height: inherit;"></p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d78dad4011b7218c814de97f1d6e163cc7f50e84" aria-hidden="true" alt="{\displaystyle \Delta {\boldsymbol {v}}=(0,v\sin \theta )}" style="border: 0px; vertical-align: -0.838ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 16.206ex; height: 2.843ex;" /></div>我们将上式以及<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2d2e5c788c9332231edccaa1c4126720bac91c1e" aria-hidden="true" alt="{\displaystyle \theta ={\frac {v\Delta t}{r}}}" style="border: 0px; vertical-align: -1.838ex; display: inline-block; width: 8.928ex; height: 5.343ex;" />带入计算加速度的公式<div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/df17c0a86b7d943c362c00e97153baca7f1a4b67" aria-hidden="true" alt="{\displaystyle {\begin{aligned}{\boldsymbol {a}}&amp;={\frac {\Delta {\boldsymbol {v}}}{\Delta t}}\\&amp;=(0,{\frac {v^{2}}{r}})\\\end{aligned}}}" style="border: 0px; vertical-align: -4.82ex; display: block; margin-left: auto !important; margin-right: auto !important; margin-bottom: -0.184ex; width: 12.345ex; height: 11.176ex;" /></div><p style="margin: 0.5em 0px; line-height: inherit;"></p><p style="margin: 0.5em 0px; line-height: inherit;">我们从上述结论中看到，物体加速度<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/df0c47bb21acb94ccb65db3da51e075abc68a898" aria-hidden="true" alt="{\displaystyle {\boldsymbol {a}}}" style="border: 0px; vertical-align: -0.338ex; margin: 0px; display: inline-block; width: 1.471ex; height: 1.676ex;" />是一个垂直于物体运动速度且方向指向圆心的矢量，大小关系已由上式给出。由于这个<img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/02d3006c4190b1939b04d9b9bb21006fb4e6fa4a" aria-hidden="true" alt="t_{0}" style="border: 0px; vertical-align: -0.671ex; margin: 0px; display: inline-block; width: 1.894ex; height: 2.343ex;" />时刻是任意取的，因此我们可以得出，任何时刻做匀速圆周运动的物体，加速度始终垂直于速度且指向圆心，我们将这个加速度叫做<strong>向心加速度</strong>。根据牛顿第二定律，物体在任何时刻都受到的合外力为</p><p style="margin: 0.5em 0px; line-height: inherit;"></p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2ec3875c9028057a7d9abfa644cd9dd2190df080" aria-hidden="true" alt="{\displaystyle {\boldsymbol {F}}=m{\frac {{\boldsymbol {v}}|{\boldsymbol {v}}|}{r}}}" style="border: 0px; vertical-align: -1.838ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 11.785ex; height: 5.676ex;" /></div>如果我们只考虑大小标量，则<p style="margin: 0.5em 0px; line-height: inherit;"></p><p style="margin: 0.5em 0px; line-height: inherit;"></p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0cee547ebd54d0caff60118c0bb83c21671ffc06" aria-hidden="true" alt="{\displaystyle F=m{\frac {v^{2}}{r}}}" style="border: 0px; vertical-align: -1.838ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 9.898ex; height: 5.676ex;" /></div>我们将这个合外力称作<strong>向心力</strong>。<p style="margin: 0.5em 0px; line-height: inherit;"></p><p style="margin: 0.5em 0px; line-height: inherit;">到这里，你应该能够感受向心力究竟来自于哪里，例如，绕地球做圆周运动（如果近似地认为是圆周运动的话）的月球，向心力来自于地球对它的引力。和引力有关的内容，我们将在下个章节介绍。</p><h2><span id="线速度和角速度">线速度和角速度</span><span style="user-select: none; font-size: small; margin-left: 1em; vertical-align: baseline; line-height: 1em; white-space: nowrap; unicode-bidi: isolate;"><span style="margin-right: 0.25em; color: #54595d;">[</span><a href="https://zh.wikibooks.org/w/index.php?title=%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8&amp;action=edit&amp;section=3" title="编辑小节：线速度和角速度" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">编辑</a><span style="margin-left: 0.25em; color: #54595d;">]</span></span></h2><p style="margin: 0.5em 0px; line-height: inherit;">在匀速圆周运动中，我们给予速率一个特殊的名称，称为<strong>线速度</strong>，表示物体沿弧线运动的速度大小。</p><p style="margin: 0.5em 0px; line-height: inherit;">我们定义新的矢量角速度</p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1cd7873ba581568f3e158b7a47126288cfed7fe9" aria-hidden="true" alt="{\displaystyle {\boldsymbol {\omega }}={\frac {{\boldsymbol {r}}\times {\boldsymbol {v}}}{{\boldsymbol {r}}^{2}}}}" style="border: 0px; vertical-align: -2.005ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 10.992ex; height: 5.009ex;" /></div>这个矢量和物体做圆周运动的平面是垂直，但是其定义的方式似乎十分晦涩。如果我们只考虑标量，也就是其大小，那么就是<div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/12138afcc600a32b1607606c824d2064900871de" aria-hidden="true" alt="{\displaystyle \omega ={\frac {v}{r}}}" style="border: 0px; vertical-align: -1.838ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 6.508ex; height: 4.676ex;" /></div>这个矢量就意义就一目了然了。首先，它的大小是物体运动的速度除以做圆周运动的轨迹圆的半径，如果我们在公式两边同时乘以时间，那么左右两边都可以代表这段时间内物体经过的弧所对的圆心角大小。简言之&#8212;&#8212;这个矢量通过描述物体单位时间内所扫过的角度来描述了物体做圆周运动的快慢。角速度的单位有很多种，只要合适的单位都可以被使用，经常使用的单位有弧度每秒（rad/s），对于那些角速度非常大的匀速圆周运动，我们习惯上使用转每分（rpm）、转每秒（rps）等单位，它们代表物体每分（或每秒）做匀速圆周运动的周数。如果你对数字设备硬件有一定的了解，你可能已经注意到，机械硬盘的性能指标之一的转速单位就是转每分。<p style="margin: 0.5em 0px; line-height: inherit;"></p><h2><span id="伪矢量">伪矢量</span><span style="user-select: none; font-size: small; margin-left: 1em; vertical-align: baseline; line-height: 1em; white-space: nowrap; unicode-bidi: isolate;"><span style="margin-right: 0.25em; color: #54595d;">[</span><a href="https://zh.wikibooks.org/w/index.php?title=%E8%87%AA%E7%84%B6%E7%A7%91%E5%AD%A6/%E5%8C%80%E9%80%9F%E5%9C%86%E5%91%A8%E8%BF%90%E5%8A%A8&amp;action=edit&amp;section=4" title="编辑小节：伪矢量" style="text-decoration-line: none; color: #0b0080; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">编辑</a><span style="margin-left: 0.25em; color: #54595d;">]</span></span></h2><p style="margin: 0.5em 0px; line-height: inherit;">为什么线速度的方向不具备意义，我们仍然要将它视作矢量？这是因为，线速度被视为矢量后，我们才能完善一系列相关的计算。例如，计算向心力的公式，可以重新写为</p><p style="margin: 0.5em 0px; line-height: inherit;"></p><div style="overflow-x: auto; max-width: 100%;"><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8239065bbf6c7491f2e3e33f1fdb5617ed311e09" aria-hidden="true" alt="{\displaystyle {\boldsymbol {F}}=m{\boldsymbol {\omega }}\times {\boldsymbol {v}}}" style="border: 0px; vertical-align: -0.338ex; display: block; margin-left: auto !important; margin-right: auto !important; width: 12.846ex; height: 2.176ex;" /></div>如果将上述公式中的角速度用标量代替，计算出的向心力方向即是错误的。实际上，定义这样的矢量，是为了完善我们的矢量的计算系统。<p style="margin: 0.5em 0px; line-height: inherit;"></p><p style="margin: 0.5em 0px; line-height: inherit;">我们将物理量中，以矢量叉积（&#215;）定义的矢量，称之为伪矢量。</p></div></div></div></div><img src ="http://www.cppblog.com/zmj/aggbug/215695.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-05-30 17:24 <a href="http://www.cppblog.com/zmj/archive/2018/05/30/215695.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Bernoulli Equation(Curve of a Baseball)</title><link>http://www.cppblog.com/zmj/archive/2018/03/05/215545.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 05 Mar 2018 08:39:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/03/05/215545.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215545.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/03/05/215545.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215545.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215545.html</trackback:ping><description><![CDATA[<div>http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html<br /><br /><table width="680" height="370" border="1" cellspacing="2" cellpadding="2" style="font-family: &quot;Microsoft YaHei&quot;;"><tbody><tr><td width="614" height="309"><h1>Bernoulli Equation</h1><p>The Bernoulli Equation can be considered to be a statement of the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/conser.html#engfun">conservation of energy</a>&nbsp;principle appropriate for flowing fluids. The qualitative behavior that is usually labeled with the term "Bernoulli effect" is the lowering of fluid pressure in regions where the flow velocity is increased. This lowering of pressure in a constriction of a flow path may seem counterintuitive, but seems less so when you consider pressure to be&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/press.html#ed">energy density</a>. In the high velocity flow through the constriction, kinetic energy must increase at the expense of pressure energy.</p><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/imgmec/bernoul.gif"  alt="" /><p><strong>Steady-state flow caveat</strong>: While the Bernoulli equation is stated in terms of universally valid ideas like conservation of energy and the ideas of pressure, kinetic energy and potential energy, its application in the above form is limited to cases of steady flow. For flow through a tube, such flow can be visualized as&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric.html#lam">laminar flow</a>, which is still an idealization, but if the flow is to a good approximation laminar, then the kinetic energy of flow at any point of the fluid can be modeled and calculated. The kinetic energy per unit volume term in the equation is the one which requires strict constraints for the Bernoulli equation to apply - it basically is the assumption that all the kinetic energy of the fluid is contributing directly to the forward flow process of the fluid. That should make it evident that the existence of turbulence or any chaotic fluid motion would involve some kinetic energy which is not contributing to the advancement of the fluid through the tube.</p><p>It should also be said that while conservation of energy always applies, this form of parsing out that energy certainly does not describe how that energy is distributed under transient conditions. A good visualization of the Bernoulli effect is the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber2.html#pl">flow through a constriction</a>, but that neat picture does not describe the fluid when you first turn on the flow.</p><p>Another approximation involved in the statement of the Bernoulli equation above is the neglect of losses from&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/airfri.html#c4">fluid friction</a>. Idealized laminar flow through a pipe can be modeled by&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/ppois.html#poi">Poiseuille's law</a>, which does include viscous losses resulting in a lowering of the pressure as you progress along the pipe. The statement of the Bernoulli equation above would lead to the expectation that the pressure would return to the value P<sub>1</sub>&nbsp;past the constriction since the radius returns to its original value. This is not the case because of the loss of some energy from the active flow process by friction into disordered molecular motion (<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/eqpar.html#c2">thermal energy</a>). More accurate modeling can be done by combining the Bernoulli equation with Poiseuille's law. A real example which might help visualize the process is the pressure monitoring of the flow through a&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber2.html#c4">constricted tube</a>.</p><center><h3><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#bcal">Bernoulli calculation</a></h3></center></td><td width="66" align="center"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html">Index</a><br /><br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/bercon.html">Bernoulli concepts</a></td></tr><tr><td height="17">&nbsp;<table><tbody><tr><td width="450"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html">HyperPhysics</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html#mechcon">&nbsp;Mechanics&nbsp;</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluid.html#flucon">&nbsp;Fluids</a></td><td align="right"><em>R Nave</em></td></tr></tbody></table></td><td><a>Go Back</a></td></tr></tbody></table><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><a name="bcal" style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;"></a><table width="680" height="370" border="1" cellspacing="2" cellpadding="2" style="font-family: &quot;Microsoft YaHei&quot;;"><tbody><tr><td width="614" height="309"><h1>Bernoulli Calculation</h1>The calculation of the "real world" pressure in a constriction of a tube is difficult to do because of viscous losses, turbulence, and the assumptions which must be made about the velocity profile (which affect the calculated kinetic energy). The model calculation here assumes&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric.html#lam">laminar flow</a>&nbsp;(no&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pturb.html#turb">turbulence</a>), assumes that the distance from the larger diameter to the smaller is short enough that&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric.html#tube">viscous losses</a>&nbsp;can be neglected, and assumes that the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric.html#vel">velocity profile</a>&nbsp;follows that of theoretical laminar flow. Specifically, this involves assuming that the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric.html#veff">effective flow velocity</a>&nbsp;is one half of the maximum velocity, and that the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pfric2.html#fke">average kinetic energy density</a>&nbsp;is given by one third of the maximum kinetic energy density.<center><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/imgflu/berc.gif"  alt="" /></center><form name="form1" method="" action="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html">Now if you can swallow all those assumptions, you can model* the flow in a tube where the volume flowrate is&nbsp;<img src="http://hyperphysics.phy-astr.gsu.edu/hbase/imgmec/sf.gif"  alt="" />=&nbsp;<input type="text" name="f" value="" size="6" />cm<sup>3</sup>/s and the fluid density is &#961; =&nbsp;<input type="text" name="d" value="" size="6" />gm/cm<sup>3</sup>. For an inlet tube area A<sub>1</sub>=&nbsp;<input type="text" name="a1" value="" size="6" />cm<sup>2</sup>&nbsp;(radius r<sub>1</sub>&nbsp;=<input type="text" name="r1" value="" size="6" />cm), the geometry of flow leads to an effective fluid velocity of v<sub>1</sub>&nbsp;=<input type="text" name="v1" value="" size="6" />cm/s. Since the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#beq">Bernoulli equation</a>&nbsp;includes the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/press.html#fpe">fluid potential energy</a>&nbsp;as well, the height of the inlet tube is specified as h<sub>1</sub>&nbsp;=&nbsp;<input type="text" name="h1" value="" size="6" />cm. If the area of the tube is constricted to A<sub>2</sub>=<input type="text" name="a2" value="" size="6" />cm<sup>2</sup>&nbsp;(radius r<sub>2</sub>&nbsp;=<input type="text" name="r2" value="" size="6" />cm), then without any further assumptions the effective fluid velocity in the constriction must be v<sub>2</sub>&nbsp;=&nbsp;<input type="text" name="v2" value="" size="6" />&nbsp;cm/s. The height of the constricted tube is specified as h<sub>2</sub>&nbsp;=&nbsp;<input type="text" name="h2" value="" size="6" />&nbsp;cm.&nbsp;<br /><br />The kinetic energy densities at the two locations in the tube can now be calculated, and the Bernoulli equation applied to constrain the process to conserve energy, thus giving a value for the pressure in the constriction. First, specify a pressure in the inlet tube:<br />Inlet pressure = P<sub>1</sub>&nbsp;=&nbsp;<input type="text" name="p1" value="" size="6" />&nbsp;kPa =&nbsp;<input type="text" name="pc" value="" size="6" />lb/in<sup>2</sup>&nbsp;=&nbsp;<input type="text" name="pm" value="" size="6" />&nbsp;mmHg =&nbsp;<input type="text" name="pa" value="" size="6" />&nbsp;atmos.&nbsp;<br />The energy densities can now be calculated. The energy unit for the CGS units used is the erg.<br /><center><table border="1" cellspacing="2" cellpadding="2"><tbody><tr><td><table><tbody><tr><td colspan="2">Inlet tube energy densities</td></tr><tr><td>Kinetic energy density</td><td>=&nbsp;<input type="text" name="k1" value="" size="6" />erg/cm<sup>3</sup></td></tr><tr><td>Potential energy density</td><td>=&nbsp;<input type="text" name="pe1" value="" size="6" />erg/cm<sup>3</sup></td></tr><tr><td>Pressure energy density</td><td>=&nbsp;<input type="text" name="pr1" value="" size="9" />erg/cm<sup>3</sup></td></tr></tbody></table></td><td><table><tbody><tr><td colspan="2">Constricted tube energy densities</td></tr><tr><td>Kinetic energy density</td><td>=&nbsp;<input type="text" name="k2" value="" size="6" />erg/cm<sup>3</sup></td></tr><tr><td>Potential energy density</td><td>=&nbsp;<input type="text" name="pe2" value="" size="6" />erg/cm<sup>3</sup></td></tr><tr><td>Pressure energy density</td><td>=&nbsp;<input type="text" name="pr2" value="" size="9" />erg/cm<sup>3</sup></td></tr></tbody></table></td></tr></tbody></table></center>The pressure energy density in the constricted tube can now be finally converted into more conventional pressure units to see the effect of the constricted flow on the fluid pressure:<br /><br />Calculated pressure in constriction =<br />P<sub>2</sub>=&nbsp;<input type="text" name="p2" value="" size="6" />kPa =&nbsp;<input type="text" name="pc2" value="" size="6" />lb/in<sup>2</sup>&nbsp;=&nbsp;<input type="text" name="pm2" value="" size="6" />&nbsp;mmHg =&nbsp;<input type="text" name="pa2" value="" size="6" />&nbsp;atmos.&nbsp;<br /><br />This calculation can give some perspective on the energy involved in fluid flow, but it's accuracy is always suspect because of the assumption of laminar flow. For typical inlet conditions, the energy density associated with the pressure will be dominant on the input side; after all, we live at the bottom of an atmospheric sea which contributes a large amount of pressure energy. If a drastic enough reduction in radius is used to yield a pressure in the constriction which is less than&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pman.html#atm">atmospheric pressure</a>, there is almost certainly some turbulence involved in the flow into that constriction. Nevertheless, the calculation can show why we can get a significant amount of suction (pressure less than atmospheric) with an "aspirator" on a high pressure faucet. These devices consist of a metal tube of reducing radius with a side tube into the region of constricted radius for suction.&nbsp;<br /><br />*Note: Some default values will be entered for some of the values as you start exploring the calculation. All of them can be changed as a part of your calculation.</form></td><td width="66" align="center"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html">Index</a><br /><br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/bercon.html">Bernoulli concepts</a></td></tr><tr><td height="17">&nbsp;<table><tbody><tr><td width="450"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html">HyperPhysics</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html#mechcon">&nbsp;Mechanics&nbsp;</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluid.html#flucon">&nbsp;Fluids</a></td><td align="right"><em>R Nave</em></td></tr></tbody></table></td><td><a>Go Back</a></td></tr></tbody></table><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><a name="base" style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;"></a><table width="680" height="370" border="1" cellspacing="2" cellpadding="2" style="font-family: &quot;Microsoft YaHei&quot;;"><tbody><tr><td width="614" height="309"><h1>Curve of a Baseball</h1><p>A non-spinning baseball or a stationary baseball in an airstream exhibits symmetric flow. A baseball which is thrown with spin will curve because one side of the ball will experience a reduced pressure. This is commonly interpreted as an application of the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#c1">Bernoulli principle</a>&nbsp;and involves the viscosity of the air and the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/angatt.html#c2">boundary layer</a>&nbsp;of air at the surface of the ball.</p><table><tbody><tr><td><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/imgmec/curveball.gif"  alt="" /></td><td><p>The roughness of the ball's surface and the laces on the ball are important! With a perfectly smooth ball you would not get enough interaction with the air.</p></td></tr></tbody></table><p>There are some difficulties with this picture of the curving baseball. The Bernoulli equation cannot really be used to predict the amount of curve of the ball; the flow of the air is compressible, and you can't track the density changes to quantify the change in effective pressure. The experimental work of Watts and Ferrer with baseballs in a wind tunnel suggests another model which gives prominent attention to the spinning boundary layer of air around the baseball. On the side of the ball where the boundary layer is moving in the same direction as the free stream air speed, the boundary layer carries further around the ball before it separates into turbulent flow. On the side where the boundary layer is opposed by the free stream flow, it tends to separate prematurely. This gives a net deflection of the airstream in one direction behind the ball, and therefore a&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/newt.html#nt3">Newton's 3rd law</a>&nbsp;reaction force on the ball in the opposite direction. This gives an effective force in the same direction indicated above.</p><p>Similar issues arise in the treatment of a spinning cylinder in an airstream, which has been shown to experience lift. This is the subject of the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/kutta.html#c1">Kutta-Joukowski theorem</a>. It is also invoked in the discussion of airfoil lift.</p></td><td width="66" align="center"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html">Index</a><br /><br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#beq">Bernoulli Equation</a><br /><br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/bercon.html">Bernoulli concepts</a><br /><br />Reference<br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/mecref.html#c1">Watts and Ferrer</a></td></tr><tr><td height="17">&nbsp;<table><tbody><tr><td width="450"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html">HyperPhysics</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html#mechcon">&nbsp;Mechanics&nbsp;</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluid.html#flucon">&nbsp;Fluids</a></td><td align="right"><em>R Nave</em></td></tr></tbody></table></td><td><a>Go Back</a></td></tr></tbody></table><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><br style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;" /><a name="airf" style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium;"></a><table width="680" height="370" border="1" cellspacing="2" cellpadding="2" style="font-family: &quot;Microsoft YaHei&quot;;"><tbody><tr><td width="614" height="309"><h1>Airfoil</h1><p>The air across the top of a conventional airfoil experiences constricted flow lines and increased air speed relative to the wing. This causes a decrease in pressure on the top according to the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#beq">Bernoulli equation</a>&nbsp;and provides a lift force. Aerodynamicists (see Eastlake) use the Bernoulli model to correlate with pressure measurements made in wind tunnels, and assert that when pressure measurements are made at multiple locations around the airfoil and summed, they do agree reasonably with the observed lift.</p><table cellpadding="5"><tbody><tr><td><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/imgmec/airfoil.gif"  alt="" /><br /><br /><center><table border="1" cellspacing="2" cellpadding="2"><tbody><tr><td><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/angatt.html#c1">Illustration of lift force<br />and angle of attack</a></td></tr></tbody></table></center><center><table border="1" cellspacing="2" cellpadding="2"><tbody><tr><td><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/airfoil.html#c1">Bernoulli vs Newton<br />for airfoil lift</a></td></tr></tbody></table></center><center><table border="1" cellspacing="2" cellpadding="2"><tbody><tr><td><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/airfoil.html#c3">Airfoil terminology</a></td></tr></tbody></table></center></td><td><p>Others appeal to a model based on Newton's laws and assert that the main lift comes as a result of the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/angatt.html#c1">angle of attack</a>. Part of the Newton's law model of part of the lift force involves attachment of the&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/angatt.html#c2">boundary layer</a>&nbsp;of air on the top of the wing with a resulting&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/downwash.html#c1">downwash of air</a>&nbsp;behind the wing. If the wing gives the air a downward force, then by Newton's third law, the wing experiences a force in the opposite direction - a lift. While the "Bernoulli vs Newton" debate continues, Eastlake's position is that they are really equivalent, just different approaches to the same physical phenonenon. NASA has a nice aerodynamics site at which these issues are discussed.</p><p>Increasing the angle of attack gives a larger lift from the upward component of pressure on the bottom of the wing. The lift force can be considered to be a&nbsp;<a href="http://hyperphysics.phy-astr.gsu.edu/newt.html#nt3">Newton's 3rd law</a>&nbsp;reaction force to the force exerted downward on the air by the wing.</p><p>At too high an angle of attack, turbulent flow increases the drag dramatically and will stall the aircraft.</p></td></tr></tbody></table><center><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/flupic/airflow.jpg"  alt="" /></center><p>A vapor trail over the wing helps visualize the air flow. Photo by Frank Starmer, used by permission.</p></td><td width="66" align="center"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html">Index</a><br /><br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/pber.html#beq">Bernoulli Equation</a><br /><br />References<br /><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/mecref.html">Eastlake</a><br /><br /><a href="http://www.grc.nasa.gov/www/K-12/airplane/bernnew.html"><img src="http://hyperphysics.phy-astr.gsu.edu/hbase/fluids/imgflu/exlnk.gif"  alt="" /></a><br /><a href="http://www.grc.nasa.gov/www/K-12/airplane/bernnew.html">NASA&nbsp;<br />Aerodynamics</a></td></tr><tr><td height="17">&nbsp;<table><tbody><tr><td width="450"><a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html">HyperPhysics</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/hph.html#mechcon">&nbsp;Mechanics&nbsp;</a>*****<a href="http://hyperphysics.phy-astr.gsu.edu/hbase/fluid.html#flucon">&nbsp;Fluids</a></td><td align="right"><em>R Nave</em></td></tr></tbody></table></td><td><a>Go Back</a></td></tr></tbody></table></div><img src ="http://www.cppblog.com/zmj/aggbug/215545.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-03-05 16:39 <a href="http://www.cppblog.com/zmj/archive/2018/03/05/215545.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>What is Bernoulli's equation?</title><link>http://www.cppblog.com/zmj/archive/2018/03/05/215544.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 05 Mar 2018 08:37:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/03/05/215544.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215544.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/03/05/215544.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215544.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215544.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://www.khanacademy.org/science/physics/fluids/fluid-dynamics/a/what-is-bernoullis-equationThis equation will give you the powers to analyze a fluid flowing up and down through all kinds of differ...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2018/03/05/215544.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-03-05 16:37 <a href="http://www.cppblog.com/zmj/archive/2018/03/05/215544.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>放大鏡的原理</title><link>http://www.cppblog.com/zmj/archive/2018/02/28/215539.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 28 Feb 2018 09:23:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/02/28/215539.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215539.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/02/28/215539.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215539.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215539.html</trackback:ping><description><![CDATA[<div>http://www.phy.ntnu.edu.tw/demolab/phpBB/viewtopic.php?topic=15841<br /><span style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium; text-align: -webkit-right; background-color: #c8dfd0;">http://</span><strong style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium; text-align: -webkit-right; background-color: #c8dfd0;">enjoy</strong><span style="font-family: &quot;Microsoft YaHei&quot;; font-size: medium; text-align: -webkit-right; background-color: #c8dfd0;">.phy.ntnu.edu.tw/demolab/phpBB/</span><br /><br /><table cellpadding="3" cellspacing="1" width="100%" border="1" style="color: #000000; font-family: &quot;Microsoft YaHei&quot;;"><tbody><tr style="background: #abc6ea;"><td>光學 標題:<strong>放大鏡的原理</strong></td></tr><tr style="background: #b8cfc0;"><td valign="top"><a name="p72606"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>1</strong>:黃福坤&nbsp;(研究所)張貼:2006-10-22 12:39:58:<br /></a></td></tr><tr style="background: #b8cfc0;"><td><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/pics/2_29_magnifyingLensA.png" style="border: 0px;"  alt="" />&nbsp;<br />上圖顯示眼睛直接觀看蜜蜂時在視網膜上呈現的大小,圖中 dn通常是明視距離也就是正常狀況為25cm. 視角= y0/dn&nbsp;<br />下圖則顯示使用放大鏡後的效果,視角=yi/L<br /><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/pics/2_29_magnifyingLensB.png" style="border: 0px;"  alt="" />&nbsp;<br />比較兩圖可以知道 眼睛看物體的視角變大了！<br />兩者視角的放大比率就是 放大鏡的放大率（注意和一般透鏡放大率的定義M=-si/so=yi/yo不同）&nbsp;<br />放大鏡的放大率=(yi/L)/(yo/dn)=-si*dn/(so*L)<br /><br />使用放大鏡時 物體通常非常接近焦距（si-&gt;L, so-&gt;f)&nbsp;<br />所以放大鏡的（角）放大倍率= dn/f 只和透鏡的焦距有關！&nbsp;<br /></td></tr><tr style="background: #abc6ea;"><td valign="top"><a name="p72610"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>2</strong>:黃福坤(研究所)張貼:2006-10-22 13:02:58: [回應上一篇]&nbsp;<br /></a></td></tr><tr style="background: #abc6ea;"><td><br />一旦你清楚瞭解了放大鏡的工作原理 之後要理解 望遠鏡或顯微鏡就很簡單了<br /><br />放大鏡藉由將物體放在焦距內一點點 產生虛像的視角放大 讓眼睛看到更大的影像於視網膜上<br /><br />若是有物體位於很遠的地方 我們知道 加上透鏡後物體會呈現於透鏡的焦點附近！<br />但是影像會很小 因此可以利用放大鏡的效果將其放大<br />若是我們在物體成像位置後放置另一個透鏡 且透鏡焦距就是該像與透鏡的距離（稍大一點）<br />於是 很遠處的物體所形成的像 被第二個透鏡以視角放大的方式讓我們看到 就是 望遠鏡了！<br /><br />如下圖<br /><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/pics/2_telescope.png" style="border: 0px;"  alt="" />&nbsp;<br /><br /><br />而顯微鏡則是將物體放置於透鏡焦距到兩倍焦距之間,然後將所形成的像&nbsp;<br />再度透過第二個透鏡以放大鏡的方式放大 如下圖&nbsp;<br /><br /><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/pics/2_microscope.png" style="border: 0px;"  alt="" />&nbsp;<br /><br /></td></tr><tr style="background: #b8cfc0;"><td valign="top"><a name="p75442"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>3</strong>:吳旻峰</a><a title="榮譽點數：1133" target="viewhonor">榮譽點數5點</a><a title="榮譽點數：1133" target="viewhonor">&nbsp;(高中職)張貼:2006-12-31 12:41:28: [回應上一篇]&nbsp;<br /></a></td></tr><tr style="background: #b8cfc0;"><td>原來望遠鏡是兩個放大鏡，之前還認為是一個凸、ㄧ凹，幸好及時發現。<img height="15" src="http://www.phy.ntnu.edu.tw/pix/smiles/2.gif" width="15" align="absMiddle" border="0" style="border: 0px;"  alt="" /><br /></td></tr><tr style="background: #abc6ea;"><td valign="top"><a name="p75460"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>4</strong>:李偉</a><a title="榮譽點數：933" target="viewhonor">榮譽點數3點</a><a title="榮譽點數：933" target="viewhonor">(大學理工科系)張貼:2006-12-31 15:24:22: [回應上一篇]&nbsp;<br /></a></td></tr><tr style="background: #abc6ea;"><td><p>&nbsp;</p><table border="0" align="CENTER" width="85%"><tbody><tr><td>Quote:<hr /></td></tr><tr><td><blockquote>在 2006-12-31 12:41:28, 吳旻峰 寫了: 原來望遠鏡是兩個放大鏡，之前還認為是一個凸、ㄧ凹，幸好及時發現。<img height="15" src="http://www.phy.ntnu.edu.tw/pix/smiles/2.gif" width="15" align="absMiddle" border="0" style="border: 0px;"  alt="" /></blockquote></td></tr><tr><td><hr /></td></tr></tbody></table><p>&nbsp;</p><p>也有用一凸一凹做成的望遠鏡，例如從前在劇場使用的小型觀劇鏡。</p><br /></td></tr><tr style="background: #b8cfc0;"><td valign="top"><a name="p75463"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>5</strong>:吳旻峰</a><a title="榮譽點數：1133" target="viewhonor">榮譽點數5點</a><a title="榮譽點數：1133" target="viewhonor">&nbsp;(高中職)張貼:2006-12-31 15:32:38: [回應上一篇]&nbsp;<br /></a></td></tr><tr style="background: #b8cfc0;"><td>謝謝李偉老師及時的告知，原來原理就是用一個放大鏡來觀看凸透鏡或者凹面鏡所呈現的遠方物體影像，差一點變成另一種錯誤。<br /></td></tr><tr style="background: #abc6ea;"><td valign="top"><a name="p126090"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>6</strong>:Adi&nbsp;(國中)張貼:2012-11-06 00:13:59: [回應</a><a href="http://www.phy.ntnu.edu.tw/demolab/phpBB/viewtopic.php?topic=15841#p75460">第4篇</a>]&nbsp;<br /></td></tr><tr style="background: #abc6ea;"><td>請問一凸一凹的望遠鏡如何劃成像圖<br /></td></tr><tr style="background: #b8cfc0;"><td valign="top"><a name="p126093"><img src="http://www.phy.ntnu.edu.tw/demolab/phpBB/img/eye.gif" style="border: 0px;"  alt="" />&nbsp;<strong>7</strong>:黃福坤(研究所)張貼:2012-11-06 19:45:40: [回應上一篇]&nbsp;<br /></a></td></tr><tr style="background: #b8cfc0;"><td>一般的望遠鏡是用兩個凸透鏡組成<br />歡迎參考&nbsp;<a href="http://www.phy.ntnu.edu.tw/demolab/phpBB/viewtopic.php?topic=8353"><strong>凸透鏡成像與組合透鏡 (顯微鏡/望遠鏡)</strong></a>&nbsp;<br /></td></tr></tbody></table></div><img src ="http://www.cppblog.com/zmj/aggbug/215539.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-02-28 17:23 <a href="http://www.cppblog.com/zmj/archive/2018/02/28/215539.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IDE Debug Helpers</title><link>http://www.cppblog.com/zmj/archive/2018/02/12/215516.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 12 Feb 2018 05:25:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/02/12/215516.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215516.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/02/12/215516.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215516.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215516.html</trackback:ping><description><![CDATA[<div>https://wiki.qt.io/IDE_Debug_Helpers<br /><br /><div><h2><span id="Qt_Creator" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: #000000; border-bottom-style: none; border-bottom-width: 0px; color: #000000; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 24px; font-weight: 400; line-height: 30px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Qt Creator</span></h2><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Qt Creator directly supports introspection of all Qt Containers and QObject derived classes for Qt 4 and Qt 5. User defined types can be supported in addition, see <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none;" href="http://doc.qt.io/qtcreator/creator-debugging-helpers.html" rel="nofollow"  text"="">the Qt Creator documentation</a> for details. </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><h2><span id="LLDB" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: #000000; border-bottom-style: none; border-bottom-width: 0px; color: #000000; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 24px; font-weight: 400; line-height: 30px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">LLDB</span></h2><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">There is an effort to introspect Qt types using LLDB at <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none; word-wrap: break-word;" href="https://bitbucket.org/lukeworth/lldb-qt-formatters" rel="nofollow"  free"="">https://bitbucket.org/lukeworth/lldb-qt-formatters</a>. </p><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">KDevelop ships formatter scripts in its LLDB plugin for Qt types that can be used directly in plain LLDB. <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none; word-wrap: break-word;" href="https://unlimitedcodeworks.xyz/blog/2016/08/20/gsoc-kdevelop-lldb-final-report/#using-data-formatter-scripts-outside-kdevelop" rel="nofollow"  free"="">https://unlimitedcodeworks.xyz/blog/2016/08/20/gsoc-kdevelop-lldb-final-report/#using-data-formatter-scripts-outside-kdevelop</a> </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><h2><span id="MS_visual_studio_QString_.26_QByteArray_expansions" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: #000000; border-bottom-style: none; border-bottom-width: 0px; color: #000000; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 24px; font-weight: 400; line-height: 30px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MS visual studio QString &amp; QByteArray expansions</span></h2><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">The new layout of QString in Qt 5 is hard to inspect using the debugger. The following code can be added to autoexp.dat (c:\program files(x86)\visual studio 9.0\common7\packages\debugger\autoexp.dat) You should add it to the [Visualizer] section, before the STL/ATL containers. </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><pre style="background-color: #f9f9f9; border-bottom-color: #dddddd; border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: #dddddd; border-left-style: solid; border-left-width: 1px; border-right-color: #dddddd; border-right-style: solid; border-right-width: 1px; border-top-color: #dddddd; border-top-style: solid; border-top-width: 1px; color: #000000; font-family: monospace,Courier; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 20.8px; orphans: 2; padding-bottom: 16px; padding-left: 16px; padding-right: 16px; padding-top: 16px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;">; Qt types QStringData{  preview ([(unsigned short*)$e.d + $e.offset,su])  stringview ([(unsigned short*)$e.d + $e.offset,sub]) } QString{  preview ([$e.d]) } QByteArrayData{  preview ([(unsigned char*)$e.d + $e.offset,s])  stringview ([(unsigned char*)$e.d + $e.offset,sb]) } QByteArray{  preview ([$e.d]) } </pre><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">If all else fails you can always just add a watcher for </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><pre style="background-color: #f9f9f9; border-bottom-color: #dddddd; border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: #dddddd; border-left-style: solid; border-left-width: 1px; border-right-color: #dddddd; border-right-style: solid; border-right-width: 1px; border-top-color: #dddddd; border-top-style: solid; border-top-width: 1px; color: #000000; font-family: monospace,Courier; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 20.8px; orphans: 2; padding-bottom: 16px; padding-left: 16px; padding-right: 16px; padding-top: 16px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;">  (char*)str.d + str.d-&gt;offset,su </pre><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">in the debugger, to see the contents of str. </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><h2><span id="MS_Visual_Studio_2012" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: #000000; border-bottom-style: none; border-bottom-width: 0px; color: #000000; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 24px; font-weight: 400; line-height: 30px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MS Visual Studio 2012</span></h2><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">There is a new way to visualize native type, see <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none; word-wrap: break-word;" href="http://code.msdn.microsoft.com/Writing-type-visualizers-2eae77a2" rel="nofollow"  free"="">http://code.msdn.microsoft.com/Writing-type-visualizers-2eae77a2</a> for details. </p><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Ready-made .natvis files are included in the <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none;" href="http://wiki.qt.io/QtVSAddin" rel="nofollow"  text"="">Visual Studio add-in</a>. </p><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">So we can visualize QString and some other types using <a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none;" href="http://code.qt.io/cgit/qt-labs/vstools.git/plain/tools/Qt4EEAddin/qt5.natvis" rel="nofollow"  text"="">qt5.natvis</a> file (save to file:&nbsp;%USERPROFILE%\Documents\Visual Studio 2012\Visualizers\qt5.natvis) </p><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><pre style="background-color: #f9f9f9; border-bottom-color: #dddddd; border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: #dddddd; border-left-style: solid; border-left-width: 1px; border-right-color: #dddddd; border-right-style: solid; border-right-width: 1px; border-top-color: #dddddd; border-top-style: solid; border-top-width: 1px; color: #000000; font-family: monospace,Courier; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 20.8px; orphans: 2; padding-bottom: 16px; padding-left: 16px; padding-right: 16px; padding-top: 16px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;AutoVisualizer &gt;  &lt;Type Name="QString"&gt;  &lt;DisplayString&gt;{(char*)d + d-&gt;offset,su}&lt;/DisplayString&gt;  &lt;/Type&gt;  &lt;Type Name="QtPrivate::RefCount"&gt;  &lt;DisplayString&gt;{atomic}&lt;/DisplayString&gt;  &lt;/Type&gt;  &lt;Type Name="QBasicAtomicInteger&lt;int&gt;"&gt;  &lt;DisplayString&gt;{_q_value}&lt;/DisplayString&gt;  &lt;/Type&gt;  &lt;Type Name="QTypedArrayData&lt;'''&gt;"&gt;  &lt;DisplayString&gt;{{Count = {size}}}&lt;/DisplayString&gt;  &lt;Expand&gt;  &lt;Item Name="[size]"&gt;size&lt;/Item&gt;  &lt;ArrayItems&gt;  &lt;Size&gt;size&lt;/Size&gt;  &lt;ValuePointer&gt;(iterator) ((char''')this + offset)&lt;/ValuePointer&gt;  &lt;/ArrayItems&gt;  &lt;/Expand&gt;  &lt;/Type&gt;  &lt;Type Name="QByteArray"&gt;  &lt;DisplayString&gt;{*d}&lt;/DisplayString&gt;  &lt;/Type&gt;  &lt;!&#8212; More Qt5 types&#8230; &#8212;&gt;  &lt;/AutoVisualizer&gt; </pre><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><h2><span id="MS_Visual_Studio_2013" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: #000000; border-bottom-style: none; border-bottom-width: 0px; color: #000000; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 24px; font-weight: 400; line-height: 30px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MS Visual Studio 2013</span></h2><span style='display: inline !important; float: none; background-color: transparent; color: #09102b; direction: ltr; font-family: "Titillium Web",sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;'> </span><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">The ".natvis" files introduced in MSVS2012 received some additional attention in MSVS2013: </p><p style="background-color: transparent; color: #09102b; font-family: &amp;quot;Titillium Web&amp;quot;,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 26px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><a style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: linear-gradient(transparent, transparent), url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%20d%3D%22M1.5%204.518h5.982V10.5H1.5z%22%2F%3E%3Cpath%20d%3D%22M5.765%201H11v5.39L9.427%207.937l-1.31-1.31L5.393%209.35l-2.69-2.688%202.81-2.808L4.2%202.544z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M9.995%202.004l.022%204.885L8.2%205.07%205.32%207.95%204.09%206.723l2.882-2.88-1.85-1.852z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E); background-origin: padding-box; background-position-x: right; background-position-y: center; background-repeat: no-repeat; background-size: auto; color: #3366bb; padding-right: 13px; text-decoration: none; word-wrap: break-word;" href="http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx" rel="nofollow"  free"="">http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx</a> </p></div></div><strong></strong><em></em><u></u><sub></sub><sup></sup><strike></strike><strong></strong><em></em><u></u><sub></sub><sup></sup><strike></strike><strong></strong><em></em><u></u><sub></sub><sup></sup><strike></strike><img src ="http://www.cppblog.com/zmj/aggbug/215516.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-02-12 13:25 <a href="http://www.cppblog.com/zmj/archive/2018/02/12/215516.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenGL学习脚印: 投影矩阵和视口变换矩阵(math-projection and viewport matrix)</title><link>http://www.cppblog.com/zmj/archive/2018/01/08/215464.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 08 Jan 2018 06:13:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/01/08/215464.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215464.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/01/08/215464.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215464.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215464.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: http://blog.csdn.net/wangdingqiaoit/article/details/51589825写在前面&nbsp;前面几节分别介绍了模型变换，视变换，本节继续学习OpenGL坐标变换过程中的投影变换。这里主要是从数学角度推导投影矩阵。对数学不感兴趣的，可以稍微了解下，或者跳过本节内容。本文主要翻译并整理自 songho&nbsp;OpenGL Projection Mat...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2018/01/08/215464.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215464.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-01-08 14:13 <a href="http://www.cppblog.com/zmj/archive/2018/01/08/215464.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>投影与相机空间</title><link>http://www.cppblog.com/zmj/archive/2018/01/08/215463.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 08 Jan 2018 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2018/01/08/215463.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215463.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2018/01/08/215463.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215463.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215463.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: http://sighingnow.github.io/graphics/projection_and_camera.html投影与相机空间&nbsp;Published On August 14, 2015计算机屏幕是2维的，OpenGL渲染的3D场景必须以2D形式的图像投影到屏幕上。透视投影透视投影能较好的使二维投影显示立体感，因为人眼观看物体符合透视原理。首先，将所有顶点从眼坐标(照相机坐标...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2018/01/08/215463.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215463.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2018-01-08 11:31 <a href="http://www.cppblog.com/zmj/archive/2018/01/08/215463.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenCV Remapping</title><link>http://www.cppblog.com/zmj/archive/2017/12/20/215434.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 20 Dec 2017 09:44:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/12/20/215434.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215434.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/12/20/215434.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215434.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215434.html</trackback:ping><description><![CDATA[<div style="background-color: #ffffff; padding-right: 20px; padding-bottom: 30px; padding-left: 20px; font-family: sans-serif; font-size: 16px;"><div id="remapping"><div id="goal"><h2><div><span style="font-weight: normal; font-size: 12pt;">https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html<br /><br /></span></div>Goal<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#goal" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h2><p style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">In this tutorial you will learn how to:</p><ol simple"="" style="list-style: lower-alpha;"><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">Use the OpenCV function&nbsp;<a external"="" href="http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html?highlight=remap#remap" style="color: #0090d9; text-decoration-line: none;">remap</a>&nbsp;to implement simple remapping routines.</li></ol></div><div id="theory"><h2>Theory<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#theory" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h2><div id="what-is-remapping"><h3>What is remapping?<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#what-is-remapping" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h3><ul><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">It is the process of taking pixels from one place in the image and locating them in another position in a new image.</p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">To accomplish the mapping process, it might be necessary to do some interpolation for non-integer pixel locations, since there will not always be a one-to-one-pixel correspondence between source and destination images.</p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">We can express the remap for every pixel location&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/45b34b73b5a1fed1fd38b3a37ca1ada031de9970.png" alt="(x,y)" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;as:</p><div><p style="text-align: center; line-height: 20.8px; margin-top: 10px; margin-bottom: 10px;"><img src="https://docs.opencv.org/2.4/_images/math/5107f33a3ac6fdce33ce9ced0d2cf7a2d29ab954.png" alt="g(x,y) = f ( h(x,y) )" style="border: 0px; max-width: 100%;" /></p></div><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">where&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/ba0c5e23fc043b0f4bedded7d22800ecfef42cb3.png" alt="g()" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;is the remapped image,&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/0f69e1c16ba9d089cdf157d6894f65e9654f1ef5.png" alt="f()" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;the source image and&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/d0bc35c326f7b86691de1d7b925500f21fa97b5e.png" alt="h(x,y)" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;is the mapping function that operates on&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/45b34b73b5a1fed1fd38b3a37ca1ada031de9970.png" alt="(x,y)" style="border: 0px; max-width: 100%; vertical-align: middle;" />.</p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Let&#8217;s think in a quick example. Imagine that we have an image&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/06f9f0fcaa8d96a6a23b0f7d1566fe5efaa789ad.png" alt="I" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;and, say, we want to do a remap such that:</p><div><p style="text-align: center; line-height: 20.8px; margin-top: 10px; margin-bottom: 10px;"><img src="https://docs.opencv.org/2.4/_images/math/bc683b39ab89b827dcd1078b7676246a6b10663f.png" alt="h(x,y) = (I.cols - x, y )" style="border: 0px; max-width: 100%;" /></p></div><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">What would happen? It is easily seen that the image would flip in the&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/275d1cfd2234a22c171bcf9ee37dd451fffd5e1b.png" alt="x" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;direction. For instance, consider the input image:</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Theory_0.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Original test image" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Theory_0.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 120pt;" /></a><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">observe how the red circle changes positions with respect to x (considering&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/275d1cfd2234a22c171bcf9ee37dd451fffd5e1b.png" alt="x" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;the horizontal direction):</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Theory_1.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Original test image" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Theory_1.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 120pt;" /></a></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">In OpenCV, the function&nbsp;<a external"="" href="http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html?highlight=remap#remap" style="color: #0090d9; text-decoration-line: none;">remap</a>&nbsp;offers a simple remapping implementation.</p></li></ul></div></div><div id="code"><h2>Code<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#code" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h2><ol simple"="" style="list-style-position: initial; list-style-image: initial;"><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><strong>What does this program do?</strong><ul><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">Loads an image</li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">Each second, apply 1 of 4 different remapping processes to the image and display them indefinitely in a window.</li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">Wait for the user to exit the program</li></ul></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">The tutorial code&#8217;s is shown lines below. You can also download it from&nbsp;<a external"="" href="https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp" style="color: #0090d9; text-decoration-line: none;">here</a></li></ol><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;"> <span style="color: #007020;">#include</span> <span style="color: #408090; font-style: italic;">"opencv2/highgui/highgui.hpp"</span>  <span style="color: #007020;">#include</span> <span style="color: #408090; font-style: italic;">"opencv2/imgproc/imgproc.hpp"</span>  <span style="color: #007020;">#include</span> <span style="color: #408090; font-style: italic;">&lt;iostream&gt;</span>  <span style="color: #007020;">#include</span> <span style="color: #408090; font-style: italic;">&lt;stdio.h&gt;</span>   <span style="color: #007020; font-weight: bold;">using</span> <span style="color: #007020; font-weight: bold;">namespace</span> cv;   <span style="color: #408090; font-style: italic;">/// Global variables</span>  Mat src, dst;  Mat map_x, map_y;  <span style="color: #902000;">char</span><span style="color: #666666;">*</span> remap_window <span style="color: #666666;">=</span> <span style="color: #4070a0;">"Remap demo"</span>;  <span style="color: #902000;">int</span> ind <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>;   <span style="color: #408090; font-style: italic;">/// Function Headers</span>  <span style="color: #902000;">void</span> <span style="color: #06287e;">update_map</span>( <span style="color: #902000;">void</span> );   <span style="color: #408090; font-style: italic;">/**</span> <span style="color: #408090; font-style: italic;"> * @function main</span> <span style="color: #408090; font-style: italic;"> */</span>  <span style="color: #902000;">int</span> <span style="color: #06287e;">main</span>( <span style="color: #902000;">int</span> argc, <span style="color: #902000;">char</span><span style="color: #666666;">**</span> argv )  {    <span style="color: #408090; font-style: italic;">/// Load the image</span>    src <span style="color: #666666;">=</span> imread( argv[<span style="color: #208050;">1</span>], <span style="color: #208050;">1</span> );    <span style="color: #408090; font-style: italic;">/// Create dst, map_x and map_y with the same size as src:</span>   dst.create( src.size(), src.type() );   map_x.create( src.size(), CV_32FC1 );   map_y.create( src.size(), CV_32FC1 );    <span style="color: #408090; font-style: italic;">/// Create window</span>   namedWindow( remap_window, CV_WINDOW_AUTOSIZE );    <span style="color: #408090; font-style: italic;">/// Loop</span>   <span style="color: #007020; font-weight: bold;">while</span>( <span style="color: #007020;">true</span> )   {     <span style="color: #408090; font-style: italic;">/// Each 1 sec. Press ESC to exit the program</span>     <span style="color: #902000;">int</span> c <span style="color: #666666;">=</span> waitKey( <span style="color: #208050;">1000</span> );      <span style="color: #007020; font-weight: bold;">if</span>( (<span style="color: #902000;">char</span>)c <span style="color: #666666;">==</span> <span style="color: #208050;">27</span> )       { <span style="color: #007020; font-weight: bold;">break</span>; }      <span style="color: #408090; font-style: italic;">/// Update map_x &amp; map_y. Then apply remap</span>     update_map();     remap( src, dst, map_x, map_y, CV_INTER_LINEAR, BORDER_CONSTANT, Scalar(<span style="color: #208050;">0</span>,<span style="color: #208050;">0</span>, <span style="color: #208050;">0</span>) );      <span style="color: #408090; font-style: italic;">/// Display results</span>     imshow( remap_window, dst );   }   <span style="color: #007020; font-weight: bold;">return</span> <span style="color: #208050;">0</span>;  }   <span style="color: #408090; font-style: italic;">/**</span> <span style="color: #408090; font-style: italic;"> * @function update_map</span> <span style="color: #408090; font-style: italic;"> * @brief Fill the map_x and map_y matrices with 4 types of mappings</span> <span style="color: #408090; font-style: italic;"> */</span>  <span style="color: #902000;">void</span> <span style="color: #06287e;">update_map</span>( <span style="color: #902000;">void</span> )  {    ind <span style="color: #666666;">=</span> ind<span style="color: #666666;">%</span><span style="color: #208050;">4</span>;     <span style="color: #007020; font-weight: bold;">for</span>( <span style="color: #902000;">int</span> j <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>; j <span style="color: #666666;">&lt;</span> src.rows; j<span style="color: #666666;">++</span> )    { <span style="color: #007020; font-weight: bold;">for</span>( <span style="color: #902000;">int</span> i <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>; i <span style="color: #666666;">&lt;</span> src.cols; i<span style="color: #666666;">++</span> )        {          <span style="color: #007020; font-weight: bold;">switch</span>( ind )          {            <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">0</span><span style="color: #666666;">:</span>              <span style="color: #007020; font-weight: bold;">if</span>( i <span style="color: #666666;">&gt;</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> <span style="color: #666666;">&amp;&amp;</span> i <span style="color: #666666;">&lt;</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.75</span> <span style="color: #666666;">&amp;&amp;</span> j <span style="color: #666666;">&gt;</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> <span style="color: #666666;">&amp;&amp;</span> j <span style="color: #666666;">&lt;</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.75</span> )                {                  map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">2</span><span style="color: #666666;">*</span>( i <span style="color: #666666;">-</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> ) <span style="color: #666666;">+</span> <span style="color: #208050;">0.5</span> ;                  map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">2</span><span style="color: #666666;">*</span>( j <span style="color: #666666;">-</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> ) <span style="color: #666666;">+</span> <span style="color: #208050;">0.5</span> ;                 }              <span style="color: #007020; font-weight: bold;">else</span>                { map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">0</span> ;                  map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">0</span> ;                }                  <span style="color: #007020; font-weight: bold;">break</span>;            <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">1</span><span style="color: #666666;">:</span>                  map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> i ;                  map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.rows <span style="color: #666666;">-</span> j ;                  <span style="color: #007020; font-weight: bold;">break</span>;            <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">2</span><span style="color: #666666;">:</span>                  map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.cols <span style="color: #666666;">-</span> i ;                  map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> j ;                  <span style="color: #007020; font-weight: bold;">break</span>;            <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">3</span><span style="color: #666666;">:</span>                  map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.cols <span style="color: #666666;">-</span> i ;                  map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.rows <span style="color: #666666;">-</span> j ;                  <span style="color: #007020; font-weight: bold;">break</span>;          } <span style="color: #408090; font-style: italic;">// end of switch</span>        }     }   ind<span style="color: #666666;">++</span>; } </pre></div></div></div><div id="explanation"><h2>Explanation<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#explanation" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h2><ol style="list-style-position: initial; list-style-image: initial;"><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Create some variables we will use:</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;">Mat src, dst; Mat map_x, map_y; <span style="color: #902000;">char</span><span style="color: #666666;">*</span> remap_window <span style="color: #666666;">=</span> <span style="color: #4070a0;">"Remap demo"</span>; <span style="color: #902000;">int</span> ind <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>; </pre></div></div></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Load an image:</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;">src <span style="color: #666666;">=</span> imread( argv[<span style="color: #208050;">1</span>], <span style="color: #208050;">1</span> ); </pre></div></div></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Create the destination image and the two mapping matrices (for x and y )</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;">dst.create( src.size(), src.type() ); map_x.create( src.size(), CV_32FC1 ); map_y.create( src.size(), CV_32FC1 ); </pre></div></div></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Create a window to display results</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;">namedWindow( remap_window, CV_WINDOW_AUTOSIZE ); </pre></div></div></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Establish a loop. Each 1000 ms we update our mapping matrices (<em>mat_x</em>&nbsp;and&nbsp;<em>mat_y</em>) and apply them to our source image:</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; color: #333333; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;"><span style="color: #007020; font-weight: bold;">while</span>( <span style="color: #007020;">true</span> ) {   <span style="color: #408090; font-style: italic;">/// Each 1 sec. Press ESC to exit the program</span>   <span style="color: #902000;">int</span> c <span style="color: #666666;">=</span> waitKey( <span style="color: #208050;">1000</span> );    <span style="color: #007020; font-weight: bold;">if</span>( (<span style="color: #902000;">char</span>)c <span style="color: #666666;">==</span> <span style="color: #208050;">27</span> )     { <span style="color: #007020; font-weight: bold;">break</span>; }    <span style="color: #408090; font-style: italic;">/// Update map_x &amp; map_y. Then apply remap</span>   update_map();   remap( src, dst, map_x, map_y, CV_INTER_LINEAR, BORDER_CONSTANT, Scalar(<span style="color: #208050;">0</span>,<span style="color: #208050;">0</span>, <span style="color: #208050;">0</span>) );    <span style="color: #408090; font-style: italic;">/// Display results</span>   imshow( remap_window, dst ); } </pre></div></div><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">The function that applies the remapping is&nbsp;<a external"="" href="http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html?highlight=remap#remap" style="color: #0090d9; text-decoration-line: none;">remap</a>. We give the following arguments:</p><ul><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>src</strong>: Source image</li><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>dst</strong>: Destination image of same size as&nbsp;<em>src</em></li><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>map_x</strong>: The mapping function in the x direction. It is equivalent to the first component of&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/544f165b8ea27ac75336cccb29db2307141355fd.png" alt="h(i,j)" style="border: 0px; max-width: 100%; vertical-align: middle;" /></li><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>map_y</strong>: Same as above, but in y direction. Note that&nbsp;<em>map_y</em>&nbsp;and&nbsp;<em>map_x</em>&nbsp;are both of the same size as&nbsp;<em>src</em></li><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>CV_INTER_LINEAR</strong>: The type of interpolation to use for non-integer pixels. This is by default.</li><li style="text-align: justify; line-height: 20.8px; margin: 0px;"><strong>BORDER_CONSTANT</strong>: Default</li></ul><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">How do we update our mapping matrices&nbsp;<em>mat_x</em>&nbsp;and&nbsp;<em>mat_y</em>? Go on reading:</p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;"><strong>Updating the mapping matrices:</strong>&nbsp;We are going to perform 4 different mappings:</p><ol style="list-style: lower-alpha;"><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Reduce the picture to half its size and will display it in the middle:</p><div><p style="text-align: center; line-height: 20.8px; margin-top: 10px; margin-bottom: 10px;"><img src="https://docs.opencv.org/2.4/_images/math/6c76f9ab554bd1f783e115a951edaa999016de13.png" alt="h(i,j) = ( 2*i - src.cols/2  + 0.5, 2*j - src.rows/2  + 0.5)" style="border: 0px; max-width: 100%;" /></p></div><p style="line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">for all pairs&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/962ce99ac9611d5b47f54c06005bb34eb024574e.png" alt="(i,j)" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;such that:&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/82888c6f43b83013bc263c4f56f5d25eaa9e7d1c.png" alt="\dfrac{src.cols}{4}<i<\dfrac{3 \cdot src.cols}{4}" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;and&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/61eb0319ddd2741eab619cba98391839c46e4ac4.png" alt="\dfrac{src.rows}{4}<j<\dfrac{3 \cdot src.rows}{4}" style="border: 0px; max-width: 100%; vertical-align: middle;" /></p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Turn the image upside down:&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/be785eae3cbc106b55ff0f40e257c4f3ec54c8fb.png" alt="h( i, j ) = (i, src.rows - j)" style="border: 0px; max-width: 100%; vertical-align: middle;" /></p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Reflect the image from left to right:&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/b800c2aa93cf5983dc1a081c87e2747c4fe889b3.png" alt="h(i,j) = ( src.cols - i, j )" style="border: 0px; max-width: 100%; vertical-align: middle;" /></p></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Combination of b and c:&nbsp;<img src="https://docs.opencv.org/2.4/_images/math/f9ab788b78891418473b9da138b73608411ec2ec.png" alt="h(i,j) = ( src.cols - i, src.rows - j )" style="border: 0px; max-width: 100%; vertical-align: middle;" /></p></li></ol></li></ol><blockquote><p style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;">This is expressed in the following snippet. Here,&nbsp;<em>map_x</em>&nbsp;represents the first coordinate of&nbsp;<em>h(i,j)</em>&nbsp;and&nbsp;<em>map_y</em>&nbsp;the second coordinate.</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; background-color: #e0f5ff; line-height: 15.6px; border-top: 1px solid #aaccee; border-bottom: 1px solid #aaccee; border-image: initial; border-left: none; border-right: none;"><span style="color: #007020; font-weight: bold;">for</span>( <span style="color: #902000;">int</span> j <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>; j <span style="color: #666666;">&lt;</span> src.rows; j<span style="color: #666666;">++</span> ) { <span style="color: #007020; font-weight: bold;">for</span>( <span style="color: #902000;">int</span> i <span style="color: #666666;">=</span> <span style="color: #208050;">0</span>; i <span style="color: #666666;">&lt;</span> src.cols; i<span style="color: #666666;">++</span> )     {       <span style="color: #007020; font-weight: bold;">switch</span>( ind )       {         <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">0</span><span style="color: #666666;">:</span>           <span style="color: #007020; font-weight: bold;">if</span>( i <span style="color: #666666;">&gt;</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> <span style="color: #666666;">&amp;&amp;</span> i <span style="color: #666666;">&lt;</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.75</span> <span style="color: #666666;">&amp;&amp;</span> j <span style="color: #666666;">&gt;</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> <span style="color: #666666;">&amp;&amp;</span> j <span style="color: #666666;">&lt;</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.75</span> )             {               map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">2</span><span style="color: #666666;">*</span>( i <span style="color: #666666;">-</span> src.cols<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> ) <span style="color: #666666;">+</span> <span style="color: #208050;">0.5</span> ;               map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">2</span><span style="color: #666666;">*</span>( j <span style="color: #666666;">-</span> src.rows<span style="color: #666666;">*</span><span style="color: #208050;">0.25</span> ) <span style="color: #666666;">+</span> <span style="color: #208050;">0.5</span> ;              }           <span style="color: #007020; font-weight: bold;">else</span>             { map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">0</span> ;               map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> <span style="color: #208050;">0</span> ;             }               <span style="color: #007020; font-weight: bold;">break</span>;         <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">1</span><span style="color: #666666;">:</span>               map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> i ;               map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.rows <span style="color: #666666;">-</span> j ;               <span style="color: #007020; font-weight: bold;">break</span>;         <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">2</span><span style="color: #666666;">:</span>               map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.cols <span style="color: #666666;">-</span> i ;               map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> j ;               <span style="color: #007020; font-weight: bold;">break</span>;         <span style="color: #007020; font-weight: bold;">case</span> <span style="color: #208050;">3</span><span style="color: #666666;">:</span>               map_x.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.cols <span style="color: #666666;">-</span> i ;               map_y.at<span style="color: #666666;">&lt;</span><span style="color: #902000;">float</span><span style="color: #666666;">&gt;</span>(j,i) <span style="color: #666666;">=</span> src.rows <span style="color: #666666;">-</span> j ;               <span style="color: #007020; font-weight: bold;">break</span>;       } <span style="color: #408090; font-style: italic;">// end of switch</span>     }   }  ind<span style="color: #666666;">++</span>; } </pre></div></div></blockquote></div><div id="result"><h2>Result<a href="https://docs.opencv.org/2.4/doc/tutorials/imgproc/imgtrans/remap/remap.html#result" title="Permalink to this headline" style="color: #65a136; text-decoration-line: none; visibility: hidden; font-size: 0.8em; padding: 0px 4px;"></a></h2><ol style="list-style-position: initial; list-style-image: initial;"><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">After compiling the code above, you can execute it giving as argument an image path. For instance, by using the following image:</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Original_Image.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Original test image" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Original_Image.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 250pt;" /></a></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">This is the result of reducing it to half the size and centering it:</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_0.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Result 0 for remapping" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_0.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 250pt;" /></a></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Turning it upside down:</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_1.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Result 0 for remapping" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_1.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 250pt;" /></a></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Reflecting it in the x direction:</p><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_2.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Result 0 for remapping" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_2.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 250pt;" /></a></li><li style="text-align: justify; line-height: 20.8px; margin-top: 1em; margin-bottom: 1em;"><p style="margin-top: 1em; line-height: 20.8px; margin-bottom: 1em;">Reflecting it in both directions:</p></li></ol><a internal=""  image-reference"="" href="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_3.jpg" style="color: #0090d9; text-decoration-line: none;"><img alt="Result 0 for remapping" src="https://docs.opencv.org/2.4/_images/Remap_Tutorial_Result_3.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto; width: 250pt;" /></a></div></div></div><div style="background-color: #004068; color: #ffffff; padding: 20px 20px 30px; font-family: sans-serif; font-size: 16px;"></div><img src ="http://www.cppblog.com/zmj/aggbug/215434.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-12-20 17:44 <a href="http://www.cppblog.com/zmj/archive/2017/12/20/215434.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Understanding the View Matrix</title><link>http://www.cppblog.com/zmj/archive/2017/11/20/215358.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Mon, 20 Nov 2017 09:10:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/20/215358.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215358.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/20/215358.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215358.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215358.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://www.3dgep.com/understanding-the-view-matrix/In this article, I will attempt to explain how to construct the view matrix correctly and how to use the view matrix to transform a model&#8217;s ve...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/11/20/215358.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215358.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-20 17:10 <a href="http://www.cppblog.com/zmj/archive/2017/11/20/215358.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to tranform 2D image coordinates to 3D world coordinated with Z = 0?</title><link>http://www.cppblog.com/zmj/archive/2017/11/17/215355.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 17 Nov 2017 06:40:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/17/215355.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215355.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/17/215355.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215355.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215355.html</trackback:ping><description><![CDATA[<div><a href="http://answers.opencv.org/question/150451/how-to-tranform-2d-image-coordinates-to-3d-world-coordinated-with-z-0/">http://answers.opencv.org/question/150451/how-to-tranform-2d-image-coordinates-to-3d-world-coordinated-with-z-0/<br /><a href="http://answers.opencv.org/question/150451/how-to-tranform-2d-image-coordinates-to-3d-world-coordinated-with-z-0/">https://github.com/opencv/opencv/issues/8762<br /></a><br /><div>Hi everyone, I currently working on my project which involves vehicle detection and tracking and estimating and optimizing a cuboid around the vehicle. For that I am taking the center of the detected vehicle and I need to find the 3D world coodinate of the point and then estimate the world coordinates of the edges of the cuboid and the project it back to the image to display it.</div><div></div><div>So, now I am new to computer vision and OpenCV, but in my knowledge, I just need 4 points on the image and need to know the world coordinates of those 4 points and use solvePNP in OpenCV to get the rotation and translation vectors (I already have the camera matrix and distortion coefficients). Then, I need to use Rodrigues to transform the rotation vector into a rotation matrix and then concatenate it with the translation vector to get my extrinsic matrix and then multiply the extrinsic matrix with the camera matrix to get my projection matrix. Since my z coordinate is zero, so I need to take off the third column from the projection matrix which gives the homography matrix for converting the 2D image points to 3D world points. Now, I find the inverse of the homography matrix which gives me the homography between the 3D world points to 2D image points. After that I multiply the image points [x, y, 1]t with the inverse homography matrix to get [wX, wY, w]t and the divide the entire vector by the scalar w to get [X, Y, 1] which gives me the X and Y values of the world coordinates.</div><div></div><div>My code is like this:</div><div></div><div>image_points.push_back(Point2d(275, 204));</div><div>image_points.push_back(Point2d(331, 204));</div><div>image_points.push_back(Point2d(331, 308));</div><div>image_points.push_back(Point2d(275, 308));</div><div></div><div>cout &lt;&lt; "Image Points: " &lt;&lt; image_points &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>world_points.push_back(Point3d(0.0, 0.0, 0.0));</div><div>world_points.push_back(Point3d(1.775, 0.0, 0.0));</div><div>world_points.push_back(Point3d(1.775, 4.620, 0.0));</div><div>world_points.push_back(Point3d(0.0, 4.620, 0.0));</div><div></div><div>cout &lt;&lt; "World Points: " &lt;&lt; world_points &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>solvePnP(world_points, image_points, cameraMatrix, distCoeffs, rotationVector, translationVector);</div><div>cout &lt;&lt; "Rotation Vector: " &lt;&lt; endl &lt;&lt; rotationVector &lt;&lt; endl &lt;&lt; endl;</div><div>cout &lt;&lt; "Translation Vector: " &lt;&lt; endl &lt;&lt; translationVector &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>Rodrigues(rotationVector, rotationMatrix);</div><div>cout &lt;&lt; "Rotation Matrix: " &lt;&lt; endl &lt;&lt; rotationMatrix &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>hconcat(rotationMatrix, translationVector, extrinsicMatrix);</div><div>cout &lt;&lt; "Extrinsic Matrix: " &lt;&lt; endl &lt;&lt; extrinsicMatrix &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>projectionMatrix = cameraMatrix * extrinsicMatrix;</div><div>cout &lt;&lt; "Projection Matrix: " &lt;&lt; endl &lt;&lt; projectionMatrix &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>double p11 = projectionMatrix.at&lt;double&gt;(0, 0),</div><div>&nbsp; &nbsp; p12 = projectionMatrix.at&lt;double&gt;(0, 1),</div><div>&nbsp; &nbsp; p14 = projectionMatrix.at&lt;double&gt;(0, 3),</div><div>&nbsp; &nbsp; p21 = projectionMatrix.at&lt;double&gt;(1, 0),</div><div>&nbsp; &nbsp; p22 = projectionMatrix.at&lt;double&gt;(1, 1),</div><div>&nbsp; &nbsp; p24 = projectionMatrix.at&lt;double&gt;(1, 3),</div><div>&nbsp; &nbsp; p31 = projectionMatrix.at&lt;double&gt;(2, 0),</div><div>&nbsp; &nbsp; p32 = projectionMatrix.at&lt;double&gt;(2, 1),</div><div>&nbsp; &nbsp; p34 = projectionMatrix.at&lt;double&gt;(2, 3);</div><div></div><div></div><div>homographyMatrix = (Mat_&lt;double&gt;(3, 3) &lt;&lt; p11, p12, p14, p21, p22, p24, p31, p32, p34);</div><div>cout &lt;&lt; "Homography Matrix: " &lt;&lt; endl &lt;&lt; homographyMatrix &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>inverseHomographyMatrix = homographyMatrix.inv();</div><div>cout &lt;&lt; "Inverse Homography Matrix: " &lt;&lt; endl &lt;&lt; inverseHomographyMatrix &lt;&lt; endl &lt;&lt; endl;</div><div></div><div>Mat point2D = (Mat_&lt;double&gt;(3, 1) &lt;&lt; image_points[0].x, image_points[0].y, 1);</div><div>cout &lt;&lt; "First Image ...<br /><br /><div>https://github.com/opencv/opencv/issues/8762<br /><br /><br /><ul style="box-sizing: border-box; padding-left: 2em; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; margin-top: 0px !important; background-color: #ffffff;"><li style="box-sizing: border-box;">OpenCV =&gt; 3.2</li><li style="box-sizing: border-box; margin-top: 0.25em;">Operating System / Platform =&gt; Windows 64 Bit</li><li style="box-sizing: border-box; margin-top: 0.25em;">Compiler =&gt; Visual Studio 2015</li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">Hi everyone, I understand that this forum is to report bugs and not to ask questions but I already posted about my problems in answers.opencv.org without any useful response. I need to resolve my problem very urgently since my final year project deadline is approaching soon.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">I am currently working on my project which involves vehicle detection and tracking and estimating and optimizing a cuboid around the vehicle. For that I have accomplished detection and tracking of vehicles and I need to find the 3-D world coordinates of the image points of the edges of the bounding boxes of the vehicles and then estimate the world coordinates of the edges of the cuboid and the project it back to the image to display it.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">So, I am new to computer vision and OpenCV, but in my knowledge, I just need 4 points on the image and need to know the world coordinates of those 4 points and use solvePNP in OpenCV to get the rotation and translation vectors (I already have the camera matrix and distortion coefficients). Then, I need to use Rodrigues to transform the rotation vector into a rotation matrix and then concatenate it with the translation vector to get my extrinsic matrix and then multiply the extrinsic matrix with the camera matrix to get my projection matrix. Since my z coordinate is zero, so I need to take off the third column from the projection matrix which gives the homography matrix for converting the 2D image points to 3D world points. Now, I find the inverse of the homography matrix which gives me the homography between the 3D world points to 2D image points. After that I multiply the image points [x, y, 1]t with the inverse homography matrix to get [wX, wY, w]t and the divide the entire vector by the scalar w to get [X, Y, 1] which gives me the X and Y values of the world coordinates.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">My code looks like this:</p><div highlight-source-c++"="" style="box-sizing: border-box; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; overflow: visible !important; background-color: #ffffff;"><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; border-radius: 3px; word-break: normal; background-color: #f6f8fa;">#<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>opencv2/opencv.hpp<span style="box-sizing: border-box;">"</span></span> #<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">&lt;</span>stdio.h<span style="box-sizing: border-box;">&gt;</span></span> #<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">&lt;</span>iostream<span style="box-sizing: border-box;">&gt;</span></span> #<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">&lt;</span>sstream<span style="box-sizing: border-box;">&gt;</span></span> #<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">&lt;</span>math.h<span style="box-sizing: border-box;">&gt;</span></span> #<span style="box-sizing: border-box; color: #d73a49;">include</span> <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">&lt;</span>conio.h<span style="box-sizing: border-box;">&gt;</span></span>  <span style="box-sizing: border-box; color: #d73a49;">using</span> <span style="box-sizing: border-box; color: #d73a49;">namespace</span> <span style="box-sizing: border-box; color: #6f42c1;">cv</span><span style="box-sizing: border-box; color: #d73a49;">;</span> <span style="box-sizing: border-box; color: #d73a49;">using</span> <span style="box-sizing: border-box; color: #d73a49;">namespace</span> <span style="box-sizing: border-box; color: #6f42c1;">std</span><span style="box-sizing: border-box; color: #d73a49;">;</span>  Mat cameraMatrix, distCoeffs, rotationVector, rotationMatrix, translationVector, extrinsicMatrix, projectionMatrix, homographyMatrix, inverseHomographyMatrix;   <span style="box-sizing: border-box; color: #005cc5;">Point</span> point; vector&lt;Point2d&gt; image_points; vector&lt;Point3d&gt; world_points;  <span style="box-sizing: border-box; color: #d73a49;">int</span> <span style="box-sizing: border-box; color: #6f42c1;">main</span>() {     FileStorage <span style="box-sizing: border-box;">fs1</span>(<span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>intrinsics.yml<span style="box-sizing: border-box;">"</span></span>, FileStorage::READ);     fs1[<span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>camera_matrix<span style="box-sizing: border-box;">"</span></span>] &gt;&gt; cameraMatrix;    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Camera Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; cameraMatrix &lt;&lt; endl &lt;&lt; endl;     fs1[<span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>distortion_coefficients<span style="box-sizing: border-box;">"</span></span>] &gt;&gt; distCoeffs;    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Distortion Coefficients: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; distCoeffs &lt;&lt; endl &lt;&lt; endl;          image_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point2d</span>(<span style="box-sizing: border-box; color: #005cc5;">275</span>, <span style="box-sizing: border-box; color: #005cc5;">204</span>));    image_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point2d</span>(<span style="box-sizing: border-box; color: #005cc5;">331</span>, <span style="box-sizing: border-box; color: #005cc5;">204</span>));    image_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point2d</span>(<span style="box-sizing: border-box; color: #005cc5;">331</span>, <span style="box-sizing: border-box; color: #005cc5;">308</span>));    image_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point2d</span>(<span style="box-sizing: border-box; color: #005cc5;">275</span>, <span style="box-sizing: border-box; color: #005cc5;">308</span>));     cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Image Points: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; image_points &lt;&lt; endl &lt;&lt; endl;     world_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point3d</span>(<span style="box-sizing: border-box; color: #005cc5;">0.0</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>));    world_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point3d</span>(<span style="box-sizing: border-box; color: #005cc5;">1.775</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>));    world_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point3d</span>(<span style="box-sizing: border-box; color: #005cc5;">1.775</span>, <span style="box-sizing: border-box; color: #005cc5;">4.620</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>));    world_points.<span style="box-sizing: border-box; color: #005cc5;">push_back</span>(<span style="box-sizing: border-box; color: #005cc5;">Point3d</span>(<span style="box-sizing: border-box; color: #005cc5;">0.0</span>, <span style="box-sizing: border-box; color: #005cc5;">4.620</span>, <span style="box-sizing: border-box; color: #005cc5;">0.0</span>));     cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>World Points: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; world_points &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #005cc5;">solvePnP</span>(world_points, image_points, cameraMatrix, distCoeffs, rotationVector, translationVector);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Rotation Vector: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; rotationVector &lt;&lt; endl &lt;&lt; endl;    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Translation Vector: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; translationVector &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #005cc5;">Rodrigues</span>(rotationVector, rotationMatrix);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Rotation Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; rotationMatrix &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #005cc5;">hconcat</span>(rotationMatrix, translationVector, extrinsicMatrix);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Extrinsic Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; extrinsicMatrix &lt;&lt; endl &lt;&lt; endl;     projectionMatrix = cameraMatrix * extrinsicMatrix;    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Projection Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; projectionMatrix &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #d73a49;">double</span> p11 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">0</span>, <span style="box-sizing: border-box; color: #005cc5;">0</span>),    	p12 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">0</span>, <span style="box-sizing: border-box; color: #005cc5;">1</span>),    	p14 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">0</span>, <span style="box-sizing: border-box; color: #005cc5;">3</span>),    	p21 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">1</span>, <span style="box-sizing: border-box; color: #005cc5;">0</span>),    	p22 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">1</span>, <span style="box-sizing: border-box; color: #005cc5;">1</span>),    	p24 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">1</span>, <span style="box-sizing: border-box; color: #005cc5;">3</span>),    	p31 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">2</span>, <span style="box-sizing: border-box; color: #005cc5;">0</span>),    	p32 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">2</span>, <span style="box-sizing: border-box; color: #005cc5;">1</span>),    	p34 = projectionMatrix.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">2</span>, <span style="box-sizing: border-box; color: #005cc5;">3</span>);      homographyMatrix = (Mat_&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">3</span>, <span style="box-sizing: border-box; color: #005cc5;">3</span>) &lt;&lt; p11, p12, p14, p21, p22, p24, p31, p32, p34);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Homography Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; homographyMatrix &lt;&lt; endl &lt;&lt; endl;     inverseHomographyMatrix = homographyMatrix.<span style="box-sizing: border-box; color: #005cc5;">inv</span>();    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Inverse Homography Matrix: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; endl &lt;&lt; inverseHomographyMatrix &lt;&lt; endl &lt;&lt; endl;     Mat point2D = (Mat_&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">3</span>, <span style="box-sizing: border-box; color: #005cc5;">1</span>) &lt;&lt; image_points[<span style="box-sizing: border-box; color: #005cc5;">0</span>].<span style="box-sizing: border-box;">x</span>, image_points[<span style="box-sizing: border-box; color: #005cc5;">0</span>].<span style="box-sizing: border-box;">y</span>, <span style="box-sizing: border-box; color: #005cc5;">1</span>);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>First Image Point<span style="box-sizing: border-box;">"</span></span> &lt;&lt; point2D &lt;&lt; endl &lt;&lt; endl;     Mat point3Dw = inverseHomographyMatrix*point2D;    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Point 3D-W : <span style="box-sizing: border-box;">"</span></span> &lt;&lt; point3Dw &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #d73a49;">double</span> w = point3Dw.<span style="box-sizing: border-box;">at</span>&lt;<span style="box-sizing: border-box; color: #d73a49;">double</span>&gt;(<span style="box-sizing: border-box; color: #005cc5;">2</span>, <span style="box-sizing: border-box; color: #005cc5;">0</span>);    cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>W: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; w &lt;&lt; endl &lt;&lt; endl;     Mat matPoint3D;    <span style="box-sizing: border-box; color: #005cc5;">divide</span>(w, point3Dw, matPoint3D);     cout &lt;&lt; <span style="box-sizing: border-box; color: #032f62;"><span style="box-sizing: border-box;">"</span>Point 3D: <span style="box-sizing: border-box;">"</span></span> &lt;&lt; matPoint3D &lt;&lt; endl &lt;&lt; endl;     <span style="box-sizing: border-box; color: #005cc5;">_getch</span>();    <span style="box-sizing: border-box; color: #d73a49;">return</span> <span style="box-sizing: border-box; color: #005cc5;">0</span>; }</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">I have got the image coordinates of the four known world points and hard-coded it for simplification.<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; padding: 0.2em 0.4em; margin: 0px; border-radius: 3px; background-color: rgba(27, 31, 35, 0.0470588);">image_points</code>&nbsp;contain the image coordinates of the four points and&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; padding: 0.2em 0.4em; margin: 0px; border-radius: 3px; background-color: rgba(27, 31, 35, 0.0470588);">world_points</code>&nbsp;contain the world coordinates of the four points. I am considering the the first world point as the origin (0, 0, 0) in the world axis and using known distance calculating the coordinates of the other four points. Now after calculating the inverse homography matrix, I multiplied it with [image_points[0].x, image_points[0].y, 1]t which is related to the world coordinate (0, 0, 0). Then I divide the result by the third component w to get [X, Y, 1]. But after printing out the values of X and Y, it turns out they are not 0, 0 respectively. What am doing wrong?</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: #ffffff;">The output of my code is like this:</p><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; margin-top: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; border-radius: 3px; color: #24292e; margin-bottom: 0px !important; background-color: #f6f8fa;"><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal; background: transparent;">Camera Matrix: [517.0036881709533, 0, 320;  0, 517.0036881709533, 212;  0, 0, 1]  Distortion Coefficients: [0.1128663679798094;  -1.487790079922432;  0;  0;  2.300571896761067]  Image Points: [275, 204;  331, 204;  331, 308;  275, 308]  World Points: [0, 0, 0;  1.775, 0, 0;  1.775, 4.62, 0;  0, 4.62, 0]  Rotation Vector: [0.661476468596541;  -0.02794460022559267;  0.01206996342819649]  Translation Vector: [-1.394495345140898;  -0.2454153722672731;  15.47126945512652]  Rotation Matrix: [0.9995533907649279, -0.02011656447351923, -0.02209848058392758;  0.002297501163799448, 0.7890323093017149, -0.6143474069013439;  0.02979497438726573, 0.6140222623910194, 0.7887261380159]  Extrinsic Matrix: [0.9995533907649279, -0.02011656447351923, -0.02209848058392758, -1.394495345140898;  0.002297501163799448, 0.7890323093017149, -0.6143474069013439, -0.2454153722672731;  0.02979497438726573, 0.6140222623910194, 0.7887261380159, 15.47126945512652]  Projection Matrix: [526.3071813531748, 186.086785938988, 240.9673682002232, 4229.846989065414;  7.504351145361707, 538.1053336219271, -150.4099339268854, 3153.028471890794;  0.02979497438726573, 0.6140222623910194, 0.7887261380159, 15.47126945512652]  Homography Matrix: [526.3071813531748, 186.086785938988, 4229.846989065414;  7.504351145361707, 538.1053336219271, 3153.028471890794;  0.02979497438726573, 0.6140222623910194, 15.47126945512652]  Inverse Homography Matrix: [0.001930136511648154, -8.512427241879318e-05, -0.5103513244724983;  -6.693679705844383e-06, 0.00242178892313387, -0.4917279870709287;  -3.451449134581896e-06, -9.595179260534558e-05, 0.08513443835773901]  First Image Point[275;  204;  1]  Point 3D-W : [0.003070864657310213;  0.0004761913292736786;  0.06461112415423849]  W: 0.0646111  Point 3D: [21.04004290792539;  135.683117651025;  1] </code></pre><div><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; padding: 0px; margin: 0px; border-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><br /></code></div><br /><br /></div><br /><br /></div></a></div><img src ="http://www.cppblog.com/zmj/aggbug/215355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-17 14:40 <a href="http://www.cppblog.com/zmj/archive/2017/11/17/215355.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CSE/EE486 Computer Vision I</title><link>http://www.cppblog.com/zmj/archive/2017/11/17/215354.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 17 Nov 2017 05:46:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/17/215354.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215354.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/17/215354.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215354.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215354.html</trackback:ping><description><![CDATA[<div><a href="http://www.cse.psu.edu/~rtc12/CSE486/">http://www.cse.psu.edu/~rtc12/CSE486/<br /></a><div><a href="http://www.cse.psu.edu/~rtc12/CSE486/">http://www.cse.psu.edu/~rtc12/CSE486/lecture12.pdf</a></div><div><a href="http://www.cse.psu.edu/~rtc12/CSE486/">https://stackoverflow.com/questions/10163034/how-can-i-calculate-camera-position-by-comparing-two-photographs<br /><h2>Background</h2><span style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;">I have taught this course several times (almost every semester). I am always fiddling around with the course content, so the material covered and the order of presentation changes from semester to semester. Below are the lecture notes from Fall 2007.&nbsp;</span><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><span style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;">In addition to slides that I created, I borrowed heavily from other lecturers whose computer vision slides are on the web. I used to put an attribution at the bottom of each slide as to where and who it came from. However, that led to cluttered slides, and was distracting. So, I dropped that format. Instead, I'm telling you up-front that a lot of the slides in the lectures below did not originate from me. Here is a partial list of the main sources that I can remember: Octavia Camps, Forsyth and Ponce, David Jacobs, Steve Seitz, Chuck Dyer, Martial Hebert. If I forgot you, and you see your slides here, well... thanks. And drop me a line so I can add your name to the list.&nbsp;</span><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><span style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;">By the same token, if you are putting together a computer vision course, and want to use some of my slides, go right ahead. You are welcome to them, since the main goal here is to improve the quality of computer vision education everywhere. To quote Thomas Jefferson:&nbsp;</span><em style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;">"He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me. That ideas should freely spread from one to another over the globe, for the moral and mutual instruction of man, and improvement of his condition, seems to have been peculiarly and benevolently designed by nature, when she made them, like fire, expansible over all space, without lessening their density at any point, and like the air in which we breathe, move, and have our physical being, incapable of confinement or exclusive appropriation."&nbsp;</em><span style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;">Jefferson was one awesome dude.</span><h2>Fall 2007 Lecture Notes</h2><a href="http://www.cse.psu.edu/~rtc12/CSE486/FinalExamStudyGuide.pdf" style="font-family: Simsun; font-size: medium; line-height: normal;">Detailed List of Topics Covered in Fall 2007&nbsp;</a><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><br style="color: #000000; font-family: Simsun; font-size: medium; line-height: normal;" /><table border="10" cellpadding="8" style="font-family: Simsun;"><tbody><tr><td>Lecture 01: Intro to Computer Vision</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture01.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture01_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 02: Intensity Surfaces and Gradients</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture02.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture02_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 03: Linear Operators and Convolution</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture03.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture03_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 04: Smoothing</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture04.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture04_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 05: Edge Detection</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture05.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture05_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 06: Corner Detection</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture06.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture06_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 07: Template Matching</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture07.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture07_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 08: Introduction to Stereo</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture08.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture08_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 09: Stereo Algorithms</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture09.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture09_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 10: Image Pyramids</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture10.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture10_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 11: LoG Edge and Blob Finding</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture11.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture11_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 12: Camera Projection (Extrinsics)</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture12.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture12_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 13: Camera Projection (Intrinsics)</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture13.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture13_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 14: Parameter Estimation; Image Warping</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture14.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture14_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 15: Robust Estimation: RANSAC</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture15.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture15_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 16: Planar Homographies</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture16.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture16_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 17: Stabilization and Mosaicing</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture17.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture17_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 18: Generalized Stereo</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture18.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture18_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 19: Essential and Fundamental Matrices</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture19.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture19_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 20: The 8-point algorithm</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture20.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture20_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 21: Stereo Reconstruction</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture21.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture21_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 22: Camera Motion Field</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture22.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture22_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 23: Optic Flow</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture23.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture23_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 24: Video Change Detection</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture24.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture24_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 25: Structure From Motion (SFM)</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture25.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture25_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 26: Color and Light</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture26.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture26_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 27: Application: Skin Color</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture27.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture27_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 28: Intro to Tracking</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture28.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture28_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 29: Video Tracking: Mean-shift</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture29.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture29_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 30: Video Tracking: Lucas-Kanade</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture30.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture30_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 31: Object Recognition : SIFT Keys</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture31.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture31_6pp.pdf">6 per page</a></td></tr><tr><td>Lecture 32: Object Recognition : PCA / Eigenfaces</td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture32.pdf">slides</a></td><td><a href="http://www.cse.psu.edu/~rtc12/CSE486/lecture32_6pp.pdf">6 per page</a></td></tr></tbody></table></a></div><a href="http://www.cse.psu.edu/~rtc12/CSE486/"></a></div><img src ="http://www.cppblog.com/zmj/aggbug/215354.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-17 13:46 <a href="http://www.cppblog.com/zmj/archive/2017/11/17/215354.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>鱼眼相机标定以及OpenCV实现</title><link>http://www.cppblog.com/zmj/archive/2017/11/16/215351.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 16 Nov 2017 01:55:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/16/215351.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215351.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/16/215351.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215351.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215351.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: http://blog.csdn.net/u010784534/article/details/50474371在另一篇文章中我已经写过有关普通相机模型及其OpenCV标定实现，这篇文章将主要关注鱼眼相机模型及其OpenCV标定实现。&nbsp;先看一张鱼眼相机拍摄出来的结果：从图中可以看出很明显的畸变。对鱼眼相机标定，有时候也可以用普通相机的标定方法对其进行标定，但是却不能保证去畸变后的效果是最...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/11/16/215351.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215351.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-16 09:55 <a href="http://www.cppblog.com/zmj/archive/2017/11/16/215351.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Matlab下载</title><link>http://www.cppblog.com/zmj/archive/2017/11/14/215347.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 14 Nov 2017 08:53:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/14/215347.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215347.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/14/215347.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215347.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215347.html</trackback:ping><description><![CDATA[<div><br /><div>http://www.ilovematlab.com/thread-526724-1-1.html?s_tid=LandingPageTabqa</div><br />http://blog.sina.com.cn/s/blog_14d1511ee0102wxi4.html</div><div></div><div>Matlab2017a</div><div></div><div>链接: https://pan.baidu.com/s/1gflAa2Z 密码: fwrx</div><div></div><div>软件安装教程链接：http://t.cn/RVTJgqZ</div><div></div><div><br />楼主亲测的安装教程在这里，觉得有用的话为我写的百度经验点个赞吧?^_^</div><div></div><div>http://jingyan.baidu.com/article/ac6a9a5e0e67652b653eacc2.html</div><div></div><div><br />===================================================</div><div></div><div>Matlab2016b?</div><div></div><div>安装包链接：http://pan.baidu.com/s/1mhUrAEO 密码：8oo0??</div><div></div><div>破解crack?</div><div></div><div>链接：http://pan.baidu.com/s/1hsDLdVQ 密码：zggs?</div><div></div><div>Matlab2016a</div><div></div><div>链接：http://pan.baidu.com/s/1miwD828 密码：tt7s</div><div></div><div>Matlab2015a</div><div></div><div>链接：http://pan.baidu.com/s/1dEMZYud 密码：lfg0</div><div></div><div>Matlab2014a</div><div></div><div>链接：http://pan.baidu.com/s/1mihe2xi 密码：6ps0</div><div></div><div>Matlab2013a</div><div></div><div>链接：http://pan.baidu.com/s/1qYnbXW4 密码：c7me</div><div></div><div>Matlab2012a</div><div></div><div>链接：http://pan.baidu.com/s/1qYKlW2C 密码：funt</div><div></div><div>Matlab2011a</div><div></div><div>链接：http://pan.baidu.com/s/1eSLmv1w 密码：0acg</div><div></div><div>Matlab2010a</div><div></div><div>链接：http://pan.baidu.com/s/1eSr0fiq 密码：f83e</div><div></div><div>Matlab2009a</div><div></div><div>链接：http://pan.baidu.com/s/1kUKLT5P 密码：ormj</div><div></div><div>Matlab2008a</div><div></div><div>链接：http://pan.baidu.com/s/1nvAiGBn 密码：iogy</div><div></div><div><br /></div><strong></strong><img src ="http://www.cppblog.com/zmj/aggbug/215347.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-14 16:53 <a href="http://www.cppblog.com/zmj/archive/2017/11/14/215347.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Camera calibration With OpenCV</title><link>http://www.cppblog.com/zmj/archive/2017/11/10/215343.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Fri, 10 Nov 2017 08:57:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/11/10/215343.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215343.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/11/10/215343.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215343.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215343.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: http://www.swarthmore.edu/NatSci/mzucker1/opencv-2.4.10-docs/doc/tutorials/calib3d/camera_calibration/camera_calibration.htmlhttp://www.pudn.com/Download/item/id/1006592.htmlhttp://read.pudn.com/downl...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/11/10/215343.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215343.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-11-10 16:57 <a href="http://www.cppblog.com/zmj/archive/2017/11/10/215343.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenCV detect partial circle with noise</title><link>http://www.cppblog.com/zmj/archive/2017/10/17/215303.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 17 Oct 2017 05:39:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/10/17/215303.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215303.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/10/17/215303.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215303.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215303.html</trackback:ping><description><![CDATA[<div>https://stackoverflow.com/questions/26222525/opencv-detect-partial-circle-with-noise<br /><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;">using this as input (your own median filtered image (I've just cropped it):</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"><img src="https://i.stack.imgur.com/2XpcX.png" alt="enter image description here" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; max-width: 100%;" /></p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;">First I "normalize" the image. I just stretch values, that smallest val is 0 and biggest val is 255, leading to this result: (maybe some real contrast enhancement is better)</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"><img src="https://i.stack.imgur.com/srw54.png" alt="enter image description here" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; max-width: 100%;" /></p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;">after that I compute the threshold of that image with some fixed threshold (you might need to edit that and find a way to choose the threshold dynamically! a better contrast enhancement might help there)</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"><img src="https://i.stack.imgur.com/iokqh.png" alt="enter image description here" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; max-width: 100%;" /></p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;">from this image, I use some simple RANSAC circle detection(very similar to my answer in the linked semi-circle detection question), giving you this result as a best semi-sircle:</p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"><img src="https://i.stack.imgur.com/AZACd.png" alt="enter image description here" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; max-width: 100%;" /><br /><br /></p><p class="MsoNormal" align="left" style="background: #eff0f1; vertical-align: baseline;"><span lang="EN-US" style="font-size:
12.0pt;mso-bidi-font-size:11.0pt;font-family:Consolas;mso-fareast-font-family:
宋体;mso-bidi-font-family:宋体;color:#242729;mso-font-kerning:0pt">int main()<o:p></o:p></span></p><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 15px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"><br /></p><p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">{</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; //cv::Mat color = cv::imread("../inputData/semi_circle_contrast.png");</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Mat color = cv::imread("../inputData/semi_circle_median.png");</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Mat gray;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // convert to grayscale</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::cvtColor(color, gray, CV_BGR2GRAY);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // now map brightest pixel to 255 and smalles pixel val to 0. this is for easier finding of threshold</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; double min, max;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::minMaxLoc(gray,&amp;min,&amp;max);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float sub = min;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float mult = 255.0f/(float)(max-sub);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Mat normalized = gray - sub;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; normalized = mult * normalized;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::imshow("normalized" , normalized);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; //--------------------------------</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // now compute threshold</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // TODO: this might ne a tricky task if noise differs...</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Mat mask;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; //cv::threshold(input, mask, 0, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::threshold(normalized, mask, 100, 255, CV_THRESH_BINARY);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; std::vector&lt;cv::Point2f&gt; edgePositions;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; edgePositions = getPointPositions(mask);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // create distance transform to efficiently evaluate distance to nearest edge</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Mat dt;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::distanceTransform(255-mask, dt,CV_DIST_L1, 3);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; //TODO: maybe seed random variable for real random numbers.</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; unsigned int nIterations = 0;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; cv::Point2f bestCircleCenter;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float bestCircleRadius;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float bestCirclePercentage = 0;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float minRadius = 50;&nbsp;&nbsp; // TODO: ADJUST THIS PARAMETER TO YOUR NEEDS, otherwise smaller circles wont be detected or "small noise circles" will have a high percentage of completion</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; //float minCirclePercentage = 0.2f;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; float minCirclePercentage = 0.05f;&nbsp; // at least 5% of a circle must be present? maybe more...</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; int maxNrOfIterations = edgePositions.size();&nbsp;&nbsp; // TODO: adjust this parameter or include some real ransac criteria with inlier/outlier percentages to decide when to stop</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; for(unsigned int its=0; its&lt; maxNrOfIterations; ++its)</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; {</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //RANSAC: randomly choose 3 point and create a circle:</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //TODO: choose randomly but more intelligent, </span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //so that it is more likely to choose three points of a circle. </span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //For example if there are many small circles, it is unlikely to randomly choose 3 points of the same circle.</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int idx1 = rand()%edgePositions.size();</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int idx2 = rand()%edgePositions.size();</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int idx3 = rand()%edgePositions.size();</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // we need 3 different samples:</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(idx1 == idx2) continue;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(idx1 == idx3) continue;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(idx3 == idx2) continue;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create circle from 3 points:</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cv::Point2f center; float radius;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getCircle(edgePositions[idx1],edgePositions[idx2],edgePositions[idx3],center,radius);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // inlier set unused at the moment but could be used to approximate a (more robust) circle from alle inlier</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::vector&lt;cv::Point2f&gt; inlierSet;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //verify or falsify the circle by inlier counting:</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float cPerc = verifyCircle(dt,center,radius, inlierSet);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // update best circle information if necessary</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(cPerc &gt;= bestCirclePercentage)</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(radius &gt;= minRadius)</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bestCirclePercentage = cPerc;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bestCircleRadius = radius;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bestCircleCenter = center;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; }</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; // draw if good circle was found</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; if(bestCirclePercentage &gt;= minCirclePercentage)</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(bestCircleRadius &gt;= minRadius);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cv::circle(color, bestCircleCenter,bestCircleRadius, cv::Scalar(255,255,0),1);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cv::imshow("output",color);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cv::imshow("mask",mask);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cv::waitKey(0);</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;">&nbsp;</p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;return 0;</span></p>  <p align="left" style="background: #eff0f1; vertical-align: baseline;"><span style="font-size: 12.0pt;font-family:Consolas;color:#242729;">&nbsp;&nbsp;&nbsp; }</span></p>  <p>&nbsp;</p>  <pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">float verifyCircle(cv::Mat dt, cv::Point2f center, float radius, std::vector&lt;cv::Point2f&gt; &amp; inlierSet)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">{</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> unsigned int counter = 0;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> unsigned int inlier = 0;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> float minInlierDist = 2.0f;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> float maxInlierDistMax = 100.0f;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> float maxInlierDist = radius/25.0f;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> if(maxInlierDist&lt;minInlierDist) maxInlierDist = minInlierDist;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> if(maxInlierDist&gt;maxInlierDistMax) maxInlierDist = maxInlierDistMax;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> // choose samples along the circle and count inlier percentage</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> for(float t =0; t&lt;2*3.14159265359f; t+= 0.05f)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> {</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; counter++;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; float cX = radius*cos(t) + center.x;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; float cY = radius*sin(t) + center.y;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; if(cX &lt; dt.cols)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; if(cX &gt;= 0)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; if(cY &lt; dt.rows)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; if(cY &gt;= 0)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; if(dt.at&lt;float&gt;(cY,cX) &lt; maxInlierDist)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; {</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inlier++;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inlierSet.push_back(cv::Point2f(cX,cY));</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; }</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> }</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> return (float)inlier/float(counter);</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">}</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">inline void getCircle(cv::Point2f&amp; p1,cv::Point2f&amp; p2,cv::Point2f&amp; p3, cv::Point2f&amp; center, float&amp; radius)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">{</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float x1 = p1.x;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float x2 = p2.x;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float x3 = p3.x;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float y1 = p1.y;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float y2 = p2.y;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; float y3 = p3.y;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; // PLEASE CHECK FOR TYPOS IN THE FORMULA :)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; center.x = (x1*x1+y1*y1)*(y2-y3) + (x2*x2+y2*y2)*(y3-y1) + (x3*x3+y3*y3)*(y1-y2);</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; center.x /= ( 2*(x1*(y2-y3) - y1*(x2-x3) + x2*y3 - x3*y2) );</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; center.y = (x1*x1 + y1*y1)*(x3-x2) + (x2*x2+y2*y2)*(x1-x3) + (x3*x3 + y3*y3)*(x2-x1);</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; center.y /= ( 2*(x1*(y2-y3) - y1*(x2-x3) + x2*y3 - x3*y2) );</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp; radius = sqrt((center.x-x1)*(center.x-x1) + (center.y-y1)*(center.y-y1));</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">}</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">std::vector&lt;cv::Point2f&gt; getPointPositions(cv::Mat binaryImage)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">{</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> std::vector&lt;cv::Point2f&gt; pointPositions;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> for(unsigned int y=0; y&lt;binaryImage.rows; ++y)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> {</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; //unsigned char* rowPtr = binaryImage.ptr&lt;unsigned char&gt;(y);</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; for(unsigned int x=0; x&lt;binaryImage.cols; ++x)</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; {</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if(rowPtr[x] &gt; 0) pointPositions.push_back(cv::Point2i(x,y));</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(binaryImage.at&lt;unsigned char&gt;(y,x) &gt; 0) pointPositions.push_back(cv::Point2f(x,y));</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">&nbsp;&nbsp;&nbsp;&nbsp; }</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> }</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code>&nbsp;</code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"> return pointPositions;</span></code></pre><pre style="background:#EFF0F1;vertical-align:baseline"><code><span style="font-size: 10pt; font-family: Consolas; color: #242729; border: 1pt none windowtext; padding: 0cm; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;">}</span></code></pre>  <p>&nbsp;</p><div data-questionid="26222525" id="question" style="margin: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 13px; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; vertical-align: baseline; clear: both; color: #242729; background-color: #ffffff;"></div></div><img src ="http://www.cppblog.com/zmj/aggbug/215303.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-10-17 13:39 <a href="http://www.cppblog.com/zmj/archive/2017/10/17/215303.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Geometric Transformations of Images</title><link>http://www.cppblog.com/zmj/archive/2017/10/12/215293.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 12 Oct 2017 07:28:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/10/12/215293.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215293.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/10/12/215293.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215293.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215293.html</trackback:ping><description><![CDATA[<div>https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html<br /><br /><div style="margin: 0px; padding: 0.5em 20px 20px; font-family: &quot;Open Sans&quot;, &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Geneva, Verdana, sans-serif; background-color: #ffffff;"><div id="geometric-transformations-of-images"><div id="goals"><h2>Goals<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#goals" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h2><blockquote><ul><li style="text-align: justify; line-height: 18.2px; margin: 0px;">Learn to apply different geometric transformation to images like translation, rotation, affine transformation etc.</li><li style="text-align: justify; line-height: 18.2px; margin: 0px;">You will see these functions:&nbsp;<strong>cv2.getPerspectiveTransform</strong></li></ul></blockquote></div><div id="transformations"><h2>Transformations<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#transformations" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h2><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">OpenCV provides two transformation functions,&nbsp;<strong>cv2.warpAffine</strong>&nbsp;and&nbsp;<strong>cv2.warpPerspective</strong>, with which you can have all kinds of transformations.&nbsp;<strong>cv2.warpAffine</strong>&nbsp;takes a 2x3 transformation matrix while&nbsp;<strong>cv2.warpPerspective</strong>&nbsp;takes a 3x3 transformation matrix as input.</p><div id="scaling"><h3>Scaling<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#scaling" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h3><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">Scaling is just resizing of the image. OpenCV comes with a function&nbsp;<strong>cv2.resize()</strong>&nbsp;for this purpose. The size of the image can be specified manually, or you can specify the scaling factor. Different interpolation methods are used. Preferable interpolation methods are&nbsp;<strong>cv2.INTER_AREA</strong>&nbsp;for shrinking and&nbsp;<strong>cv2.INTER_CUBIC</strong>&nbsp;(slow) &amp;&nbsp;<strong>cv2.INTER_LINEAR</strong>&nbsp;for zooming. By default, interpolation method used is&nbsp;<strong>cv2.INTER_LINEAR</strong>&nbsp;for all resizing purposes. You can resize an input image either of following methods:</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; font-size: 13px; letter-spacing: 0.015em; line-height: 15.6px; padding: 0.5em; border: 1px solid #cccccc; border-radius: 2px; background-color: #f8f8f8;"><span style="color: #007020; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">cv2</span> <span style="color: #007020; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">numpy</span> <span style="color: #007020; font-weight: bold;">as</span> <span style="color: #0e84b5; font-weight: bold;">np</span>  img <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>imread(<span style="color: #4070a0;">'messi5.jpg'</span>)  res <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>resize(img,<span style="color: #007020;">None</span>,fx<span style="color: #666666;">=</span><span style="color: #208050;">2</span>, fy<span style="color: #666666;">=</span><span style="color: #208050;">2</span>, interpolation <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>INTER_CUBIC)  <span style="color: #408090; font-style: italic;">#OR</span>  height, width <span style="color: #666666;">=</span> img<span style="color: #666666;">.</span>shape[:<span style="color: #208050;">2</span>] res <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>resize(img,(<span style="color: #208050;">2</span><span style="color: #666666;">*</span>width, <span style="color: #208050;">2</span><span style="color: #666666;">*</span>height), interpolation <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>INTER_CUBIC) </pre></div></div></div><div id="translation"><h3>Translation<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#translation" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h3><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">Translation is the shifting of object&#8217;s location. If you know the shift in (x,y) direction, let it be&nbsp;<img src="https://docs.opencv.org/3.0-beta/_images/math/a6859af138f75736f824df53bb209e9b3c92744e.png" alt="(t_x,t_y)" style="border: 0px; max-width: 100%; vertical-align: middle;" />, you can create the transformation matrix&nbsp;<img src="https://docs.opencv.org/3.0-beta/_images/math/dc1c0d2fcf66626959526f7b516b50e6d132ee65.png" alt="\textbf{M}" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;as follows:</p><div><p style="margin: 10px 0px; text-align: center; line-height: 18.2px;"><img src="https://docs.opencv.org/3.0-beta/_images/math/43184a6b18ed02f11b98422bfb54ab3e48f8c08b.png" alt="M = \begin{bmatrix} 1 &amp; 0 &amp; t_x \\ 0 &amp; 1 &amp; t_y  \end{bmatrix}" style="border: 0px; max-width: 100%;" /></p></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">You can take make it into a Numpy array of type&nbsp;<tt literal"="" style="font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; min-width: 780px; max-width: 1080px; color: #003048; padding: 1px;">np.float32</tt>&nbsp;and pass it into&nbsp;<strong>cv2.warpAffine()</strong>&nbsp;function. See below example for a shift of (100,50):</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; font-size: 13px; letter-spacing: 0.015em; line-height: 15.6px; padding: 0.5em; border: 1px solid #cccccc; border-radius: 2px; background-color: #f8f8f8;"><span style="color: #007020; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">cv2</span> <span style="color: #007020; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">numpy</span> <span style="color: #007020; font-weight: bold;">as</span> <span style="color: #0e84b5; font-weight: bold;">np</span>  img <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>imread(<span style="color: #4070a0;">'messi5.jpg'</span>,<span style="color: #208050;">0</span>) rows,cols <span style="color: #666666;">=</span> img<span style="color: #666666;">.</span>shape  M <span style="color: #666666;">=</span> np<span style="color: #666666;">.</span>float32([[<span style="color: #208050;">1</span>,<span style="color: #208050;">0</span>,<span style="color: #208050;">100</span>],[<span style="color: #208050;">0</span>,<span style="color: #208050;">1</span>,<span style="color: #208050;">50</span>]]) dst <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>warpAffine(img,M,(cols,rows))  cv2<span style="color: #666666;">.</span>imshow(<span style="color: #4070a0;">'img'</span>,dst) cv2<span style="color: #666666;">.</span>waitKey(<span style="color: #208050;">0</span>) cv2<span style="color: #666666;">.</span>destroyAllWindows() </pre></div></div><div warning"="" style="margin-top: 10px; margin-bottom: 10px; padding: 7px; background-color: #ffe4e4; border: 1px solid #ff6666;"><p admonition-title"="" style="margin: 1em 10px 1em 0px; font-weight: bold; display: inline; text-align: justify; line-height: 18.2px;">Warning</p>&nbsp;<p style="margin: 1em 0px; text-align: justify; line-height: 18.2px; display: inline;">Third argument of the&nbsp;<strong>cv2.warpAffine()</strong>&nbsp;function is the size of the output image, which should be in the form of&nbsp;<strong>(width, height)</strong>. Remember width = number of columns, and height = number of rows.</p></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">See the result below:</p><blockquote><img alt="Translation" src="https://docs.opencv.org/3.0-beta/_images/translation.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto;" /></blockquote></div><div id="rotation"><h3>Rotation<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#rotation" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h3><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">Rotation of an image for an angle&nbsp;<img src="https://docs.opencv.org/3.0-beta/_images/math/f324df69016bcdbbc6a6b842f7cdb42d6b305049.png" alt="\theta" style="border: 0px; max-width: 100%; vertical-align: middle;" />&nbsp;is achieved by the transformation matrix of the form</p><div><p style="margin: 10px 0px; text-align: center; line-height: 18.2px;"><img src="https://docs.opencv.org/3.0-beta/_images/math/bd671e57f9f5c4cd5fdd34fbd3244e7e6013354a.png" alt="M = \begin{bmatrix} cos\theta &amp; -sin\theta \\ sin\theta &amp; cos\theta   \end{bmatrix}" style="border: 0px; max-width: 100%;" /></p></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">But OpenCV provides scaled rotation with adjustable center of rotation so that you can rotate at any location you prefer. Modified transformation matrix is given by</p><div><p style="margin: 10px 0px; text-align: center; line-height: 18.2px;"><img src="https://docs.opencv.org/3.0-beta/_images/math/204bc3352d828699da3dac0a305a9ae60dd6d1f8.png" alt="\begin{bmatrix} \alpha &amp;  \beta &amp; (1- \alpha )  \cdot center.x -  \beta \cdot center.y \\ - \beta &amp;  \alpha &amp;  \beta \cdot center.x + (1- \alpha )  \cdot center.y \end{bmatrix}" style="border: 0px; max-width: 100%;" /></p></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">where:</p><div><p style="margin: 10px 0px; text-align: center; line-height: 18.2px;"><img src="https://docs.opencv.org/3.0-beta/_images/math/5af08a64fd8649524749aa2dbaf70f3f0c2cfb40.png" alt="\begin{array}{l} \alpha =  scale \cdot \cos \theta , \\ \beta =  scale \cdot \sin \theta \end{array}" style="border: 0px; max-width: 100%;" /></p></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">To find this transformation matrix, OpenCV provides a function,&nbsp;<strong>cv2.getRotationMatrix2D</strong>. Check below example which rotates the image by 90 degree with respect to center without any scaling.</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; font-size: 13px; letter-spacing: 0.015em; line-height: 15.6px; padding: 0.5em; border: 1px solid #cccccc; border-radius: 2px; background-color: #f8f8f8;">img <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>imread(<span style="color: #4070a0;">'messi5.jpg'</span>,<span style="color: #208050;">0</span>) rows,cols <span style="color: #666666;">=</span> img<span style="color: #666666;">.</span>shape  M <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>getRotationMatrix2D((cols<span style="color: #666666;">/</span><span style="color: #208050;">2</span>,rows<span style="color: #666666;">/</span><span style="color: #208050;">2</span>),<span style="color: #208050;">90</span>,<span style="color: #208050;">1</span>) dst <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>warpAffine(img,M,(cols,rows)) </pre></div></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">See the result:</p><blockquote><img alt="Rotation of Image" src="https://docs.opencv.org/3.0-beta/_images/rotation.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto;" /></blockquote></div><div id="affine-transformation"><h3>Affine Transformation<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#affine-transformation" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h3><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">In affine transformation, all parallel lines in the original image will still be parallel in the output image. To find the transformation matrix, we need three points from input image and their corresponding locations in output image. Then&nbsp;<strong>cv2.getAffineTransform</strong>&nbsp;will create a 2x3 matrix which is to be passed to&nbsp;<strong>cv2.warpAffine</strong>.</p><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">Check below example, and also look at the points I selected (which are marked in Green color):</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; font-size: 13px; letter-spacing: 0.015em; line-height: 15.6px; padding: 0.5em; border: 1px solid #cccccc; border-radius: 2px; background-color: #f8f8f8;">img <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>imread(<span style="color: #4070a0;">'drawing.png'</span>) rows,cols,ch <span style="color: #666666;">=</span> img<span style="color: #666666;">.</span>shape  pts1 <span style="color: #666666;">=</span> np<span style="color: #666666;">.</span>float32([[<span style="color: #208050;">50</span>,<span style="color: #208050;">50</span>],[<span style="color: #208050;">200</span>,<span style="color: #208050;">50</span>],[<span style="color: #208050;">50</span>,<span style="color: #208050;">200</span>]]) pts2 <span style="color: #666666;">=</span> np<span style="color: #666666;">.</span>float32([[<span style="color: #208050;">10</span>,<span style="color: #208050;">100</span>],[<span style="color: #208050;">200</span>,<span style="color: #208050;">50</span>],[<span style="color: #208050;">100</span>,<span style="color: #208050;">250</span>]])  M <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>getAffineTransform(pts1,pts2)  dst <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>warpAffine(img,M,(cols,rows))  plt<span style="color: #666666;">.</span>subplot(<span style="color: #208050;">121</span>),plt<span style="color: #666666;">.</span>imshow(img),plt<span style="color: #666666;">.</span>title(<span style="color: #4070a0;">'Input'</span>) plt<span style="color: #666666;">.</span>subplot(<span style="color: #208050;">122</span>),plt<span style="color: #666666;">.</span>imshow(dst),plt<span style="color: #666666;">.</span>title(<span style="color: #4070a0;">'Output'</span>) plt<span style="color: #666666;">.</span>show() </pre></div></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">See the result:</p><blockquote><img alt="Affine Transformation" src="https://docs.opencv.org/3.0-beta/_images/affine.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto;" /></blockquote></div><div id="perspective-transformation"><h3>Perspective Transformation<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#perspective-transformation" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h3><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">For perspective transformation, you need a 3x3 transformation matrix. Straight lines will remain straight even after the transformation. To find this transformation matrix, you need 4 points on the input image and corresponding points on the output image. Among these 4 points, 3 of them should not be collinear. Then transformation matrix can be found by the function&nbsp;<strong>cv2.getPerspectiveTransform</strong>. Then apply&nbsp;<strong>cv2.warpPerspective</strong>&nbsp;with this 3x3 transformation matrix.</p><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">See the code below:</p><div><div style="background: #eeffcc;"><pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, monospace; font-size: 13px; letter-spacing: 0.015em; line-height: 15.6px; padding: 0.5em; border: 1px solid #cccccc; border-radius: 2px; background-color: #f8f8f8;">img <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>imread(<span style="color: #4070a0;">'sudokusmall.png'</span>) rows,cols,ch <span style="color: #666666;">=</span> img<span style="color: #666666;">.</span>shape  pts1 <span style="color: #666666;">=</span> np<span style="color: #666666;">.</span>float32([[<span style="color: #208050;">56</span>,<span style="color: #208050;">65</span>],[<span style="color: #208050;">368</span>,<span style="color: #208050;">52</span>],[<span style="color: #208050;">28</span>,<span style="color: #208050;">387</span>],[<span style="color: #208050;">389</span>,<span style="color: #208050;">390</span>]]) pts2 <span style="color: #666666;">=</span> np<span style="color: #666666;">.</span>float32([[<span style="color: #208050;">0</span>,<span style="color: #208050;">0</span>],[<span style="color: #208050;">300</span>,<span style="color: #208050;">0</span>],[<span style="color: #208050;">0</span>,<span style="color: #208050;">300</span>],[<span style="color: #208050;">300</span>,<span style="color: #208050;">300</span>]])  M <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>getPerspectiveTransform(pts1,pts2)  dst <span style="color: #666666;">=</span> cv2<span style="color: #666666;">.</span>warpPerspective(img,M,(<span style="color: #208050;">300</span>,<span style="color: #208050;">300</span>))  plt<span style="color: #666666;">.</span>subplot(<span style="color: #208050;">121</span>),plt<span style="color: #666666;">.</span>imshow(img),plt<span style="color: #666666;">.</span>title(<span style="color: #4070a0;">'Input'</span>) plt<span style="color: #666666;">.</span>subplot(<span style="color: #208050;">122</span>),plt<span style="color: #666666;">.</span>imshow(dst),plt<span style="color: #666666;">.</span>title(<span style="color: #4070a0;">'Output'</span>) plt<span style="color: #666666;">.</span>show() </pre></div></div><p style="margin: 1em 0px; text-align: justify; line-height: 18.2px;">Result:</p><blockquote><img alt="Perspective Transformation" src="https://docs.opencv.org/3.0-beta/_images/perspective.jpg" style="border: 0px; max-width: 100%; text-align: center; display: block; margin-left: auto; margin-right: auto;" /></blockquote></div></div><div id="additional-resources"><h2>Additional Resources<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#additional-resources" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h2><ol simple"="" style="list-style-position: initial; list-style-image: initial;"><li style="text-align: justify; line-height: 18.2px; margin-top: 1em; margin-bottom: 1em;">&#8220;Computer Vision: Algorithms and Applications&#8221;, Richard Szeliski</li></ol></div><div id="exercises"><h2>Exercises<a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#exercises" title="Permalink to this headline" style="visibility: hidden; font-size: 12px; margin-left: 6px; padding: 0px 4px; float: right; color: #0a507a !important; text-decoration-line: none !important;"></a></h2></div></div></div><div style="padding: 20px 20px 30px; border-top: 1px solid #002e50; font-family: &quot;Open Sans&quot;, &quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Geneva, Verdana, sans-serif; background-color: #ffffff;"><h2>Help and Feedback</h2>You did not find what you were looking for?<ul><li>Ask a question on the&nbsp;<a href="http://answers.opencv.org/" style="color: #2878a2; text-decoration-line: none; font-weight: bold;">Q&amp;A forum</a>.</li><li>If you think something is missing or wrong in the documentation, please file a&nbsp;<a href="http://code.opencv.org/" style="color: #68b8c2; text-decoration-line: none; font-weight: bold;">bug report</a>.</li></ul></div></div><img src ="http://www.cppblog.com/zmj/aggbug/215293.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-10-12 15:28 <a href="http://www.cppblog.com/zmj/archive/2017/10/12/215293.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Blob Detection Using OpenCV ( Python, C++ )</title><link>http://www.cppblog.com/zmj/archive/2017/10/11/215289.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Wed, 11 Oct 2017 07:20:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/10/11/215289.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215289.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/10/11/215289.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215289.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215289.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://www.learnopencv.com/blob-detection-using-opencv-python-c/FEBRUARY 17, 2015&nbsp;BY&nbsp;SATYA MALLICKThis tutorial explains simple blob detection using OpenCV.What is a Blob ?A Blob is a group...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/10/11/215289.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215289.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-10-11 15:20 <a href="http://www.cppblog.com/zmj/archive/2017/10/11/215289.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Explained: How does a soccer ball swerve?</title><link>http://www.cppblog.com/zmj/archive/2017/10/10/215285.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Tue, 10 Oct 2017 09:32:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/10/10/215285.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215285.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/10/10/215285.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215285.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215285.html</trackback:ping><description><![CDATA[<div>https://news.mit.edu/2014/explained-how-does-soccer-ball-swerve-0617<br /><br /><header style="color: #222222; font-family: nimbus-sans, sans-serif, Arial, Verdana;"><div style="padding-top: 25px; padding-bottom: 25px;"><p id="article-summary" style="margin: 0px; padding: 0px; line-height: 1.2; font-size: 1.875em;"><span itemprop="description">The smoothness of a ball&#8217;s surface &#8212; in addition to playing technique &#8212; is a critical factor.<br /><br /></span></p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">It happens every four years: The World Cup begins and some of the world&#8217;s most skilled players carefully line up free kicks, take aim &#8212; and shoot way over the goal.</p><p style="margin: 0px; padding: 0px; line-height: 1.2; font-size: 1.875em;"><span itemprop="description"></span></p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">The players are all trying to bend the ball into a top corner of the goal, often over a wall of defensive players and away from the reach of a lunging goalkeeper. Yet when such shots go awry in the World Cup, a blame game usually sets in. Players, fans, and pundits all suggest that the new official tournament ball, introduced every four years, is the cause.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">Many of the people saying that may be seeking excuses. And yet scholars do think that subtle variations among soccer balls affect how they fly. Specifically, researchers increasingly believe that one variable really does differentiate soccer balls: their surfaces. It is harder to control a smoother ball, such as the much-discussed &#8220;Jabulani&#8221; used at the 2010 World Cup. The new ball used at this year&#8217;s tournament in Brazil, the &#8220;Brazuca,&#8221; has seams that are over 50 percent longer, one factor that makes the ball less smooth and apparently more predictable in flight.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">&#8220;The details of the flow of air around the ball are complicated, and in particular they depend on how rough the ball is,&#8221; says John Bush, a professor of applied mathematics at MIT and the author of a recently published article about the aerodynamics of soccer balls. &#8220;If the ball is perfectly smooth, it bends the wrong way.&#8221;</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">By the &#8220;wrong way,&#8221; Bush means that two otherwise similar balls struck precisely the same way, by the same player, can actually curve in opposite directions, depending on the surface of those balls. Sound surprising?</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">Magnus, meet Messi</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">It may, because the question of how a spinning ball curves in flight would seem to have a textbook answer: the Magnus Effect. This phenomenon was first described by Isaac Newton, who noticed that in tennis, topspin causes a ball to dip, while backspin flattens out its trajectory. A curveball in baseball is another example from sports: A pitcher throws the ball with especially tight topspin, or sidespin rotation, and the ball curves in the direction of the spin.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">In soccer, the same thing usually occurs with free kicks, corner kicks, crosses from the wings, and other kinds of passes or shots: The player kicking the ball applies spin during contact, creating rotation that makes the ball curve. For a right-footed player, the &#8220;natural&#8221; technique is to brush toward the outside of the ball, creating a shot or pass with a right-to-left hook; a left-footed player&#8217;s &#8220;natural&#8221; shot will curl left-to-right.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">So far, so intuitive: Soccer fans can probably conjure the image of stars like Lionel Messi, Andrea Pirlo, or Marta, a superstar of women&#8217;s soccer, doing this. But this kind of shot &#8212; the Brazilians call it the &#8220;chute de curva&#8221; &#8212; depends on a ball with some surface roughness. Without that, this classic piece of the soccer player&#8217;s arsenal goes away, as Bush points out in his article, &#8220;The Aerodynamics of the Beautiful Game,&#8221; from the volume &#8220;Sports Physics,&#8221; published by Les Editions de L&#8217;Ecole Polytechnique in France.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">&#8220;The fact is that the Magnus Effect can change sign,&#8221; Bush says. &#8220;People don&#8217;t generally appreciate that fact.&#8221; Given an absolutely smooth ball, the direction of the curve may reverse: The same kicking motion will not produce a shot or pass curving in a right-to-left direction, but in a left-to-right direction.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;"><img src="https://newsoffice.mit.edu/sites/mit.edu.newsoffice/files/images/2014/MITnews_ScienceSoccerVideo.gif" style="vertical-align: middle; border: 0px; height: auto; max-width: 100%;"  alt="" /><br /><span style="font-size: 11px;"><em>In the above animation, a player strikes two balls: one smooth, and one with an elastic band wrapped around its equator. Both balls are struck with his instep so as to impart a counterclockwise spin. However, the smooth ball bends in the opposite direction as the banded ball. The presence of the elastic band changes the boundary layer on the ball surface from &#8220;laminar" to &#8220;turbulent." This is why all soccer balls have some surface roughness; otherwise, they would bend in the opposite direction as the ball's initial rotation. (Courtesy of the researchers.</em>)</span></p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">Why is this? Bush says it is due to the way the surface of the ball creates motion at the &#8220;boundary layer&#8221; between the spinning ball and the air. The rougher the ball, the easier it is to create the textbook version of the Magnus Effect, with a &#8220;positive&#8221; sign: The ball curves in the expected direction.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">&#8220;The boundary layer can be laminar, which is smoothly flowing, or turbulent, in which case you have eddies,&#8221; Bush says. &#8220;The boundary layer is changing from laminar to turbulent at different spots according to how quickly the ball is spinning. Where that transition arises is influenced by the surface roughness, the stitching of the ball. If you change the patterning of the panels, the transition points move, and the pressure distribution changes.&#8221; The Magnus Effect can then have a &#8220;negative&#8221; sign.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">From Brazil: The &#8220;dove without wings&#8221;</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">If the reversing of the Magnus Effect has largely eluded detection, of course, that is because soccer balls are not absolutely smooth &#8212;&nbsp;but they have been moving in that direction over the decades. While other sports, such as baseball and cricket, have strict rules about the stitching on the ball, soccer does not, and advances in technology have largely given balls sleeker, smoother designs &#8212; until the introduction of the Brazuca, at least.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">There is actually a bit more to the story, however, since sometimes players will strike balls so as to give them very little spin &#8212; the equivalent of a knuckleball in baseball. In this case, the ball flutters unpredictably from side to side. Brazilians have a name for this: the &#8220;pombo sem asa,&#8221; or &#8220;dove without wings.&#8221;</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">In this case, Bush says, &#8220;The peculiar motion of a fluttering free kick arises because the points of boundary-layer transition are different on opposite sides of the ball.&#8221; Because the ball has no initial spin, the motion of the surrounding air has more of an effect on the ball&#8217;s flight: &#8220;A ball that&#8217;s knuckling &#8230; is moving in response to the pressure distribution, which is constantly changing.&#8221; Indeed, a free kick Pirlo took in Italy&#8217;s match against England on Saturday, which fooled the goalkeeper but hit the crossbar, demonstrated this kind of action.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">Bush&#8217;s own interest in the subject arises from being a lifelong soccer player and fan &#8212; the kind who, sitting in his office, will summon up clips of the best free-kick takers he&#8217;s seen. These include Juninho Pernambucano, a Brazilian midfielder who played at the 2006 World Cup, and Sinisa Mihajlovic, a Serbian defender of the 1990s.</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">And Bush happily plays a clip of Brazilian fullback Roberto Carlos&#8217; famous free kick from a 1997 match against France, where the player used the outside of his left foot &#8212; but deployed the &#8220;positive&#8221; Magnus Effect &#8212; to score on an outrageously bending free kick. &nbsp;</p><p style="margin: 0px; padding: 0px 0px 25px; line-height: 1.6; font-size: 15.75px; background-color: #ffffff;">&#8220;That was by far the best free kick ever taken,&#8221; Bush says. Putting on his professor&#8217;s hat for a moment, he adds: &#8220;I think it&#8217;s important to encourage people to try to understand everything. Even in the most commonplace things, there is subtle and interesting physics.&#8221;</p></div></header></div><img src ="http://www.cppblog.com/zmj/aggbug/215285.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-10-10 17:32 <a href="http://www.cppblog.com/zmj/archive/2017/10/10/215285.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Throwing a football, Part II</title><link>http://www.cppblog.com/zmj/archive/2017/09/24/215261.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Sun, 24 Sep 2017 05:32:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/09/24/215261.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215261.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/09/24/215261.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215261.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215261.html</trackback:ping><description><![CDATA[<div>https://www.wired.com/2008/12/throwing-a-football-part-ii/</div><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;"><a href="https://www.wired.com/wiredscience/2008/12/what-angle-should-you-throw-a-football-for-maximum-range/" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;"><span tabindex="-1" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: ff-oxide-solid-web, OxideSolidOT, oxidesolidot-webfont, HelveticaNeue-Bold, &quot;Helvetica Neue Bold&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, sans-serif; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 14px;">IN PART I&nbsp;</span><font face="inherit"><span style="box-sizing: border-box; border-bottom: 3px solid #b4e7f8; border-top-style: initial; border-right-style: initial; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; outline-color: initial; outline-style: initial; font-weight: inherit; font-style: inherit; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">of this post</span></font></a>, I talked about the basics of projectile motion with no air resistance. Also in that post, I showed that (without air resistance) the angle to throw a ball for maximum range is 45 degrees. When throwing a football, there is some air resistance this means that 45 degree is not necessarily the angle for the greatest range. Well, can&#8217;t I just do the same thing as before? It turns out that it is a significantly different problem when air resistance is added. Without air resistance, the acceleration was constant. Not so now, my friend.</p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">The problem is that air resistance depends on the velocity of the object. Search your feelings, you know this to be true. When you are driving (or riding) in a car and you stick your hand out the window, you can feel the air pushing against your hand. The faster the car moves, the greater this force. The air resistance force depends on:</p><ul style="box-sizing: border-box; margin: 0px 0px 14px 20px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; list-style-position: outside; list-style-image: initial; background-color: #ffffff;"><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Velocity of the object. The typical model used for objects like a football would depend on the direction and the square of the magnitude of the velocity.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">The density of air.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">The cross sectional area of the object. Compare putting an open hand out the car window to a closed fist out the car window.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Some air drag coefficient. Imagine a cone and a flat disk, both with the same radius (and thus same cross sectional area). These two objects would have different air resistances due to the shape, this is the coefficient of drag (also called other things I am sure).</li></ul><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">So, since the air force depends on the velocity, it will not be a constant acceleration. Kinematic equations won&#8217;t really work. To easily solve this problem,&nbsp;<a href="http://scienceblogs.com/dotphysics/2008/10/basics-numerical-calculations/" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">I will use numerical methods.</a>&nbsp;The basic idea in numerical calculations is to break the problem into a whole bunch of little steps. During these small steps, the velocity does not change much so that I can &#8220;pretend&#8221; like the acceleration is constant. Here is a diagram of the forces on the ball while in the air.</p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;"><a href="https://www.wired.com/images_blogs/wiredscience/2008/12/air-resistance-diagram-1.jpg" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;"><img size-full=""  wp-image-524741"="" alt="air-resistance-diagram-1" src="https://www.wired.com/images_blogs/wiredscience/2008/12/air-resistance-diagram-1.jpg" width="211" height="217" style="box-sizing: border-box; margin: 64px auto; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: block; height: auto; max-width: 100%;" /></a></p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">Before I go any further, I would like to say that there has been some &#8220;stuff&#8221; done on throwing a football before &#8211; and they probably do a better job than this post. Here are a few references (especially with more detailed discussion about the coefficient of drag for a spinning football):</p><ul style="box-sizing: border-box; margin: 0px 0px 14px 20px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; list-style-position: outside; list-style-image: initial; background-color: #ffffff;"><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;"><a href="http://hypertextbook.com/facts/2000/KendelBell.shtml" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">http://hypertextbook.com/facts/2000/KendelBell.shtml</a>&nbsp;&#8211; some data on footballs</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;"><a rel="nofollow" href="http://www.amazon.com/dp/157954911X/?tag=w050b-20" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">Football Physics: The Science of the Game: Timothy Gay, Bill Belichick (Amazon)</a>. I also found an online version of this at&nbsp;<a href="http://books.google.com/books?hl=en&amp;id=lC-mHjvKpRQC&amp;dq=football+physics+by+timothy+james+gay,+bill+belichick&amp;printsec=frontcover&amp;source=web&amp;ots=d7klSWx1cT&amp;sig=5iaxA4S_LILks5asHSgImCpqYg4&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">http://books.google.com</a></li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;"><a href="http://dx.doi.org/10.1119/1.1578065" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">The drag force on an American Football &#8211; R. Watts and G. Moore</a>. An article in the American Journal of Physics (2003) that measured the coefficient of drag of a spinning football to be around 0.05 to 0.06.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;"><a href="http://books.google.com/books?id=CPosYIEgag8C&amp;pg=PA263&amp;lpg=PA263&amp;dq=brancazio+the+physics+of+kicking+a+football&amp;source=bl&amp;ots=-yrJr2u4d3&amp;sig=H0_B-zaGDkPKoK6_NuFrngl5lk0&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result#PPA273,M1" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;">The Physics of sports: Volume One &#8211; by Angelo Armenti.</a>This has some stuff on physics AND it&#8217;s on books.google &#8211; bonus!</li></ul><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">And now for some assumptions:</p><ul style="box-sizing: border-box; margin: 0px 0px 14px 20px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; list-style-position: outside; list-style-image: initial; background-color: #ffffff;"><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">I hereby assume that the air resistance is proportional to the square of the magnitude of the velocity of the object.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">The orientation of the football is such that the coefficient of drag is constant. This may not actually be true. Imagine if the ball were thrown and spinning with the axis parallel to the ground. If the axis stayed parallel to the ground, for part of the motion the direction of motion would not be along the axis. Get it?</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Ignore aerodynamic lift effects.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Mass of the ball is .42 kg.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">The density of air is 1.2 kg/m<span style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; font-size: 13.5px; vertical-align: baseline; line-height: 0; position: relative; top: -0.5em;">3</span>.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">The coefficient of drag for the football is 0.05 to 0.14</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Typical initial speed of a thrown football is around 20 m/s.</li></ul><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">And finally, here is the recipie for my numerical calculation (in vpython of course):</p><ul style="box-sizing: border-box; margin: 0px 0px 14px 20px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; list-style-position: outside; list-style-image: initial; background-color: #ffffff;"><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Set up initial conditions</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Set the angle of the throw</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Calculate the new position assuming a constant velocity.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Calculate the new momentum (and thus velocity) assuming a constant force.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Calculate the force (it changes when the velocity changes)</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Increase the time.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Keep doing the above until the ball gets back to y=0 m.</li><li style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline;">Change the angle and do all the above again.</li></ul><h3>The answer</h3><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">First, I ran the program with an initial velocity of 20 m/s. Here is the data:</p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;"><a href="https://www.wired.com/images_blogs/wiredscience/2008/12/rangeplot2.jpg" style="box-sizing: border-box; margin: 0px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; box-shadow: #b4e7f8 0px -4px 0px inset;"><img size-full=""  wp-image-524751"="" alt="rangeplot2" src="https://www.wired.com/images_blogs/wiredscience/2008/12/rangeplot2.jpg" width="490" height="289" style="box-sizing: border-box; margin: 64px auto; padding: 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: block; height: auto; max-width: 100%;" /></a></p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">At 35 degrees, this gives a distance of 23 meters (25 yards). This doesn&#8217;t seem right. I know a quarterback can throw farther than that. What if I change the coefficient to 0.05? Then the greatest angle is closer to 40 degrees and it goes 28 meters. Still seems low (think Doug Flutie). What about with no air resistance? Then it goes 41 meters (at 45 degrees). So, here is the Doug Flutie throw.</p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;"></p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">From the video, it looks like he threw the ball from the 36ish yard line to about the 2 yard line. This would be 62 yards (56.7 meters). I am going to assume a coefficient of 0.07 (randomly). So, what initial speed will get this far? If I put in an initial velocity of 33 m/s, the ball will go 55.7 meters at an angle of 35 degrees.</p><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; outline: 0px; font-family: &quot;Exchange SSm 4r&quot;, ExchangeWeb-Roman, Georgia, serif; font-size: 18px; vertical-align: baseline; background-color: #ffffff;">Really the thing that amazes me is that someone (not me) can throw a ball that far and essentially get it where they want it. Even if they are only sometimes successful, it is still amazing. How is it that humans can throw things somewhat accurately? We obviously do not do projectile motion calculations in our head &#8211; or maybe we do?</p><a skip-to-text-link="" focusable=""  bg-white"="" href="https://www.wired.com/2008/12/throwing-a-football-part-ii/#start-of-content" style="box-sizing: border-box; margin: -1px; padding: 0px; border-width: 0px 0px 3px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: #b4e7f8; border-left-color: initial; border-image: initial; outline: 0px; font-family: brandon-text-wired, brandon-text, brandon-grotesque-1, brandon-grotesque-2, BrandonText-Bold, &quot;Gill Sans&quot;, HelveticaNeue-Bold, &quot;Helvetica Neue Bold&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, sans-serif; font-size: 18px; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; clip: rect(0px 0px 0px 0px); height: 1px; overflow: hidden; position: absolute; width: 1px; background-color: #ffffff; box-shadow: #b4e7f8 0px -4px 0px inset;">Go Back to Top. Skip To: Start of Article.</a><ul id="article-tags" aria-label="Tags for this Story." center="" metadata="" marg-t-50="" pad-b-med="" border-t=""  border-b"="" data-js="articleTags" style="box-sizing: border-box; margin-top: 50px; margin-bottom: 0px; margin-left: 20px; padding: 0px 0px 16px; border-width: 1px 0px; border-top-style: solid; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: #cccccc; border-right-color: initial; border-bottom-color: #cccccc; border-left-color: initial; border-image: initial; outline: 0px; font-family: ff-oxide-solid-web, OxideSolidOT, oxidesolidot-webfont, HelveticaNeue-Bold, &quot;Helvetica Neue Bold&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;Lucida Grande&quot;, sans-serif; font-size: 10px; vertical-align: baseline; list-style-position: outside; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(0, 0, 0, 0.6); line-height: 13px; z-index: 1; transition: color 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); background-color: #ffffff; margin-right: auto !important; list-style-image: initial !important;"><li pad-t-med="" pad-r-sm="" no-marg=""  acceleration"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/acceleration/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">ACCELERATION</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  air-resistance"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/air-resistance/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">AIR RESISTANCE</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  calculation"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/calculation/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">CALCULATION</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  football"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/football/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">FOOTBALL</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  forces"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/forces/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">FORCES</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  kinematics"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/kinematics/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">KINEMATICS</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  numerical"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/numerical/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">NUMERICAL</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  physics"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/physics/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">PHYSICS</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  projectile-motion"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/projectile-motion/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">PROJECTILE MOTION</a></li><li pad-t-med="" pad-r-sm="" no-marg=""  python"="" itemprop="articleSection" style="box-sizing: border-box; margin-bottom: 14px; padding: 16px 8px 0px 0px; border: 0px; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; display: inline-block; margin-top: 0px !important; margin-right: 0px !important; margin-left: 0px !important;"><a href="https://www.wired.com/tag/python/" rel="tag" style="box-sizing: border-box; margin: 0px; padding: 0px; border-top: 0px; border-right: 0px; border-left: 0px; border-image: initial; outline: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; transition: background 0.15s cubic-bezier(0.33, 0.66, 0.66, 1); text-decoration-line: none; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; border-bottom: 0px !important; box-shadow: none !important;">PYTHON</a></li></ul><img src ="http://www.cppblog.com/zmj/aggbug/215261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-09-24 13:32 <a href="http://www.cppblog.com/zmj/archive/2017/09/24/215261.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Shape Detection &amp; Tracking using Contours</title><link>http://www.cppblog.com/zmj/archive/2017/09/14/215244.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 14 Sep 2017 08:44:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/09/14/215244.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215244.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/09/14/215244.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215244.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215244.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://opencv-srf.blogspot.jp/2011/09/object-detection-tracking-using-contours.htmlIn the&nbsp;previous tutorial, we could detect and track an object using color&nbsp;separation. But we could not ide...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/09/14/215244.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215244.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-09-14 16:44 <a href="http://www.cppblog.com/zmj/archive/2017/09/14/215244.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>USING OPENCV FOR SIMPLE OBJECT DETECTION</title><link>http://www.cppblog.com/zmj/archive/2017/09/14/215243.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 14 Sep 2017 08:07:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/09/14/215243.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215243.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/09/14/215243.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215243.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215243.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: https://solderspot.wordpress.com/2014/10/18/using-opencv-for-simple-object-detection/My current project is to build a bot for the &#8220;Blue Block Challenge&#8221;. The goal is to create an autonomou...&nbsp;&nbsp;<a href='http://www.cppblog.com/zmj/archive/2017/09/14/215243.html'>阅读全文</a><img src ="http://www.cppblog.com/zmj/aggbug/215243.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-09-14 16:07 <a href="http://www.cppblog.com/zmj/archive/2017/09/14/215243.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> opencv3寻找最小包围圆形-minEnclosingCircle函数</title><link>http://www.cppblog.com/zmj/archive/2017/09/14/215242.html</link><dc:creator>zmj</dc:creator><author>zmj</author><pubDate>Thu, 14 Sep 2017 08:05:00 GMT</pubDate><guid>http://www.cppblog.com/zmj/archive/2017/09/14/215242.html</guid><wfw:comment>http://www.cppblog.com/zmj/comments/215242.html</wfw:comment><comments>http://www.cppblog.com/zmj/archive/2017/09/14/215242.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zmj/comments/commentRss/215242.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zmj/services/trackbacks/215242.html</trackback:ping><description><![CDATA[<div>http://blog.csdn.net/qq_23880193/article/details/49257637<br /><div style="padding-top: 20px; padding-bottom: 20px; font-family: Arial, Console, Verdana, &quot;Courier New&quot;; font-size: 12px; background-color: #ffffff;"><p style="margin: 0px; padding: 0px 0px 0px 10px; height: 14px; line-height: 14px; border-left: 3px solid #e41c1e; color: #666666; font-size: 14px;">版权声明：本文为博主原创文章，未经博主允许不得转载。</p></div><div id="article_content"  tracking-ad"="" data-mod="popu_307" data-dsm="post" style="margin: 20px 0px 0px; font-stretch: normal; line-height: 26px; font-family: Arial; background-color: #ffffff;"><div bg_cpp"="" style="width: 936.531px; overflow-y: hidden; background: url(&quot;images/black/cpp.gif&quot;) right top no-repeat #333333; opacity: 0.6; position: relative;"><div style="position: relative;"><div style="border-left-color: #999999;"><strong>[cpp]</strong>&nbsp;<a href="http://blog.csdn.net/qq_23880193/article/details/49257637#" title="view plain" target="_blank" style="color: #cccccc;">view plain</a><span data-mod="popu_168">&nbsp;<a href="http://blog.csdn.net/qq_23880193/article/details/49257637#" title="copy" target="_blank" style="color: #cccccc;">copy</a><div style="position: absolute; left: 758px; top: 405px; width: 28px; height: 15px; z-index: 99;"></div></span><span data-mod="popu_169">&nbsp;<a href="http://blog.csdn.net/qq_23880193/article/details/49257637#" title="print" target="_blank" style="color: #cccccc;">print</a></span><a href="http://blog.csdn.net/qq_23880193/article/details/49257637#" title="?" target="_blank" style="color: #cccccc;">?</a></div></div><ol start="1" style="position: relative;"><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">#include&lt;iostream&gt;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">#include&lt;vector&gt;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">#include&lt;opencv2/opencv.hpp&gt;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;"><span style="color: #66ccff;">using</span>&nbsp;<span style="color: #66ccff;">namespace</span>&nbsp;cv;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;"><span style="color: #66ccff;">using</span>&nbsp;<span style="color: #66ccff;">namespace</span>&nbsp;std;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;"><span style="color: #2e8b57; font-weight: bold;">int</span>&nbsp;main()&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">{&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;Mat&nbsp;srcImage(Size(600,&nbsp;600),&nbsp;CV_8UC3,&nbsp;Scalar(0));&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;RNG&nbsp;&amp;rng&nbsp;=&nbsp;theRNG();&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold;">char</span>&nbsp;key;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">while</span>&nbsp;(1)&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//随机生成一些点</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//首先就是随机生成点的总数量</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold;">int</span>&nbsp;g_nPointCount&nbsp;=&nbsp;rng.uniform(3,&nbsp;30);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//接下来就是随机生成一些点的坐标</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vector&lt;Point&gt;&nbsp;points;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">for</span>&nbsp;(<span style="color: #2e8b57; font-weight: bold;">int</span>&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;g_nPointCount;&nbsp;i++)&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point&nbsp;midPoint;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;midPoint.x&nbsp;=&nbsp;rng.uniform(srcImage.cols&nbsp;/&nbsp;4,&nbsp;srcImage.cols&nbsp;*&nbsp;3&nbsp;/&nbsp;4);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;midPoint.y&nbsp;=&nbsp;rng.uniform(srcImage.rows&nbsp;/&nbsp;4,&nbsp;srcImage.rows&nbsp;*&nbsp;3&nbsp;/&nbsp;4);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points.push_back(midPoint);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//显示刚刚随机生成的那些点</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">for</span>&nbsp;(<span style="color: #2e8b57; font-weight: bold;">int</span>&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;g_nPointCount;&nbsp;i++)&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;circle(srcImage,&nbsp;points[i],&nbsp;0,&nbsp;Scalar(rng.uniform(0,&nbsp;255),&nbsp;rng.uniform(0,&nbsp;255),&nbsp;rng.uniform(0,&nbsp;255)),&nbsp;3);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//在生成的那些随机点中寻找最小包围圆形</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Point2f&nbsp;center;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #2e8b57; font-weight: bold;">float</span>&nbsp;radius;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;minEnclosingCircle(points,&nbsp;center,&nbsp;radius);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #cccccc;">//根据得到的圆形和半径&nbsp;&nbsp;绘制圆形</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;circle(srcImage,&nbsp;<span style="color: #66ccff;">static_cast</span>&lt;Point&gt;(center),&nbsp;(<span style="color: #2e8b57; font-weight: bold;">int</span>)radius&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;Scalar(rng.uniform(0,&nbsp;255),&nbsp;rng.uniform(0,&nbsp;255),&nbsp;rng.uniform(0,&nbsp;255)),&nbsp;3);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imshow(<span style="color: #ff9900;">"【绘制结束后的图像】"</span>,&nbsp;srcImage);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key&nbsp;=&nbsp;waitKey();&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">if</span>&nbsp;(key&nbsp;==&nbsp;27)&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">break</span>;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">else</span>&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srcImage&nbsp;=&nbsp;Scalar::all(0);&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66ccff;">return</span>&nbsp;0;&nbsp;&nbsp;</span></li><li style="border-left-color: #999999; color: #eeeeee; line-height: 18px;"><span style="color: #ffffff;">}&nbsp;&nbsp;</span></li></ol></div><br /><img src="http://img.blog.csdn.net/20151019233448952?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" /></div></div><img src ="http://www.cppblog.com/zmj/aggbug/215242.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zmj/" target="_blank">zmj</a> 2017-09-14 16:05 <a href="http://www.cppblog.com/zmj/archive/2017/09/14/215242.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>