- 博客(5)
- 收藏
- 关注
原创 opencv 将多帧图像合成为视频 cv2.VideoWriter()
将文件夹下有时间戳或者有序的 *.jpg 图像合成为一个 mp4 格式的视频。附加:加进度条看合成进度。
2022-08-24 22:10:25
6348
3
原创 plt保存图像、去白边、去坐标轴、去刻度
原图像是 *.jpg,对原图像进行一系列处理(比如resize)后,打算用 plt 保存为新图像 *_resized.jpg。直接使用 plt.savefig() 进行保存,会存下带有白边、坐标轴和刻度的图像,现在进行操作只保存处理后的净图像。
2022-08-24 21:08:50
7191
1
原创 读取文件夹下所有文件名、保存并排序 C++
读取文件夹下所有文件名,保存到 vector 里,并按文件名称进行排序:#include <iostream>#include <string>#include <dirent.h>using namepace std;DIR* dir;struct dirent* ent;vector<string> names;if ((dir = opendir("/home/address")) != NULL){ while ((ent
2022-04-15 17:03:14
1841
原创 将.txt文件中的数据依次按顺序转换成.npy文件保存 Python
import numpy as npimport ospath = "/you/own/path/"path_list = os.listdir(path)path_list.sort(key=lambda x:int(x[:-4])) # 按照文件名进行排序for filename in path_list: data_array = np.loadtxt( "/you/own/path/"+ filename, dtype=np.float32).reshape(-1, 4) # d
2022-03-04 19:18:12
1490
原创 依次写入数据到多个txt文件 C++
#include <fstream>int i = 0; //设置一个全局计数器,将每次调用函数得到的数据写进一个单独的文档,命名为"0.txt", "1.txt", ……char filePath[128]; //为 filePath 分配空间 sprintf(filePath, "/address/%d.txt", i); ofstream outfile; outfile.open(filePath); for (std::size_t i
2022-03-04 18:59:08
1521
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人