border

opencv:图像卷积

孤街醉人 提交于 2020-02-01 21:20:17
卷积基本概念 C++代码实现卷积 #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; int main(int argc, char** argv) { Mat src = imread("f:/images/lena.jpg"); if (src.empty()) { printf("Could not find the image!\n"); return -1; } namedWindow("input", WINDOW_AUTOSIZE); imshow("input", src); int h = src.rows; int w = src.cols; Mat result = src.clone(); for (int row = 1; row < h - 1; row++) { for (int col = 1; col < w - 1; col++) { // 3x3卷积核 int sb = src.at<Vec3b>(row, col)[0] + src.at<Vec3b>(row - 1, col - 1)[0] + src.at<Vec3b>(row - 1, col)[0] + src.at<Vec3b>(row - 1, col

图像处理基础(4):高斯滤波器详解

痞子三分冷 提交于 2020-02-01 17:11:32
本文主要介绍了高斯滤波器的原理及其实现过程 高斯滤波器是一种线性滤波器,能够有效的抑制噪声,平滑图像。其作用原理和均值滤波器类似,都是取滤波器窗口内的像素的均值作为输出。其窗口模板的系数和均值滤波器不同,均值滤波器的模板系数都是相同的为1;而高斯滤波器的模板系数,则随着距离模板中心的增大而系数减小。所以,高斯滤波器相比于均值滤波器对图像个模糊程度较小。 什么是高斯滤波器 既然名称为高斯滤波器,那么其和高斯分布(正态分布)是有一定的关系的。一个二维的高斯函数如下: \[ h(x,y) = e ^ {- \frac{x^2 + y^2}{2\sigma ^ 2}} \] 其中 \((x,y)\) 为点坐标,在图像处理中可认为是整数; \(\sigma\) 是标准差。要想得到一个高斯滤波器的模板,可以对高斯函数进行离散化,得到的高斯函数值作为模板的系数。例如:要产生一个 \(3 \times 3\) 的高斯滤波器模板,以模板的中心位置为坐标原点进行取样。模板在各个位置的坐标,如下所示(x轴水平向右,y轴竖直向下) 这样,将各个位置的坐标带入到高斯函数中,得到的值就是模板的系数。 对于窗口模板的大小为 \((2k + 1) \times (2k + 1)\) ,模板中各个元素值的计算公式如下: \[ H_{i,j} = \frac{1}{2\pi \sigma ^ 2}e ^{-\frac

WPF动态改变主题颜色

别说谁变了你拦得住时间么 提交于 2020-02-01 07:20:24
国内的 WPF 技术先行者 周银辉 曾介绍过 如何动态改变应用程序的主题样式 ,今天我们来介绍一种轻量级的改变界面风格的方式——动态改变主题色。 程序允许用户根据自己的喜好来对界面进行配色,这种技术在很多软件中都有应用,比如这款名为 AirPlay 的音乐播放器软件: 下面我们就来自己动手实现这种技术: 首先在 App.xaml 文件中定义一个键值为“ color ”的单色笔刷,这个笔刷就是可以被用户改变的动态资源: <SolidColorBrush x : Key = "color" Color = "SkyBlue" /> 然后来设计这样一个界面: 我们让用户通过 4 个滑块来分别定制颜色的 A 、 R 、 G 、 B 值,其完整代码为: <Grid> <Grid.RowDefinitions> <RowDefinition Height = "28" /> <RowDefinition Height = "28" /> <RowDefinition Height = "28" /> <RowDefinition Height = "28" /> <RowDefinition Height = "*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width = "65*" />

Vue造轮子-popover组件(下)

喜欢而已 提交于 2020-01-31 14:17:54
1. 上一次的问题总结。 overflow:hidden -> body.appendChild 关闭重复 -> 分开,document 只管外面,popover 只管里面 忘了取消监听 document -> 收拢 close 2. 可以把一个函数哟没有五行作为一个优化的标准,简称为五行定律 3. 接下来把样式改好点 .content-wrapper { // 如果写了scoped,popover里面那么就只作用于popover里面,移到外面就在外面了就可以 position: absolute; border: 1px solid $border-color; border-radius: $border-radius; filter: drop-shadow(0 0 1px rgba(0,0,0,0.5)); /*通过drop-shadow解决小三角没有阴影的问题,但是兼容性不好 */ /*box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);*/ background: white; transform: translateY(-100%); margin-top: -10px; padding: .5em 1em; max-width: 20em; word-break: break-all; &::before , &::after{

Vue造轮子-popover组件(下)

假装没事ソ 提交于 2020-01-31 13:34:20
1. 上一次的问题总结。 overflow:hidden -> body.appendChild 关闭重复 -> 分开,document 只管外面,popover 只管里面 忘了取消监听 document -> 收拢 close 2. 可以把一个函数哟没有五行作为一个优化的标准,简称为五行定律 3. 接下来把样式改好点 .content-wrapper { // 如果写了scoped,popover里面那么就只作用于popover里面,移到外面就在外面了就可以 position: absolute; border: 1px solid $border-color; border-radius: $border-radius; filter: drop-shadow(0 0 1px rgba(0,0,0,0.5)); /*通过drop-shadow解决小三角没有阴影的问题,但是兼容性不好 */ /*box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);*/ background: white; transform: translateY(-100%); margin-top: -10px; padding: .5em 1em; max-width: 20em; word-break: break-all; &::before , &::after{

Background image with a colored curved border at the bottom

倾然丶 夕夏残阳落幕 提交于 2020-01-30 13:04:29
问题 I am trying to achieve this with css3 , I tried using border-radius with percent values and it's not the same always, I always got a rounded corners and the border will start disappearing on the corners too. I want it to be exactly the same as the example image: EDIT: this is my html code : <div class='container-fluid'> <section class='section-1'> <div class='container'> </div> </section> And this is my css: .section-1 { background-image: url('../images/bg.png'); background-size: cover;

Background image with a colored curved border at the bottom

∥☆過路亽.° 提交于 2020-01-30 13:04:25
问题 I am trying to achieve this with css3 , I tried using border-radius with percent values and it's not the same always, I always got a rounded corners and the border will start disappearing on the corners too. I want it to be exactly the same as the example image: EDIT: this is my html code : <div class='container-fluid'> <section class='section-1'> <div class='container'> </div> </section> And this is my css: .section-1 { background-image: url('../images/bg.png'); background-size: cover;

圆角矩形

大憨熊 提交于 2020-01-30 09:29:28
border:redius:左上 右上 右下 左下; <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css" media="screen"> .box1 { width:150px; height:45px; border:1px solid blue; box-shadow: 1px 1px 1px 1px lightblue; border-radius: 10px 10px 10px 10px; margin-bottom: 60px; } .box2 { width:150px; height:45px; border:1px solid blue; box-shadow: 1px 1px 1px 1px lightblue; border-radius: 20px 20px 20px 20px; margin-bottom:60px; } .box3 { width:150px; height:45px; border:1px solid blue; box-shadow: 1px 1px 1px 1px lightblue; border-radius: 0 20px 0 0; margin-bottom:

CSS之三角形的制作

[亡魂溺海] 提交于 2020-01-30 00:45:01
用边框把宽高撑开,其他边设置为透明色或者背景色即可,再用position定位到任何地方去 < ! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < title > Title < / title > < style type = "text/css" > . box { width : 0 px ; height : 0 px ; border - right : 100 px solid transparent ; border - left : 100 px solid transparent ; border - top : 100 px solid transparent ; border - bottom : 100 px solid # 000000 ; } < / style > < / head > < body > < div class = "box" > < / div > < / body > < / html > 来源: CSDN 作者: 九层之台 始于垒土 链接: https://blog.csdn.net/dwjdj/article/details/104106399

css(五)之标准流

喜夏-厌秋 提交于 2020-01-30 00:09:36
文章目录 网页布局本质 css盒子模型 盒子组成 边框 内边距 外边距 嵌套块元素垂直外边距的塌陷 清除内外边距代码 圆角边框 盒子阴影 网页布局本质 网页布局就是由一个又一个的盒子组成的,盒子包括标准流,浮动和定位。 下面有个口诀: 列找标准流 行找浮动 飘动找定位 css盒子模型 网页布局的核心就是盒子。 盒子组成 边框 是由粗细,样式,颜色组成。 border : border-width | border-style | border-color 属性 作用 border-width 定义边框粗细,单位是px border-style 边框的样式 border-color 边框的颜色 border-style:solid(实线边框),dashed(虚线边框),dotted(点边框) border-color:red 复合写法: border : 3px solid red 内边距 设置盒子中的内容和边框的距离。 属性 作用 padding-left 左内边距 padding-right 右内边距 padding-top 上内边距 padding-bottom 下内边距 复合写法: 值的个数 表达意思 padding:5px; 1个值,代表上下左右都有5像素内边距 padding:5px 10px; 2个值,代表上下内边距是5像素,左右内边距是10像素; padding