首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    matlab 马赫带效应,matlab图像处理基础实例

    ·边缘检测(edge)边缘检测时先要把其他格式图像转化为灰度图像>> f=imread( lbxx.bmp );>> a=rgb2gray(f);>> [g,t]=edge(a, canny );>> imshow(g)·剪贴(imcrop)、subplot 等imfinfo colormap subimageimadd imsubtract immultiply imdivideimresize imrotate(旋转)>> a=imread( onion.png );>> b=imcrop(a,[75 68 130 112]);% I2 = IMCROP(I,RECT)% RECT is a 4-element vector with the [XMIN YMIN WIDTH HEIGHT];% subplot(121)一行两列的显示,当前显示第一个图片>> subplot(121);imshow(a);>> subplot(122);imshow(b);·roipoly选择图像中的多边形区域>> a=imread( onion.png );>> c=[200 250 278 248 199 172];>> r=[21 21 75 121 121 75];>> b=roipoly(a,c,r);>> subplot(121);imshow(a);>> subplot(122);imshow(b);·roicolor按灰度值选择的区域>> a=imread( onion.png );>> i=rgb2gray(a);>> b=roicolor(i,128,255);>> subplot(121);imshow(a);>> subplot(122);imshow(b);·转化指定的多边形区域为二值掩膜poly2mask>> x=[63 186 54 190 63];>> y=[60 60 209 204 60];>> b=poly2mask(x,y,256,256);>> imshow(b);>> holdCurrent plot held>> plot(x,y, b , LineWidth ,2)·roifilt2区域滤波a=imread( onion.png );i=rgb2gray(a);c=[200 250 278 248 199 172];r=[21 21 75 121 121 75];b=roipoly(i,c,r);h=fspecial( unsharp );j=roifilt2(h,i,b);subplot(121),imshow(i);subplot(122),imshow(j);·roifill区域填充>> a=imread( onion.png );>> i=rgb2gray(a);>> c=[200 250 278 248 199 172];>> r=[21 21 75 121 121 75];>> j=roifill(i,c,r);>> subplot(211);imshow(i);>> subplot(212);imshow(j);·FFT变换f=zeros(100,100);f(20:70,40:60)=1;imshow(f);F=fft2(f);F2=log(abs(F));imshow(F2),colorbar·补零操作和改变图像的显示象限f=zeros(100,100);f(20:70,40:60)=1;subplot(121);imshow(f);F=fft2(f,256,256);F2=fftshift(F);subplot(122);imshow(log(abs(F2))) ·离散余弦变换(dct)>> a=imread( onion.png );>> i=rgb2gray(a);>> j=dct2(i);>> subplot(131);imshow(log(abs(j))),colorbar>> j(abs(j)> k=idct2(j);>> subplot(132);imshow(i);>> subplot(133);imshow(k,[0,255]);info=imfinfo( trees.tif )%显示图像信息·edge提取图像的边缘canny prewitt sobelradon 函数用来计算指定方向上图像矩阵的投影>> a=imread( onion.png );>> i=rgb2gray(a);>> b=edge(i);>> theta=0:179;>> [r,xp]=radon(b,theta);>> figure,imagesc(theta,xp,r);colormap(hot);>> xlabel( \theta(degrees) );>> ylabel( x\prime );>> title( r_{\theta}(x\prime) );>> colorb

    02

    一种精确从文本中提取URL的思路及实现

    在今年三四月份,我接受了一个需求:从文本中提取URL。这样的需求,可能算是非常小众的需求了。大概只有QQ、飞信、阿里旺旺等之类的即时通讯软件存在这样的需求。在研究这个之前,我测试了这些软件这块功能,发现它们这块的功能还是非常弱的。这类软件往往也是恶意URL传播的媒介,如果不能准确识别出URL,相应的URL安全检测也无从谈起。而且网上也有很多使用正则表达式的方法,可是我看了下,方法简单但是不够精确,对于要求不高的情况可以胜任,但是如果“坏人”想绕过这种提取也是很方便的。(转载请指明出处)下面也是我在公司内部做的一次分享的内容:

    02
    领券