【问题标题】:How can I create a pixel labelled image for Semantic Segmentation?如何为语义分割创建像素标记图像?
【发布时间】:2019-04-24 13:24:12
【问题描述】:

我正在关注 MathWorks 的 Semantic Segmentation Examples 教程。

我知道我可以加载带有像素标签的图像

pxDir = fullfile(dataDir,'buildingPixelLabels');

定义类名。

classNames = ["sky" "grass" "building" "sidewalk"];

为每个类名定义标签 ID。

pixelLabelID = [1 2 3 4];

并创建一个 pixelLabelDatastore。

pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);

但是,我如何创建自定义像素标记图像,其中每个像素值都代表该像素的分类标签?

然后我会继续写:

pxDir = fullfile(dataDir,'myCustomPixelLabels');

如果我理解正确,imageDatastore 包含实际图像,而不是该图像的像素标签。


编辑:

在我的系统上pxDir 指向'C:\Program Files\MATLAB\R2017a\toolbox\vision\visiondata\buildingPixelLabels'。由于我使用的是 Matlab2017a,因此默认情况下不包含此示例,我无法比较或查看文件以更好地了解重现此示例需要做什么。

【问题讨论】:

  • 这不是教程在您从中获得的最后一行之后所做的吗?
  • 实际上,这正是pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);发生的事情
  • @NoumanRiazKhan 但pxDir 加载像素标记的图像,这就是我要问的。如何创建myCustomPixelLabels
  • @AnderBiguri 所以 imds = imageDatastore(imDir);代表我需要标记像素的图像数据?这会是什么样子,因为imageDatastore 通常用于管理图像文件的集合。
  • @AnderBiguri imageDatastore 包含实际图像,而不是该图像的像素标签。

标签: image matlab image-processing machine-learning computer-vision


【解决方案1】:

答案可以在here找到。

Matlab 2017a

转到APPS标签,然后搜索Image Labeler或Training Image Labeler

点击Add Images 添加您的训练图像。

点击Add ROI Labels为感兴趣的区域添加类名。

继续从上传的图像中手动选择感兴趣的区域。

选择区域后,可以将数据作为 Ground Truth 对象导出到工作区。

【讨论】:

    猜你喜欢
    • 2023-03-13
    • 2018-05-12
    • 1970-01-01
    • 2021-01-05
    • 2017-07-03
    • 2017-07-24
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多