资源简介
VS+QT+Opencv可视化编程,包含环境搭建和简单的opencv vs2013 qt结合的可视化编程。
代码片段和文件信息
#include “huadongtiao.h“
#include
using namespace cv;
#include“myclass.h“;
QImage cvMat2QImage1(const cv::Mat& mat);
huadongtiao::huadongtiao(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
ui.horizontalSlider->setMinimum(0);
ui.horizontalSlider->setMaximum(4);
ui.horizontalSlider->setValue(0);
ui.horizontalSlider_2->setMinimum(0);
ui.horizontalSlider_2->setMaximum(4);
ui.horizontalSlider_2->setValue(0);
}
huadongtiao::~huadongtiao()
{
}
void huadongtiao::receiveData(QString data)
{
ui.lineEdit->setText(data);
QString st = data;
}
void huadongtiao::on_horizontalSlider_valueChanged(int value)
{
int pos = ui.horizontalSlider->value();
QString str = QString(“%1“).arg(pos);
ui.lineEdit->setText(str);
}
void huadongtiao::on_horizontalSlider_2_valueChanged(int value)
{
int number = ui.horizontalSlider_2->value();
int x = number * 2 + 1;
QString str = QString(“%1“).arg(x);
//int y = g_nKheightTrackBarValue * 2 + 1;
ui.lineEdit->setText(str);
Mat src = imread(“1.jpg“0);
Mat dst;
int blockSize = 25;
int constValue = 10;
Mat local;
adaptiveThreshold(src src 255 CV_ADAPTIVE_THRESH_MEAN_C CV_THRESH_BINARY_INV blockSize constValue);
medianBlur(src dst x);
/*imshow(“1“ dst);
waitKey(0)*/;
QImage img2 = cvMat2QImage1(dst);
ui.label->clear();
ui.label->setPixmap(QPixmap::fromImage(img2));
ui.label->resize(ui.label->pixmap()->size());
}
QImage cvMat2QImage1(const cv::Mat& mat)
{
// 8-bits unsigned NO. OF CHANNELS = 1
if (mat.type() == CV_8UC1)
{
QImage image(mat.cols mat.rows QImage::Format_Indexed8);
// Set the color table (used to translate colour indexes to qRgb values)
image.setColorCount(256);
for (int i = 0; i < 256; i++)
{
image.setColor(i qRgb(i i i));
}
// Copy input Mat
uchar *pSrc = mat.data;
for (int row = 0; row < mat.rows; row++)
{
uchar *pDest = image.scanLine(row);
memcpy(pDest pSrc mat.cols);
pSrc += mat.step;
}
return image;
}
// 8-bits unsigned NO. OF CHANNELS = 3
else if (mat.type() == CV_8UC3)
{
// Copy input Mat
const uchar *pSrc = (const uchar*)mat.data;
// Create QImage with same dimensions as input Mat
QImage image(pSrc mat.cols mat.rows mat.step QImage::Format_RGB888);
return image.rgbSwapped();
}
else if (mat.type() == CV_8UC4)
{
// Copy input Mat
const uchar *pSrc = (const uchar*)mat.data;
// Create QImage with same dimensions as input Mat
QImage image(pSrc mat.cols mat.rows mat.step QImage::Format_ARGB32);
return image.copy();
}
else
{
return QImage();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-25 01:24 qt-opencv\
目录 0 2017-11-25 01:23 qt-opencv\qt-opencv\
文件 32243712 2017-11-25 01:24 qt-opencv\qt-opencv.sdf
文件 973 2017-11-23 17:23 qt-opencv\qt-opencv.sln
文件 46592 2017-11-25 01:24 qt-opencv\qt-opencv.v12.suo
文件 29726 2017-11-02 21:42 qt-opencv\qt-opencv\1.jpg
文件 9662 2017-11-24 20:36 qt-opencv\qt-opencv\123.ico
目录 0 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\
文件 638501 2017-11-24 16:55 qt-opencv\qt-opencv\Debug\huadongtiao.obj
文件 406068 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\hz.obj
文件 578108 2017-11-24 16:55 qt-opencv\qt-opencv\Debug\main.obj
文件 581949 2017-11-24 16:55 qt-opencv\qt-opencv\Debug\moc_huadongtiao.obj
文件 305948 2017-11-24 16:51 qt-opencv\qt-opencv\Debug\moc_hz.obj
文件 583832 2017-11-24 16:55 qt-opencv\qt-opencv\Debug\moc_myclass.obj
文件 745756 2017-11-24 17:08 qt-opencv\qt-opencv\Debug\myclass.obj
文件 36247 2017-11-24 16:42 qt-opencv\qt-opencv\Debug\qrc_myclass.obj
文件 2800 2017-11-24 15:41 qt-opencv\qt-opencv\Debug\qt-opencv.Build.CppClean.log
文件 4721 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.log
目录 0 2017-11-24 17:23 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\
文件 10310 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\cl.command.1.tlog
文件 250406 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\CL.read.1.tlog
文件 8862 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\CL.write.1.tlog
文件 5470 2017-11-24 16:54 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\custombuild.command.1.tlog
文件 1660 2017-11-24 16:54 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\custombuild.read.1.tlog
文件 2598 2017-11-24 16:54 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\custombuild.write.1.tlog
文件 5012 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\li
文件 9352 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\li
文件 1958 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\li
文件 193 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\qt-opencv.tlog\qt-opencv.lastbuildstate
文件 2641920 2017-11-24 17:24 qt-opencv\qt-opencv\Debug\vc120.pdb
文件 908 2017-10-19 17:42 qt-opencv\qt-opencv\down4.png
............此处省略60个文件信息
- 上一篇:PhotoShop FFT/iFFT 滤镜
- 下一篇:小车在路上仿真.rar
相关资源
- qt编写的解析16位深tiff灰度图的程序
- qt调用讯飞实时语音接口WEBAPI
- 最全的OpenCV源代码
- 基于Opencv的红外运动目标识别与跟踪
- Qt编写的录屏软件,抓屏-合成视频录
- 《Qt 5编程入门》书籍配套源码
- mingw编译的opencv库
- 米依公司激光扫描仪上位机例程,Q
- Qt及Qt Quick开发实战精解代码
- 基于ORB算法的特征提取和匹配(VS20
- 基于SIFT算法的特征提取(VS2015+OpenC
- 超像素分割SLIC(简单线性迭代聚类)
- 多线程TCP服务器运行程序
- VS2013+opencv2.4.10提取SURF_BOW特征使用s
- VS2013+OpenCV2.4.10提取傅里叶描述子特征
- VS2013+OPENCV2.4.10 提取HOG特征使用SVM多分
- OPENCV中团块跟踪
- 技小新-MQTT单片机编程小工具.zip
- Qt:实战小程序源代码
- OpenCV.3.Computer.Vision.Application.Programmi
- opencv车牌识别
- 亚马逊棋Qt源代码和可执行程序
- 基于QT设计的网络音乐播放器
- FFmpeg+qt实现的播放器工程
- QT5.7 + OPENCV3.2 + 动态条形码识别
- 手把手Qt串口调试助手开发源码
- qt温湿度上位机源码
- 颜色识别中各颜色阈值快速查找小程
- opencv已经编译好直接可以用的连接库
- opencv双目通过特征提取恢复深度
评论
共有 条评论