- 博客(8)
- 资源 (11)
- 收藏
- 关注
原创 opencv—膨胀腐蚀
#include "opencv2/imgproc.hpp"#include "opencv2/imgcodecs.hpp"#include "opencv2/highgui.hpp"using namespace cv;Mat src, dst;int morph_elem = 0;int morph_size = 0;int morph_operator = 0;int const max_operator = 4;int const max_elem = 2;int const .
2020-08-31 21:37:27 194
转载 opencv—图像的平滑
其中包括了模糊,高斯模糊,中值滤波,双边滤波#include "opencv2/imgproc.hpp"#include "opencv2/imgcodecs.hpp"#include "opencv2/highgui.hpp"using namespace std;using namespace cv;int DELAY_CAPTION = 1500;int DELAY_BLUR = 100;int MAX_KERNEL_LENGTH = 31;Mat src; Mat dst;c
2020-08-31 19:43:55 125
原创 opencv学习—像素的读写
#include<iostream>#include<opencv2/opencv.hpp>using namespace std;using namespace cv;int main() { Mat pImg = imread("C:\\Users\\Lijian\\Desktop\\Lena.jpg"); //第一种方法 for (int i = 0; i < pImg.rows; ++i) { for (int j = 0; j < pIm.
2020-08-29 22:10:22 160
原创 opencv学习—选择图像的固定区域
opencv学习—选择图像的固定区域#include<iostream>#include<opencv2/opencv.hpp>using namespace std;using namespace cv;int main() { Mat pImg = imread("C:\\Users\\Lijian\\Desktop\\Lena.jpg"); Rect rect(200, 200, 200, 200); Mat roi = Mat(pImg, rect);
2020-08-29 17:10:56 450
原创 Pytorch学习-Variable变量
import torchfrom torch.autograd import Variabletensor=torch.FloatTensor([[1,2],[3,4]])Variable=Variable(tensor,requires_grad=True)t_out=torch.mean(tensor*tensor)V_out=torch.mean(Variable*Variable)#反向传播变量V_out.backward()#打印变量print(Variable)#梯度.
2020-08-21 20:47:58 187
原创 Pytorch学习—torch和numpy区别
torch和numpy之间是可以互相转化的,在使用torch形式的时候,我们需要把numpy转化为torch。import torchimport numpy as npnp_data=np.arange(6).reshape((2,3))torch_data=torch.from_numpy(np_data)tensor2array=torch_data.numpy()print( '\nnumpy',np_data, '\ntorch',torch_data, .
2020-08-21 20:32:45 1059
原创 matlab生成一个向量,前几个数和为固定值
function Out=funM=11;one=ones(1,11);k=12;B=cell(1,k);for i=1:kB{i}=zeros(1,k);end% b=zeros(1,12);for n=1:11 a{n}= rand(1, n); a{n}=a{n}/sum(a{n}).*5; out{n}=[a{n},zeros(1,M-length(a{n}))];endN=unidrnd(11);Out=out{N};endmatlab随机生.
2020-08-15 20:15:25 1146
原创 matlab图像的裁剪
1、指定位置裁剪%% 指定位置裁剪clcclear[I,map]=imread('bird.jpg');figure;subplot(121);imshow(I,map);%指定剪切区域的大小和位置,剪切,返回xy坐标和裁剪区域[x,y,I2,rect]=imcrop(I,map,[410 540 400 400]);%位置和区域大小subplot(122);imshow(I2);2、手动裁剪%% 手动裁剪clcclear[I,map]=imread('bird.j
2020-08-03 21:28:46 15975 1
计算机视觉—红绿灯检测
2020-10-23
tao2004.pdf
2019-10-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人