原创 python 文件讀寫

r r+ w w+ a     寫內容, 不覆蓋內容 a+  可讀可寫,不覆蓋內容

原创 ROS learning note

  killall -9 roscore killall -9 rosmaster  To add the workspace to your ROS environment you need to source the genera

原创 matlab 矩陣左右乘除

左除 : C = B\A  ==== B*C =A 右除: C = B/A  ==== C*A = B

原创 旋轉矩陣、四元素之間轉換matlab

R=angle2dcm(r1,r2,r3,S)  S 爲轉動次序,默認爲'ZYX' [r1,r2,r3] = dcm2angle(R,S) // ri 爲弧度 [r1,r2,r3] = quat2angle([q0 q1 q2 q3],

原创 ubuntu 合併多文本文件內容

將 a.txt b.txt 的文件中的內容合併到c.txt文本中 cat a.txt b.txt > c.txt  

原创 快速查看圖像某點像素

利用Matlab, 打開 應用程序 image viewer, 將圖片導入即可

原创 convert from .png to .jpg

from PIL import Image   im = Image.open("a.png") rgb_im = im.convert('RGB') rgb_im.save('color.jpg')

原创 vim settings

install vim: sudo apt-get install cim change the vim settings file: cd /etc/vim sudo gedit vimrc   add some information

原创 python numpy 矩陣創建

1. 創建一般的多維數組import numpy as npa = np.array([1,2,3], dtype=int)type(a)a.shapea.dtype.namea.sizea.itemsizeb=np.array([1,2

原创 DataParallel layers (multi GPU)

import torch.nn as nnimport torch.nn.parallelimport torch.backends.cudnn as cudnnmodel = nn.DataParallel(model)

原创 python: the number is not float type

from __future__ import divisionkernel = t.ones(3,3)/-9kernel[1][1] = 8/9kernel