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