Changeset 497 for trunk/src/read_image.m


Ignore:
Timestamp:
Jul 21, 2012, 11:15:52 PM (9 years ago)
Author:
sommeria
Message:

cleaning and small bug repair.
pb of histogram for filter data solved
display of uicontrol by right mouse selection improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_image.m

    r493 r497  
    1 %--read images or video objects
    2 function [A,ParamOut]=read_image(FileName,FileType,VideoObject,num)
    3 %------------------------------------------------------------------------
    4 %num is the view number needed for an avi movie
    5 ParamOut=VideoObject;%default
     1%'read_image': read images or video objects
     2%----------------------------------------------------------------------
     3% function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num)
     4%
     5% OUTPUT:
     6% A(npy,npx,rgb): matrix of integers (iunt8 or uint16) representing the image, with sizes npy, npx, and possibly color component rgb=1:3
     7% ObjectOut: video object (=[] for images)
     8%
     9% INPUT:
     10% FileName: input file name
     11% FileType: input file type, as determined by the function get_file_type.m
     12% VideoObject: video object (for faster reading if availlable)
     13% num: frame index for movies or multimage types
     14%
     15function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num)
     16%-----------------------------------------------------------------------
     17if ~exist('VideoObject','var')
     18    VideoObject=[];
     19end
     20if ~exist('num','var')
     21    num=1;
     22end
     23ObjectOut=VideoObject;%default
    624switch FileType
    725         case 'video'
     
    927                A=read(VideoObject,num);
    1028            else
    11                 ParamOut=VideoReader(FileName);
    12                 A=read(ParamOut,num);
     29                ObjectOut=VideoReader(FileName);
     30                A=read(ObjectOut,num);
    1331            end
    1432        case 'mmreader'
     
    1634                A=read(VideoObject,num);
    1735            else
    18                 ParamOut=mmreader(FileName);
    19                 A=read(ParamOut,num);
     36                ObjectOut=mmreader(FileName);
     37                A=read(ObjectOut,num);
    2038            end
    2139    case 'multimage'
Note: See TracChangeset for help on using the changeset viewer.