基于qml创建最简单的图像处理程序(1)-基于qml创建界面
《基于qml创建最简单的图像处理程序》系列课程及配套代码
基于qml创建最简单的图像处理程序(1)-基于qml创建界面
http://www.cnblogs.com/jsxyhelu/p/8343310.html
课程1附件
https://files.cnblogs.com/files/jsxyhelu/%E9%98%B6%E6%AE%B5%E4%BB%A3%E7%A0%811.zip
基于qml创建最简单的图像处理程序(2)-使用c++&qml进行图像处理
http://www.cnblogs.com/jsxyhelu/p/8361441.html
课程2附件
https://files.cnblogs.com/files/jsxyhelu/%E9%98%B6%E6%AE%B5%E4%BB%A3%E7%A0%812.zip
基于qml创建最简单的图像处理程序(3)-使用opencv&qml进行图像处理
http://www.cnblogs.com/jsxyhelu/p/8361443.html
课程3附件
https://files.cnblogs.com/files/jsxyhelu/%E9%98%B6%E6%AE%B5%E4%BB%A3%E7%A0%813.zip
为什么使用QT,包括进一步使用QML?两个主要原因,一是因为我是一个c++程序员,有语言使用惯性;二是我主要做图像处理方面工作,使用什么平台对于我来说不重要,我只需要在不同平台上面能够运行我的图像处理程序(而主要是和OpenCV有关系的)。所以选择QT,它能够在win/linux/android,包括PI上面都提供不错的GUI支持;而如果我想在Android上编写图像处理程序,又主要遇到两个问题,一是相机的获取。OpenCV的videocapture在Android上支持不好,在最新版本的OpenCV里面已经把这个部分相关内容去掉了,同时QCamera(基于widget的camera)支持也不好,Qml是目前对Android支持最好的。这个地方QML提供的camera功能就类似windows中的dshow一样,是一个基础类库;二是界面的创建,在windows下面,基于ribbon等,我能够创建还说的过去的界面,但是在Android中,目前没有很好的工具。特别是在手机这个小小界面中,如果界面有问很影响使用。
import QtQuick.Window .
Window {
visible
height
}
import QtQuick.Window .
import QtQuick.Controls .
import QtQuick.Dialogs .
import QtQuick.Controls.Styles .
Window {
visible
height
;
}
;
implicitHeight;
border.width ;
border.color;
gradient ; color ; color;
anchors.right;
color.;
}
;
anchors.top;
onClicked;
}
;
anchors.bottom;
}
;
anchors.bottom;
color.;
}
;
anchors.bottom;
rows;
columns;
rowSpacing;
columnSpacing;
z;
//柔化效果
Button {
text: "柔化";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Soften);
}
}
//灰度效果
Button {
text: "灰度";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Gray);
}
}
//浮雕效果
Button {
text: "浮雕";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Emboss);
}
}
//黑白效果
Button {
text: "黑白";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Binarize);
}
}
}
}
visible
height
//RGB
color: "#0000FF";
……
}
//状态显示Label
Label {
id: stateLabel;
visible: false;
anchors.centerIn: parent;
}
Image {
objectName: "imageViewer";
id: imageViewer;
asynchronous: true;
anchors.fill: parent;
fillMode: Image.PreserveAspectFit;
//根据imageviewer状态判断,控制控件表现出不同状态
onStatusChanged: {
if (imageViewer.status === Image.Loading) {
busy.running = true;
stateLabel.visible = false;
}
else if(imageViewer.status === Image.Ready){
busy.running = false;
}
else if(imageViewer.status === Image.Error){
busy.running = false;
stateLabel.visible = true;
stateLabel.text = "ERROR";
}
}
}
FileDialog {
id: fileDialog;
title: "Please choose a file";
nameFilters: ["Image Files (*.jpg *.png *.gif)"];
onAccepted: {
console.log(fileDialog.fileUrl);
imageViewer.source = fileDialog.fileUrl;
}
}
implicitHeight;
border.width ;
border.color;
gradient ; color ; color;
anchors.top;
onClicked;
}
;
anchors.bottom;
}
anchors.bottom;
rows;
columns;
rowSpacing;
columnSpacing;
z;
//柔化效果
Button {
text: "柔化";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Soften);
}
}
//灰度效果
Button {
text: "灰度";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Gray);
}
}
//浮雕效果
Button {
text: "浮雕";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Emboss);
}
}
//黑白效果
Button {
text: "黑白";
style: btnStyle;
onClicked: {
//busy.running = true;
//processor.process(fileDialog.fileUrl, ImageProcessor.Binarize);
}
}
}
anchors.right;
color.;
}
anchors.bottom;
color.;
}



基于qml创建最简单的图像处理程序(1)-基于qml创建界面的更多相关文章
- 基于qml创建最简单的图像处理程序(3)-使用opencv&qml进行图像处理
<基于qml创建最简单的图像处理程序>系列课程及配套代码基于qml创建最简单的图像处理程序(1)-基于qml创建界面http://www.cnblogs.com/jsxyhelu/p/83 ...
- 基于qml创建最简单的图像处理程序(2)-使用c++&qml进行图像处理
<基于qml创建最简单的图像处理程序>系列课程及配套代码基于qml创建最简单的图像处理程序(1)-基于qml创建界面http://www.cnblogs.com/jsxyhelu/p/8 ...
- ASP.NET 创建WebService——简单例子
Web service是一个基于可编程的web的应用程序,用于开发分布式的互操作的应用程序,也是一种web服务 WebService的特性有以下几点: 1.使用XML(标准通用标记语言)来作为数据交互 ...
- 用Eclipse 创建一个 简单的 Maven JavaWeb 项目
使用Maven 创建一个简单的 javaWeb 项目: 本篇属于 创建 JavaWeb 项目的第三篇: 建议阅读本篇之前 阅读 用 Eclipse 创建一个简单的web项目 ;本篇是这这篇文章的基础 ...
- Highcharts创建一个简单的柱状图
新建一个html文件,将highcharts引入到你的页面后,通过两个步骤我们就可以创建一个简单的图表了. 1.创建div容器 在页面的 body部分创建一个div,并指定div 的 id,高度和宽度 ...
- 为基于OpenCV的图像处理程序编写界面—关于QT\MFC\CSharp的选择以及GOCW的介绍
基于OpenCV编写图像处理项目,除了算法以外,比较重要一个问题就是界面设计问题.对于c++语系的程序员来说,一般来说有QT/MFC两种考虑.QT的确功能强大,特别是QML编写andr ...
- 【4opencv】为基于OpenCV的图像处理程序编写界面—关于QT\MFC\CSharp的选择以及GOCW的介绍
基于OpenCV编写图像处理项目,除了算法以外,比较重要一个问题就是界面设计问题.对于c++语系的程序员来说,一般来说有QT/MFC两种考虑.QT的确功能强大,特别是QML编写andr ...
- 使用 ADD-ON SDK 开发 基于 Html JQuery 和 CSS 的 firefox 插件入门教程1: 创建一个简单的 Add-on
[本文转载自http://sixpoint.me/942/implementing-simple-addon/] 实现一个简单的插件 教程的这个部分带你使用 SDK 来实现, 运行并打包一个插件. 这 ...
- Docker容器技术-创建一个简单的Web应用
一.创建一个简单的Web应用 1.identicon 基于某个值而自动产生的图像,这个值是IP地址或用户名的散列值. 用途: 通过计算用户名或IP地址的散列值,在网站上提供用于识别用户的图像,以及自动 ...
随机推荐
- ububtu16.04下安装protobuf
重新下载protobuf,我下载的时最新的protobuf-all-3.5.1.tar.gz protobuf网址:https://github.com/google/protobuf/relea ...
- 极大既然估计和高斯分布推导最小二乘、LASSO、Ridge回归
最小二乘法可以从Cost/Loss function角度去想,这是统计(机器)学习里面一个重要概念,一般建立模型就是让loss function最小,而最小二乘法可以认为是 loss function ...
- rank() over,dense_rank(),row_number() 的区别
转自:https://jingyan.baidu.com/article/597035521ff2ec8fc107404b.html rank() over是的作用是查出指定条件后进行一个排名,但是有 ...
- Shuffle'm Up---poj3087
题目链接 题意:有两个字符串s1,s2:经过交叉问是否得到字符串s,不能输出-1,能就输出交叉的次数 每次重组的串都是s2开始,重新组合时,前面一半是s1,后一半s2: #include<std ...
- Python开发【笔记】:谁偷了我的内存?
内存占用 Sayings: 最近被线上程序内存泄漏的问题搞的挺头大(程序在运行中内存占用不断的扩大),便开始看python内存垃圾回收机制.弱引用.循环引用相关的文章,着重查了一下自己的程序是不是真的 ...
- MySQL如何开启慢查询
一 简介 开启慢查询日志,可以让MySQL记录下查询超过指定时间的语句,通过定位分析性能的瓶颈,才能更好的优化数据库系统的性能. 二 参数说明 slow_query_log 慢查询开启状态 slo ...
- go-001-环境部署,IDEA插件
一.下载安装 https://golang.org/dl/ 下载之后安装即可 官网地址:https://golang.org/ 1.1.mac上安装go 1.安装Homebrew 安装命令: ruby ...
- string、const char*、 char* 、char[]相互转换(待整理)
string.const char*. char* .char[]相互转换(全) https://blog.csdn.net/rongrongyaofeiqi/article/details/5244 ...
- (转)Linux Oracle服务启动&停止脚本与开机自启动
在CentOS 6.3下安装完Oracle 10g R2,重开机之后,你会发现Oracle没有自行启动,这是正常的,因为在Linux下安装Oracle的确不会自行启动,必须要自行设定相关参数,首先先介 ...
- Quick Look at the Air Jordan 32
A color with 25 years of history in the Air Jordan line will once again leave its mark on the Air Jo ...