- 博客(15)
- 收藏
- 关注
原创 2021-03-10
一、Image.fromarray的作用:简而言之,就是实现array到image的转换1. PIL image转换成array二、PIL中的Image和numpy中的数组array相互转换:img = np.asarray(image)2. array转换成imageImage.fromarray(np.uint8(img))...
2021-03-10 19:17:58
135
转载 2021-03-10
Numpy属性dtype的转换(数据类型转换):unit8和float32转转载https://blog.youkuaiyun.com/qq_29391809/article/details/106037766?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-8&spm=1001.2101.3001.4242查看数据类型print(image.dtype)uint8转换成float32先将图片转化为floa
2021-03-10 16:26:42
566
原创 matlab fullfile函数
fullfile 函数作用是作用是利用文件各部分信息创建并合并成完整文件名:fullfile('dir1','dir2',...,'filename')f = fullfile('dir1', 'dir2', ..., 'filename')输入:f = fullfile('C:','Applications','matlab','fun.m')得到:f =C:\Applications\matlab\fun.m...
2020-05-21 17:08:15
7173
1
原创 np.transpose
二维数组对应的的两个轴(x,y)对应的下标为(0,1),若np.transpose()传入的参数为(1,0),则将原来数组的 x,y轴互换。np.transpose()的默认操作如下:以三维为例:(0,1,2)——》(2,1,0)操作规则,axis(0,1,2)------>axis(2,1,0)(2,3,3)------------>(3,3,2)...
2019-12-01 20:05:43
643
原创 c++中小数点显示几位的问题
参考自http://blog.youkuaiyun.com/yayingstar/article/details/18525239http://blog.youkuaiyun.com/edricbjtu/article/details/41082597#include #include using namespace std;int main(){ //以下所有保留小数的情形都考虑了四
2017-10-19 16:05:32
3430
转载 C++中break和continue的用法
转自https://zhidao.baidu.com/question/152058255.html1.break可以在循环和switch中使用,程序执行到break语句时,如果break在循环中出现,则跳出当前层次的循环(只能跳出一层)继续执行循环外的语句。如果在switch语句中出现,则结束switch,继续执行switch语句之后的语句。for( ; ; ){a;if(e)br
2017-04-29 15:45:22
2411
转载 typedef与define的区别
转自https://zhidao.baidu.com/question/24658120.html1) #define是预处理指令,在编译预处理时进行简单的替换,不作正确性检查,不关含义是否正确照样带入,只有在编译已被展开的源程序时才会发现可能的错误并报错。例如:#define PI 3.1415926程序中的:area=PI*r*r 会替换为3.1415926*r*r如果你把#defin
2017-04-24 11:06:08
239
转载 C语言中 scanf_s和 scanf 区别
转自 https://zhidao.baidu.com/question/123882045.htmlscanf()函数是标准C中提供的标准输入函数,用以用户输入数据scanf_s()函数是Microsoft公司VS开发工具提供的一个功能相同的安全标准输入函数,从vc++2005开始,VS系统提供了scanf_s()。在调用该函数时,必须提供一个数字以表明最多读取多少位字符。
2017-04-04 15:54:34
16023
原创 枚举类型应用实例
口袋中有红,黄,蓝,白,黑 5种颜色的球若干个。每次从口袋中先后取出3个球,问得到3种不同颜色的球的可能取法,输出每种排列的情况。#includeint main(){ enum Color {red,yellow,blue,white,black}; enum Color i, j, k,pri; int n, loop; n = 0; for (i = red; i <=
2017-04-03 21:15:24
421
原创 输出链表
#include#define LEN sizeof(struct Student)struct Student{ long num; float score; struct Student *next;};int n;struct Student *creat(void){ struct Student *head; struct Student *p1, *p2; n
2017-04-02 15:38:50
506
原创 建立动态链表
#include#define LEN sizeof(struct Student)struct Student{ long num; float score; struct Student *next;};int n;struct Student *creat(void){ struct Student *head; struct Student *p1, *p2; n
2017-04-02 15:25:56
470
转载 vs调试查看中间变量
首先,你要确保VS处于调试状态(因为编辑状态和调试状态的菜单以及工具栏会不同)。然后选择菜单【调试】-【窗口】里面的【局部变量】、【自动窗口】和【监视】-【监视 n】都可以显示变量的值,只是显示的变量会不同。【局部变量】和【自动窗口】都是VS自动选择要显示的变量;【监视 n】就是要认为指定要显示的表达式
2017-03-22 16:25:49
8092
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人