Saturday, February 24, 2018

Matlab: 短视频转换为动图(GIF)

短视频如何转换为动图(GIF),它可以在邮件中自动播放?(Word文档也可以插入Gif。) 两种方法:一是在线转换,如参考文献[1],它可以随时随地转换,适合文件小于120M的短视频;再有,自己编程解决。

Introduction

视频的帧数(number of frames)可以通过implay简单的GUI查看。 基本参数是,reSize重定义每帧的尺寸,有利于压缩输出文件,InterVal定义采样间隔,采样间隔越小越流畅,但输出文件亦会增大,所以每次运行基本都围绕着这两个参数调整,在文件大小及流畅性方面权衡。Fig.1表示重定义尺寸为0.2、采样间隔为8。
Fig.1

References

Thursday, February 22, 2018

Tool: Create Word Cloud Art

记录一个在线工具,自主生成关键词云图。推荐使用wordart.com。

Introduction

1.注册账号
2.开始创建
注册之后就可以开始创建。
Fig. 1
3.基本创建流程
Fig. 2
如Fig. 2,添加关键词并为之调整属性(Size、Color、Angle等),可从Import批量输入。之后依次在SHAPES、FONTS、LAYOUT、STYLE调整。
如果需要透明背景,请按照Fig. 3配置两点属性,输出(DOWNLOAD)为PNG文件。
Fig. 3

NOTE

免费情形下输出的图片尺寸比较有限,一般可以满足A4文档的需求。如果对于图片尺寸及质量有更高要求需要购买付费项目。

References

Wednesday, January 31, 2018

Python: OpenCV

Introduction

OpenCV (Open Source Computer Vision Library) is released under a BSD license and hence it’s free for both academic and commercial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing. Enabled with OpenCL, it can take advantage of the hardware acceleration of the underlying heterogeneous compute platform.

Installation

Python: Intalling opencv.

Notes

[1] Color image loaded by OpenCV is in BGR mode. But Matplotlib displays in RGB mode.

References

Tuesday, January 2, 2018

Python+Arcpy: Interpolating Using IDW or Kriging

已知:一个Point Shapefile文件,基于其中的字段完成由点及面的插值工作。
先以IDW反距离加权方法插值,方法:体会Idw,或者IDW_ga。插值如下:
Fig. 1
Kriging未来再加入。

References

Create a Point Shapefile based on Lon/Lat imported by a Excel file

已知:Excel文件sheet表中包含气象站点的某类数据,并附上站点的经度与纬度,试探讨如何将该数据生成Point Shapefile文件,并为各个Point添加属性字段及赋值?
方法:Python+xlrd读取Excel文件中的sheet内容,Python+Arcpy实现Point Shapefile文件创建及其字段添加及赋值环节。
运行结果如Fig. 1,红框表示添加字段及赋值后的属性表。File.rar.
Fig. 1