matlab 保存时怎么不带白边
imshow(strain_image,‘border’,‘tight’,‘initialmagnification’,‘fit’); set (gcf,‘Position’,[0,0,500,500]);%自己的尺寸
C++开源矩阵计算工具——Eigen下载、配置与使用
下载并解压 http://eigen.tuxfamily.org/index.php?title=Main_Page#Download 配置 release和debug都增加 使用 ref https://blog.csdn.net/houjixin/article/details/8477522 https://blog.csdn.net/augusdi/article/details/12907341
C++按行读取txt 字符串
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
int main()
{
ifstream in("1.txt");
string filename;
string line;
if(in) // 有该文件
{
while (getline (in, line)) // lin
matlab的颜色映射colormap
gray=depth_inpaint_show;
gray=(gray-min(gray(:)))/(max(gray(:)) - min(gray(:)));
gray=gray*(64-1)+1;
gray=round(gray);
imshow(gray, colormap('gray'))
ref https://blog.csdn.net/qlj061001/article/details/78968273
cv::Mat中的数据按行列写入xml文件中并通过matlab读取
void writeMatToXML(const cv::Mat & mat, const std::string xmlName)
{
FileStorage fs(xmlName, FileStorage::WRITE);
fs << "Mat" << mat;
fs.release();
}
Opencv访问元素
Mat_---------CV_8U Mat-----------CV_8S Nat_---------CV_16S Mat_--------CV_16U Mat_-----------CV_32S Mat_----------CV_32F Mat_--------CV_64F ref https://blog.csdn.net/eric_e/article/details/79517106
MATLAB fileparts函数
函数功能:在FreeMat、Matlab中,该函数用于将一个文件的完整路径中各部分提取出来。 语法格式: [pathstr, name, ext, versn] = fileparts(filename) 其中filename是要解析的文件的完整路径,例如:E:\games\IGI\bin\IGI.exe。fileparts将这个文件名(包含完整路径信息)各部分分别提取到四个变量中。 其中pathstr是这个文件的路径名,name是文件名,ext是包含一个点号文件的扩展名(指定了文件的类型)。
matlab遍历文件夹下指定类型文件及提取文件路径及文件名
% 函数功能:指定路径path下所有图像路径,不扫描子文件夹
% path:查找的路径
% file_mask:需要查找的文件类型,比如*.jpg
function file_list = ScanDir(path, file_mask)
file_path = path; % 图像文件夹路径
img_path_list = dir(strcat(file_path, file_mask)); % 获取该文件夹中所有jpg格式的图像
img_num = length(img_path_li
NameError: global name '__file__' is not defined
base_dir = os.path.join(os.path.dirname(__file__))
base_dir = os.path.dirname(os.path.realpath('__file__'))
import os
path1=os.path.abspath(__file__)
print(path1)#当前文件的绝对路径
path2=os.path.dirname(os.path.abspath(__file__))
print(path2)#当前文件的上一层目录
matlab求图像水平竖直梯度
close all;
clear all;
clc;
imgray= rgb2gray(imread('1.png'));
%% edge
bw=edge(imgray,'sobel');
% figure,imshow(bw);
I=double(imgray);
[x y]=gradient(I); %获取梯度
t=sqrt(x.^2+y.^2);
G=I;
G(t>10)=0; %梯度提取边缘
G(t<10)=255;
G=uint8(G);
% figure,imshow(G
Marching squares生成轮廓的算法
https://blog.csdn.net/silangquan/article/details/47054309 https://blog.csdn.net/ZxN9988/article/details/42194587
拷贝构造函数&深拷贝和浅拷贝
拷贝构造函数调用的几种情况: 用类的一个对象去初始化该类的另一个对象(或引用时); 若函数的形参为类对象,调用函数时,实参赋值给形参,系统自动调用; 当函数的返回值是类对象时。 深拷贝、浅拷贝 在某些状况下,类成员变量需要动态开辟内存,如果实行浅拷贝,也就是把对象的值完全复制给另一个对象,如A a1=a2;这时,如果a2中有一个成员变量指针已经申请了内存,那么a1中的那个成员变量也指向同一块内存,这就出现了问题:当a2把内存释放了(如:析构),这时a1内的指针就是野指针了,出现运行错误。 深拷
pycharm出现问题:AttributeError: module 'pip' has no attribute 'main'
环境信息:pycharm2017.3.1(Professional Edition)、python3.6.5 (64位)、pip10.0.1、Django2.0.5 错误原因:由于pip 10版本中没有main(),如果在不降级的情况下,修改这个文件 找到pycharm安装目录下的packaging_tool.py修改成如下内容 D:\Program Files\JetBrains\PyCharm 2017.3.4\helpers\packaging_tool.py def do_instal
【BUG】Installing Oracle 10.2.0.1 On AIX Hangs At Prereqs Check
说明: 在一套已经安装了Oracle 11.2.0.4 RAC FOR AIX 6.1的服务器上安装多一套单节点的Oracle 10.2.0.1数据库时,出现卡住的情况 在进行预检查,运行到83%时会卡住。 在微软BING搜索引擎中查找关键字 “oracle processing oracle database 10g 10.2.0.1 83%” 找到官方社区文档:https://community.oracle.com/thread/2156690 分析为BUG 请参考MOS文章: Inst
今日推荐
周排行