函数功能:画圆

语法:

viscircles(centers,radii)
viscircles(ax,centers,radii)
viscircles(___,Name,Value)
h = viscircles(___)

描述:

viscircles(centers,radii) draws circles with specified centers and radii onto the current axes.

viscircles(centers,radii) 将具有指定中心和半径的圆绘制到当前轴上。

举例:

1.read the image into the workspace and display it.

将图像读入工作区并进行显示。

A = imread('circlesBrightDark.png');
imshow(A)

define the radius range.

定义半径范围。

Rmin = 30;
Rmax = 65;

find all the bright circles in the image within the radius range.

在定义的半径范围内找到图像中所有明亮的圆圈。

[centersBright, radiiBright] = imfindcircles(A,[Rmin Rmax],'ObjectPolarity','bright');

find all the dark circles in the image within the radius range.

在定义的半径范围内找到图像中的所有暗眼圈。

[centersDark, radiiDark] = imfindcircles(A,[Rmin Rmax],'ObjectPolarity','dark');

draw red lines around the edges of the bright circles.

在明亮的圆圈边缘画一条红线。

viscircles(centersBright, radiiBright,'Color','r');

draw red dashed lines around the edges of the dark circles.

围绕暗圆的边缘绘制红色虚线。

viscircles(centersDark, radiiDark,'LineStyle','--');

2.viscircles(ax,centers,radii) draws circles onto the axes specified by ax.

viscircles(ax,centers,radii) 把圆画到指定的轴上。

举例:

the viscircles function does not clear the target axes before plotting circles. to remove circles that have been previously plotted in an axes, use the cla function. to illustrate, this example creates a new figure and then loops, drawing a set of circles with each iteration, clearing the axes each time.

在绘制圆之前,viscircles不去除目标轴。若要删除以前在轴中绘制的圆圈,请使用CLA函数。为了举例说明,这个示例创建一个新的图形,然后循环,用每次迭代绘制一组圆圈,每次清除轴。

figure
colors = {'b','r','g','y','k'}; % for k = 1:5
% Create 5 random circles to display,
X = rand(5,1);
Y = rand(5,1);
centers = [X Y];
radii = 0.1*rand(5,1); % Clear the axes.
cla % Fix the axis limits.
xlim([-0.1 1.1])
ylim([-0.1 1.1]) % Set the axis aspect ratio to 1:1.
axis square % Set a title.
title(['k = ' num2str(k)]) % Display the circles.
viscircles(centers,radii,'Color',colors{k}); % Pause for 1 second.
pause(1)
end

https://ww2.mathworks.cn/help/images/ref/viscircles.html

matlab之viscircles()函数的更多相关文章

  1. matlab中patch函数的用法

    http://blog.sina.com.cn/s/blog_707b64550100z1nz.html matlab中patch函数的用法——emily (2011-11-18 17:20:33) ...

  2. Matlab基本函数-conj函数

    Matlab基本函数-conj函数 1.conj函数:用于计算复数的共轭值 2.用法说明:y=conj(x)函数计算复数x的共轭值.输出结果y的维数跟输入x的维数一致,返回值为:real(y)-i*i ...

  3. 【原创】Matlab.NET混合编程技巧之找出Matlab内置函数

                  本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新    Matlab和C#混合编程文章目录 :[目录]Matlab和C#混合编程文章目录 Matlab与.N ...

  4. 【原创】Matlab.NET混合编程技巧之直接调用Matlab内置函数

                  本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新    Matlab和C#混合编程文章目录 :[目录]Matlab和C#混合编程文章目录 在我的上一篇文章[ ...

  5. matlab画图形函数 semilogx

    matlab画图形函数 semilogx loglog 主要是学习semilogx函数,其中常用的是semilogy函数,即后标为x的是在x轴取对数,为y的是y轴坐标取对数.loglog是x y轴都取 ...

  6. 【matlab】设定函数默认参数

    C++/java/python系列的语言,函数可以有默认值,通常类似如下的形式: funtion_name (param1, param2=default_value, ...) 到了matlab下发 ...

  7. matlab中subplot函数的功能

    转载自http://wenku.baidu.com/link?url=UkbSbQd3cxpT7sFrDw7_BO8zJDCUvPKrmsrbITk-7n7fP8g0Vhvq3QTC0DrwwrXfa ...

  8. Matlab:max函数

    Matlab中max函数在矩阵中求函数大小的实例如下: C = max(A)返回一个数组各不同维中的最大元素.如果A是一个向量,max(A)返回A中的最大元素.如果A是一个矩阵,max(A)将A的每一 ...

  9. 【原创】Matlab中plot函数全功能解析

    [原创]Matlab中plot函数全功能解析 该帖由Matlab技术论(http://www.matlabsky.com)坛原创,更多精彩内容参见http://www.matlabsky.com 功能 ...

随机推荐

  1. nginx 内置变量大全

    HTTP核心模块支持一些内置变量,变量名与apache里的对应.比如 $http_user_agent,$http_cookie等表示HTTP请求信息的变量.更多变量:$args, 请求中的参数; $ ...

  2. Oracle的substr函数简单用法与substring区别

    substr(字符串,截取开始位置,截取长度) //返回截取的字 substr('Hello World',0,1) //返回结果为 'H'  *从字符串第一个字符开始截取长度为1的字符串 subst ...

  3. HTML DOM节点的增删改查

    上篇博客中,我们已经初步接触了DOM基础,可是我们学习是为了可以更好地应用,今天我们就来看看DOM节点的增删改查. 无论在哪里,我们想要操作一个东西,总是应该先去获得它.那么我们怎么获得呢? HTML ...

  4. Harbor的搭建(vmware企业级docker镜像私服)

    1.下载harbor,地址https://github.com/vmware/harbor2.进入harbor-master/Deploy目录,修改harbor.cfg文件,主要修改以下信息      ...

  5. eclipse配置python插件

    eclipse配置python主要可以分为以下几个步骤完成: 1. 安装python,python主要有两个版本,python2和python3,这里安装的是python2.7.主要考虑python使 ...

  6. nginx与apache的区别

    Web服务器 Web服务器也称为WWW(WORLD WIDE WEB)服务器,主要功能是提供网上信息浏览服务. 应用层使用HTTP协议. HTML文档格式. 浏览器统一资源定位器(URL). Web服 ...

  7. 嵌入式开发之simulation--- 双目移动dsp机器人

    http://foundy.blog.163.com/blog/static/263383442014112391130207/

  8. Ant自己主动编译打包&公布 android项目

    Eclipse用起来尽管方便,可是编译打包android项目还是比較慢,尤其将应用打包公布到各个渠道时,用Eclipse手动打包各种渠道包就有点不切实际了,这时候我们用到Ant帮我们自己主动编译打包了 ...

  9. 记录-阿里云Oss文件上传

    public class OssUtil { /** * 上传图片 * @param file * @param request * @return */ public static Map<S ...

  10. Eclipse下使用maven搭建多模块项目

    暂时将项目分为如下几层: domain(域模型层).dao(数据库访问层).service(业务逻辑层).web(表现层),有需要再另行添加(如common等): 目录结构: 一.app 该层为父层, ...