加载中
OpenCV图像处理实例:使用vlfeat的SLIC Superpixel实现图像分割

SLIC Superpixel算法可以参考:https://www.cnblogs.com/supersponge/p/6546082.html #include <iostream> #include <opencv2/opencv.hpp> extern "C" { #include "vlfeat/generic.h" #incl...

09/27 20:58
24
OpenCV图像处理实例:libuv+cvui显示摄像头视频

#include <iostream> #include <opencv2/opencv.hpp> #define CVUI_IMPLEMENTATION #include <cvui.h> extern "C"{ #include <uv.h> } using namespace std; #define WINDOW_NAME "libuv cam...

09/26 01:22
20
Numpy图像处理快速入门2

1.导入需要的库 %matplotlib inline # 使用notebook时需要声明 import matplotlib.pyplot as plt import numpy as np import imageio as io import scipy import scipy.misc as sc 2.读取图像...

07/30 16:29
7
Numpy图像处理快速入门

1.导入必要的库 import numpy as np import scipy %matplotlib inline import matplotlib.pyplot as plt 2.加载图片 image = matplotlib.pyplot.imread('../datas/f4.jpg') #读入的是灰度图像...

07/05 22:54
98
Tensorflow学习笔记:图像处理

#coding:utf-8 ''' 图像处理 ''' import tensorflow as tf import numpy as np import cv2 # 读取图像文件方式 image_file = 'D:/Develop/DL/deeplearning-notes/datas/images/f2.jpg' jp...

Python OpenCV实例:图像腐蚀(数学公式基本实现)

#coding:utf-8 ''' 二值图像的腐蚀运算 定义: g(x,y) = erode[f(x,y),B] = AND[Bf(x,y)] 其中,g(x,y)为腐蚀后的二值图像,f(x,y)为原始二值图像 B为结构元素,Bf(x,y)定义为 ...

Python OpenCV实例:图像直方图均衡化(数学公式简单实现)

#coding:utf-8 ''' 直方图均衡化 作用:通常用来增加图像局部对比度,尤其在图像的有用数据的对比度相当 接近时,通过直方图均衡化,图像的亮度可以更好地在直方图上分布 基本思想:把...

Python OpenCV实例:直方图计算(数学公式简单实现)

#coding:utf-8 ''' 直方图 ''' import cv2 import numpy as np import matplotlib.pyplot as plt ''' 计算RGB图像每个通道的直方图 ''' def cal_histgram_rgb(image): image_rgb = cv2...

Python OpenCV实例:灰度图像线性运算

# coding:utf-8 ''' 灰度图像线性运算 公式:g(x,y) = p * f(x,y) + L 其中:f(x,y)为输入灰度图像像素值,g(x,y)为输出灰度图像像素值 参数:p = 1,L = 0,则复制图像; p > 1,则图像对...

Python OpenCV实例:图像灰度化(数学公式简单实现)

#coding:utf-8 ''' 图像灰度化 1、基本公式:Gray(i,j) = [R(i,j) + G(i,j) + B(i,j)] / 3 根据人眼对颜色的感知程度不同,衍生出第二个公式: Gray(i,j) = 0.299 * R(i,j) + 0.587 * G(i,j...

Python OpenCV实例:图像灰度拉伸

#coding:utf-8 ''' 灰度拉伸 定义:灰度拉伸,也称对比度拉伸,是一种简单的线性点运算。作用:扩展图像的 直方图,使其充满整个灰度等级范围内 公式: g(x,y) = 255 / (B - A) * [f(...

Python OpenCV实例:RGB图像底片效果

#coding:utf-8 ''' RGB图像底片效果 ''' import cv2 import numpy as np src = cv2.imread('datas/l1.jpg') dist = 255 - src cv2.imshow('src',src) cv2.imshow('dist',dist) cv2.wai...

Python OpenCV实例:马赛克效果

#coding:utf-8 ''' 马赛克效果 ''' import cv2 import numpy as np point_start = {'x':0,'y':0} point_end = {'x':0,'y':0} rows = 0 cols = 0 selected = False def mosaic(selected_...

Python实例:毛玻璃效果

#coding:utf-8 ''' 毛玻璃效果 ''' import cv2 import numpy as np src = cv2.imread('datas/images/f1.jpg') dst = np.zeros_like(src) rows,cols,_ = src.shape offsets = 5 random_num...

Python OpenCV实例:几何变换

#coding:utf-8 ''' 仿射变换 ''' import cv2 import numpy as np src = cv2.imread('datas/l1.jpg') rows,cols,channel = src.shape src_points = np.float32([[50,50],[200,50],[50,20...

Python OpenCV实例:图像翻转

#coding:utf-8 ''' 图像翻转 ''' import numpy as np import cv2 src = cv2.imread('datas/l1.jpg') # 逆时针旋转90度 result = cv2.transpose(src) # 垂直翻转 result2 = cv2.flip(src...

Python OpenCV实例:基于等间隔提取图像缩放和基于区域子块提取图像缩放

#coding:utf-8 ''' 图像缩放 ''' import numpy as np import cv2 image = cv2.imread('datas/l1.jpg') # 基于等隔提取图像缩放 def scale_simple(image,kx,ky): # 计算缩放后图像的分辨...

Python OpenCV实例:图像平移(数学公式简单实现)

#coding:utf-8 ''' 图像平移 ''' import numpy as np import cv2 image = cv2.imread('datas/l1.jpg') # 大小不改变,相当剪裁 def transform_without_change_size(image,xoffset,yoffse...

04/18 18:40
132
Python OpenCV实例:Gabor滤波器参数可视化

#coding:utf-8 ''' Gabor滤波器参数可视化 参考:https://blog.csdn.net/lhanchao/article/details/55006663 ''' import cv2 import numpy as np import math # λ(波长)变化 kernel1 ...

Python OpenCV实例:Schmid滤波

#coding:utf-8 ''' Schmid滤波 参考:https://blog.csdn.net/xiaowei_cqu/article/details/25131473 ''' import cv2 import numpy as np import math def schmid_kernel(tao,sigma): r...

没有更多内容

加载失败,请刷新页面

返回顶部
顶部