【问题标题】:MATLAB vision.ShapeInserter() function gives warning about CustomBorderColor attributeMATLAB vision.ShapeInserter() 函数给出有关 CustomBorderColor 属性的警告
【发布时间】:2015-05-14 17:47:40
【问题描述】:

我正在尝试创建两个形状以插入视频帧。每当

blueBox = vision.ShapeInserter('Shape','Rectangles',...
                          'BorderColor','Custom',...
                          'CustomBorderColor',uint8([0 0 255]));

greenCircle = vision.ShapeInserter('Shape','Circles',...
                          'BorderColor','Custom',...
                          'Fill', true,...
                          'CustomBorderColor',uint8([200 255 50]));

每当我运行脚本时,MATLAB 都会警告我 CustomBorderColor 属性。奇怪的是,它为greenCircle 而不是blueBox 提供警告信息。

警告:CustomBorderColor 属性与此无关 系统对象的配置。

在 C:\Program Files\MATLAB\R2012a\toolbox\matlab\system+matlab+system\pvParse.p>pvParse 在 25 在 C:\Program 文件\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.parseInputs 在 639 在 C:\Program 文件\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.setProperties 在 138 在 C:\Program 文件\MATLAB\R2012a\toolbox\vision\vision+vision\ShapeInserter.p>ShapeInserter.ShapeInserter 254

然后我尝试将代码更改如下:

greenCircle =vision.ShapeInserter('Shape','Circles', ...
                                  'Fill', true, ...
                                  'FillColor', 'Custom', ...
                                  'CustomFillColor', uint8([0 1 3]), ...
                                  'BorderColor','Custom', ...
                                  'CustomBorderColor',uint8([200 255 50])); 

但仍然收到警告消息:

警告:CustomBorderColor 属性与此无关 系统对象的配置。

在 C:\Program Files\MATLAB\R2012a\toolbox\matlab\system+matlab+system\pvParse.p>pvParse 在 25 在 C:\Program 文件\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.parseInputs 在 639 在 C:\Program 文件\MATLAB\R2012a\toolbox\matlab\system+matlab+system\SystemProp.p>SystemProp.setProperties 在 138 在 C:\Program 文件\MATLAB\R2012a\toolbox\vision\vision+vision\ShapeInserter.p>ShapeInserter.ShapeInserter 254

这是什么原因?

【问题讨论】:

    标签: matlab computer-vision matlab-cvst


    【解决方案1】:

    您收到此警告是因为您将'Fill' 设置为true 以获取greenCircle。您可以使用'FillColor''CustomFillColor' 设置实心圆的颜色。

    此外,如果您有 MATLAB R2014a 或更高版本,则可以使用 insertShape 函数而不是 vision.ShapeInserter。该功能更易于使用。

    【讨论】:

    • 这是否意味着我不能有一个黄色边框的红色圆圈?
    • 如果您使用两个形状插入器,您可以。首先你画一个实心的红色圆圈,然后在它上面画一个空心的黄色圆圈。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    • 2012-09-05
    • 2018-10-30
    • 2013-10-08
    • 1970-01-01
    相关资源
    最近更新 更多