Saturday, March 17, 2018

Video: Convert Gifs to Video

工具箱ffmpeg可以将Gif动图文件转换成Video文件,Video文件格式包含.mp4、mpeg等。

References

Friday, March 9, 2018

Linux

Introduction

Linux是一个自由且开源的软件操作系统家族,他们均以Linux kernel搭建而成。Linux是以桌面版和服务版两种形式的Linux distribution(Linux发布版)而著名。Linux distribution必须的组件是Linux kernel,第一支操作系统Linux kernel由Linus Torvalds在1991年9月17日公开发布。
Linux最初基于英特尔x86架构为个人计算机开发,但逐渐相比其它操作系统被应用在更多的平台。由于基于Linux kernel的安卓操作系统在智能手机的主要份额,Linux已是安装最多的常用操作系统。Linux也是服务器和其它标志性系统(如大型系统)的领先操作系统,而且也是Top500超算唯一使用的操作系统(自2017年11月,已然逐渐消除了其它竞争对手)。
约有2.3%的计算机使用Linux。应用Linux kernel为基础的Chrome操作系统——Chromebook,占据美国K-12教育市场的主要份额,也还占有美国300美元以下笔记本电脑的20%份额。

References

Friday, March 2, 2018

Data: 夜间灯光数据

DMSP-OLS vs. VIIRS DNB

Download

Tool
原始的DMSP/OLS Nightlight数据是6bit(如Stable Lights),大部分的软件都不能正常识别,这里需要先将他们转换为uint8格式数据才可以进行后面的处理。
References
[1] 李德仁, 李熙. 论夜光遥感数据挖掘[J]. 测绘学报, 2015, 44(6): 591~601.
[2] 陈佐旗. 基于多源夜间灯光遥感影像的多尺度城市空间形态结构分析[D]. 上海: 华东师范大学. 2017.
[3] Nordhaus, W.D. 2005. Geography and macroeconomics: New data and new findings. Proceedings of the National Academy of Sciences of the United States of America (PNAS), 103(10): 3510-3517. Global Gridded Geographically Based Economic Data (G-Econ), v4 (1990, 1995, 2000, 2005).

Tuesday, February 27, 2018

Matlab: 批量等比例调整图片尺寸

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
% Created by LI Xu
% Version 1.0
% February 28, 2018

% Description:
% Resize Images

% If you have any question about this code,
% please do not hesitate to contact me via E-mail: 
% jeremy456@163.com

% Blog:
% http://blog.sciencenet.cn/u/lixujeremy
% http://lixuworld.blogspot.com/

clear;
clc;

timebegin=tic;
cur_data=date;
cur_time=fix(clock);
str1=sprintf('%s %.2d:%.2d:%.2d', cur_data, cur_time(4), cur_time(5), cur_time(6)); 
fprintf('Time Begin: ');
fprintf(str1);
fprintf('\n');

% Source Directory
SouDir='input';
% Destination Directory
DesDir='output';

% Resize Scale
ReScale=0.1;

% All Images
files=dir(SouDir);
files=files(3:end);


% Loop
parfor ii=1:length(files)
    filepath=fullfile(SouDir, files(ii).name);
    image=imread(filepath);
    otimage=imresize(image, ReScale);
    
    otpath=fullfile(DesDir, files(ii).name);
    imwrite(otimage, otpath);
    
    
    str4dp=[num2str(ii), '.', files(ii).name, ' done!'];
    disp(str4dp);
end

fprintf('Time Begin: ');
fprintf(str1);
fprintf('\n');

cur_data=date;
cur_time=fix(clock);
str2=sprintf('%s %.2d:%.2d:%.2d', cur_data, cur_time(4), cur_time(5), cur_time(6)); 
fprintf('Time End: ');
disp(str2);
timespan=toc(timebegin);
fprintf('Time Span: %.4f s\n', timespan);

disp('*************************************');