[cv] linearity and convolution

Linearity:

An operator or system H is linear if two properties hold:

1. Additivity:

    H(f1+f2) = H(f1) + H(f2)

2. scaling  multiplicative

    H(a*f1) = a*H(f1)

where f1, f2 are functions, a is a constant.


impulse function: 

an idealized function whose area is 1.

its width is near to 0, but its height is +inf.


impulse response:



correlation and convolution


if filter is symmetric, the correlation filter and convolution filter is the same.


shift invariant - property of convolution operation


also, convolution is a linear operation.


at sometimes, filter is separable.



Boundary issues

full : dimensions of  output image becames larger.

same: dimensions of output image remain the same.

valid: dimensions of output image decreased



% Explore edge options
pkg load image;

%% Load an image
img = imread('fall-leaves.png');  % also available: peppers.png, mandrill.png
imshow(img);


%% Create a Gaussian filter
height = 15;
sigma =  2;

filter_g = fspecial('gaussian', height, sigma);


%% 
out_img = imfilter(img,filter_g,'symmetric'); % 0 replicate, circular, symmetric
imshow(out_img);
origin image:



fill zeros:


circular:


symmetric



sharpen filter


加倍的像素值减去周围像素信息可以将图片锐化。

unsharp mask makes picture sharper.



median filter



% Apply a median filter
pkg load image;

%% Read an image
img = imread('moon.png');  % also try: brooklyn-bridge.png, penny-farthing.png
imshow(img);

%% Add salt & pepper noise
noiseimg = imnoise(img, 'salt & pepper', 2);
imshow(noiseimg);
img1 = medfilt2(noiseimg); % add median filter
imshow(img1);



全部评论

相关推荐

02-12 20:22
重庆大学 Java
字节暑期刚入职四天,因为是年前,所以很多正职都放假走了,也就没有给我分配mt,然后有一个老哥在我来的时候给我发了一个landing手册,然后还有关于部门业务的白皮书,还有一些业务代码。然后本人是java面的,进来第一次接触go语言 前面几天熟悉了一下go的语法和go的框架,可以读但是还不太会写,然后业务白皮书也看的很头疼,包括landing手册里要了解的很多东西说实话我看文档真的快看死了,一个嵌套一个,问题是我还完全不知道咋用这个我了解的东西,还有就是那个项目代码,那个老哥喊我去写写单测,熟悉一下go的语法,但也进行的很困难(这是我第一段实习,之前都是springboot那一套,真不太熟悉这个)想问问大家的建议,就是我从现在开始到在开年回来之前应该做些什么,我目前就一个想法 就是复现一个landing手册上的go框架小项目 就是相当于帮自己锻炼锻炼怎么写go 或者各位大佬有没有更好的锻炼go语法的建议还有就是大家都在说vibe coding,那我应该怎么锻炼自己使用ai的能力,感觉我除了给一些需求然后它给我生成代码,好像就没别的用法了,那些什么工作流、拆解、skill啥的都不知道从哪一个地方开始,包括我现在正在实习,不知道精力该怎么分配,去网上想找找关于agent开发的一些学习流程,说实话,众说纷纭,有的是从python开始打基础然后系统学那些rag prompt langchain mcp等等,有的是说直接找一个github上的ai项目然后反复问ai,我确实有点迷茫,恳求各位大佬能留下你们宝贵的建议,我一定认真反复深刻学习有一说一 我觉得字节饭挺好吃的!
Jasonnnnnn...:直接把项目代码喂给AI然后让它帮你分析,如果组里已经有一些流程图总结的话最好,没有的话自己画一个 Go的话其实只要把基础语法搞明白就行了,项目里很多都是直接让ai帮你写好然后自己稍微改下,不用学的特别深 ai的话,可以自己写一些md文件来搞点小东西,但除非你打算转算法,否则不用把rag langchain学的特别深,了解下就行了
字节跳动公司福利 1371人发布
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务