Read VIVID VRML-file fname : VIVID VRML-file name V : 3D-Coordinate : [Npoint 3] [mm] X : 2D X-Coordinate : [Npoint 1] [pixcel] Y : 2D Y-Coordinate : [Npoint 1] [pixcel] F : Patch index : [Npatch Nnode] img : 2D RGB image : [NX NY 3] Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [V,F,img,X,Y] = vb_read_vivid_file(fname) 0002 % Read VIVID VRML-file 0003 % 0004 % fname : VIVID VRML-file name 0005 % 0006 % V : 3D-Coordinate : [Npoint 3] [mm] 0007 % X : 2D X-Coordinate : [Npoint 1] [pixcel] 0008 % Y : 2D Y-Coordinate : [Npoint 1] [pixcel] 0009 % F : Patch index : [Npatch Nnode] 0010 % img : 2D RGB image : [NX NY 3] 0011 % 0012 % Copyright (C) 2011, ATR All Rights Reserved. 0013 % License : New BSD License(see VBMEG_LICENSE.txt) 0014 0015 % Read VRML 3D-Coordinate 0016 V = vb_read_vrml_coordinate3(fname); 0017 F = vb_read_vrml_patch(fname); 0018 0019 % Read VRML 2D-Coordinate 0020 V2 = vb_read_vrml_coordinate2(fname); 0021 0022 if isempty(V2), 0023 X=[];Y=[];img=[]; 0024 return; 0025 end; 0026 0027 % Read VRML 2D-Image 0028 [img1,img2,img3] = vb_read_vrml_image(fname); 0029 0030 % img1(Nx, Ny) : R color image 0031 % img2(Nx, Ny) : G color image 0032 % img3(Nx, Ny) : B color image 0033 0034 % Exchange X-Y for MATLAB image plot 0035 img = cat(3,img1',img2',img3'); 0036 0037 % Scale 2D-Coordinate to Image size 0038 [NX, NY] = size(img1); 0039 0040 X = V2(:,1)*NX; 0041 Y = V2(:,2)*NY;