lhidrawregionmap.m

来自「This code can parse any image in matlab.」· M 代码 · 共 32 行

M
32
字号
function LHIDrawRegionMap (D, optfolder, HOMELABELMAPS)
%function LHIDrawSubgraphMap(D, optfolder, HOMELABELMAPS)
%
% This function output the subgraphmap
%
%  LHIDrawSubgraphMap(D, optfolder, HOMELABELMAP)
%
%    D:             database struct
%    optfolder:     output folder
%
% Example:
% LHIDrawSubgraphMap(LHIquery(D,'object.name', 'road'),'C:\folder\', HOMELABELMAP); 
% This will make black and white labelmap in 'C:\folder\' of 'road'
% category from database D (if there are any)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% UCLA_LHI Dataset
% http://www.imageparsing.com
% 
% CIVS, UCLA
% 2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Nimage = length(D);
%name = [];
for i = 1:Nimage,
    bgMap = LHILMread(D, i, HOMELABELMAPS);
    [height, width,nchannel]=size(bgMap);
    graphMat = zeros(height,width);
    graphMat = LHIdrawregion(D(i).annotation,graphMat);
    imwrite(graphMat,strrep(fullfile(optfolder,D(i).annotation.filename),'.jpg','_bmp.tif'));
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?