实验小坑一个接一个
thebestone1022
已经毕业啦
展开
-
使用 python 处理 mat 文件
使用 python 读取 mat 和简单的写 mat 文件,这里就不赘述了。这里主要关注往已存在的 mat 文件中写入信息,即类似于 append。import scipy.io as siowith open(matfile_path, 'ab') as matfile: sio.savemat(matfile, {'key': value})参考:https://stackoverflow.com/questions/29040276/how-to-append-to-mat-file-us原创 2020-11-21 19:44:38 · 366 阅读 · 0 评论 -
MATLAB 与 python 中裁剪图片的不同之处
在 python 中使用 PIL 包中的 Image 进行图像裁剪时,传入的四元组信息为 [left, top, right, bottom],而 MATLAB 中的 imcrop 传入的四元组为 [xmin, ymin, weight, height]。也就是说,在 python 中传入的是矩形框左上角和右下角的坐标,而在 MATLAB 中传入的是矩形框左上角与宽、高信息。假设 rectpython=[left,top,right,bottom]rect_{python} = [left, top,原创 2020-11-20 19:52:41 · 201 阅读 · 0 评论