随笔分类 - C++
摘要:1、在资源视图中将menu加入资源视图中 里面是默认没有menu资源的。这时就需要我们手动添加menu资源了。 2、在资源视图中添加menu资源 还是在资源视图中,任选一个空白的地方“右击”,弹出如下界面,选择“添加资源(R)”功能 之后在弹出的对话框中选择menu资源,再单击“新建”按钮,界面如下
阅读全文
摘要:首先拖入Static Text控件 可以设置属性来改变文字的显示位置 一个是对齐文本改为center 另一个是居中图像 改为True 此时会发现 文字显示在中间位置 在源文件中加入以下代码 CFont font;//改字体 在OnInitDialog函数中加入以下代码 font.CreatePoin
阅读全文
摘要:在MFC上创建一个图片控件 可以根据右下角的控件属性对图片控件的样式进行修改 修改后的样式有没有好看一些 创建一个按钮控件用于读取图像 我们将Picture控件的ID 改为 下面是代码环节 先在头文件中加入下面三行代码 其中,下图.h是头文件 .cpp是源文件 .Dialog是GUI
阅读全文
摘要:原理概述 代码 #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/core/core.hpp" #include <assert.h> #include <s
阅读全文
摘要:博主带大家来编写一个整数加法器的小程序:分别输入两个整数,点击按钮,显示它们的相加结果 1.我们点击Button,拖动进入界面,可以看到生成了一个按钮叫“Button1” 2.这里我们把GUI的名称改为“整数加法器”,选择GUI窗口的属性-描述文字,改为“整数加法器” 3.我们可以修改Button的
阅读全文
摘要:点击创建新项目 选择MFC应用 设置项目名称和位置,点击创建 选择应用程序类型为“基于对话框”点击下一步直至完成 点击资源视图-->点击Dialog中的第二个文件查看窗口界面 点击工具箱打开控件列表 从控件列表向界面中拖入一个Button控件,点击控件在右下角属性栏可查看其属性 右击界面中的Butt
阅读全文
摘要:什么是相对路径? 相对路径是指以当前文件资源所在的目录为参照基础,链接到目标文件资源(或文件夹)的路径。 假设,我们在一个A文件(比如a.html)中,链接另一个B文件(比如b.html),也可以说是,当前文件A引用目标文件B,那么,相对路径就是以当前文件A所在的目录为参照基础,建立连接到目标文件B
阅读全文
摘要:函数原型C++: void inpaint( InputArray src, InputArray inpaintMask, OutputArray dst, double inpaintRadius, int flags ) 1)InputArray类型的src,输入图像,填Mat类的对象即可,且
阅读全文
摘要:FILE * fopen(const char * path,const char * mode); 参数mode字符串则代表着流形态。 mode有下列几种形态字符串: r 打开只读文件,该文件必须存在。 r+ 打开可读写的文件,该文件必须存在。 rb+ 读写打开一个二进制文件,只允许读写数据。 r
阅读全文
摘要:原理: C++代码(灰度图像): //TP Inpaint #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/
阅读全文
摘要:原理: C++代码(灰度图像): #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/core.hpp> #in
阅读全文
摘要:原理: C++代码(灰度图像): //CDD Inpaint #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core
阅读全文
摘要:原理: C++代码(灰度图像): //#define OPENCV_TRAITS_ENABLE_DEPRECATED #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui
阅读全文
摘要:原理: C++代码(灰度图像): #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/core.hpp> #in
阅读全文
摘要:#include <opencv2/opencv.hpp> #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/
阅读全文
摘要:#include <opencv2/opencv.hpp> #include<iostream> using namespace std; using namespace cv; void main() { //读取图片 Mat image = imread("1.png"); imshow("ro
阅读全文
摘要:#include <opencv2/opencv.hpp> #include <iostream> #include <stdlib.h> #include <math.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/
阅读全文
摘要:cv::Mat image_array =imread("path"); //读入目标图像 cv::imshow("1", image_array);//显示原始图像 image_array.convertTo(image_array, CV_32FC3);//原始图像转为32位浮点类型 cv::n
阅读全文