image processing

2012-01-11 07:51:40
 
        This is a Classroom License for instructional use only.
        Research and commercial use is prohibited.
>> 2+5

ans =

     7

>> 2=8
??? 2=8
     |
Error: The expression to the left of the equals sign is not a valid target for
an assignment.
 
>> A=[123;456]

A =

   123
   456

>> A=[1,2;3,4]

A =

     1 2
     3 4

>> A(2)

ans =

     3

>> A(1,2)

ans =

     2

>> help reshape
 RESHAPE Reshape array.
    RESHAPE(X,M,N) returns the M-by-N matrix whose elements
    are taken columnwise from X. An error results if X does
    not have M*N elements.
 
    RESHAPE(X,M,N,P,...) returns an N-D array with the same
    elements as X but reshaped to have the size M-by-N-by-P-by-...
    M*N*P*... must be the same as PROD(SIZE(X)).
 
    RESHAPE(X,[M N P ...]) is the same thing.
 
    RESHAPE(X,...,[],...) calculates the length of the dimension
    represented by [], such that the product of the dimensions
    equals PROD(SIZE(X)). PROD(SIZE(X)) must be evenly divisible
    by the product of the known dimensions. You can use only one
    occurrence of [].
 
    In general, RESHAPE(X,SIZ) returns an N-D array with the same
    elements as X but reshaped to the size SIZ. PROD(SIZ) must be
    the same as PROD(SIZE(X)).
 
    See also squeeze, shiftdim, colon.

    Overloaded methods:
       gf/reshape
       InputOutputModel/reshape
       categorical/reshape
       sym/reshape

    Reference page in Help browser
       doc reshape

>> A=[1 2 3;4 5 6;7 8 9]

A =

     1 2 3
     4 5 6
     7 8 9

>> B=reshape[A,1,9]
??? B=reshape[A,1,9]
             |
Error: Unbalanced or unexpected parenthesis or bracket.
 
>> B=reshape(A,1,9)

B =

     1 4 7 2 5 8 3 6 9

>> C=[1,2,3,4;9,6,7,8;9,1,4,2;6,0,5,1]

C =

     1 2 3 4
     9 6 7 8
     9 1 4 2
     6 0 5 1

>> D=reshape(C,8,2)

D =

     1 3
     9 7
     9 4
     6 5
     2 4
     6 8
     1 2
     0 1

>> B=C>3

B =

     0 0 0 1
     1 1 1 1
     1 0 1 0
     1 0 1 0
>> images(B)
??? Undefined function or method 'images' for input arguments of type
'logical'.
 
>> imagesc(B)
>> F=[1,0,0,1;0,0,0,0;0,0,0,0;1,0,0,1]

F =

     1 0 0 1
     0 0 0 0
     0 0 0 0
     1 0 0 1

>> imagesc(F)
>> colormap('gray')
>> colormap('gray')
>> colormap('summer')
>> colormap('cool')
>> colormap('hot')
>>
>> ones(3,4)

ans =

     1 1 1 1
     1 1 1 1
     1 1 1 1

>> zeros(3,3)

ans =

     0 0 0
     0 0 0
     0 0 0

>> A=zeros(50,50);
>> A(10:40,10:20)=1;
>> A(30:40,20:40)=1;
>> imagesc(A)
>> colormap('gray')
>>
>> for i=1:60
for j=1:60
A(i,j)=i/100.0+j/100.0;
end
end
>> imagesc(A)
>> colormap('gray')
>> impixelinfo
>> img=imread('C:\Users\cpeng1\Desktop\01_800x600.jpg');
>> imshow(img);
>> impixelinfo;
>> imfinfo;
??? Error using ==> imfinfo at 75
Not enough input arguments.
 
>> help iminfo

iminfo not found.

Use the Help browser search field to search the documentation, or
type "help help" for help command options, such as help for methods.

>> imfinfo('C:\Users\cpeng1\Desktop\01_800x600.jpg')

ans =

           Filename: 'C:\Users\cpeng1\Desktop\01_800x600.jpg'
        FileModDate: '10-Jan-2012 20:31:23'
           FileSize: 178889
             Format: 'jpg'
      FormatVersion: ''
              Width: 800
             Height: 600
           BitDepth: 24
          ColorType: 'truecolor'
    FormatSignature: ''
    NumberOfSamples: 3
       CodingMethod: 'Huffman'
      CodingProcess: 'Sequential'
            Comment: {}

>> help imfinfo
 IMFINFO Information about graphics file.
    INFO = IMFINFO(FILENAME,FMT) returns a structure whose
    fields contain information about an image in a graphics
    file. FILENAME is a string that specifies the name of the
    graphics file, and FMT is a string that specifies the format
    of the file. The file must be in the current directory or in
    a directory on the MATLAB path. If IMFINFO cannot find a
    file named FILENAME, it looks for a file named FILENAME.FMT.
    
    The possible values for FMT are contained in the file format
    registry, which is accessed via the IMFORMATS command.
 
    If FILENAME is a TIFF, HDF, ICO, GIF, or CUR file containing more
    than one image, INFO is a structure array with one element for
    each image in the file. For example, INFO(3) would contain
    information about the third image in the file.
 
    INFO = IMFINFO(FILENAME) attempts to infer the format of the
    file from its content.
 
    INFO = IMFINFO(URL,...) reads the image from an Internet URL.
    The URL must include the protocol type (e.g., "http://").
 
    The set of fields in INFO depends on the individual file and
    its format. However, the first nine fields are always the
    same. These common fields are:
 
    Filename A string containing the name of the file
 
    FileModDate A string containing the modification date of
                   the file
 
    FileSize An integer indicating the size of the file in
                   bytes
 
    Format A string containing the file format, as
                   specified by FMT; for formats with more than one
                   possible extension (e.g., JPEG and TIFF files),
                   the first variant in the registry is returned
 
    FormatVersion A string or number specifying the file format
                   version
 
    Width An integer indicating the width of the image
                   in pixels
 
    Height An integer indicating the height of the image
                   in pixels
 
    BitDepth An integer indicating the number of bits per
                   pixel
 
    ColorType A string indicating the type of image; this could
                   include, but is not limited to, 'truecolor' for a
                   truecolor (RGB) image, 'grayscale', for a grayscale
                   intensity image, or 'indexed' for an indexed image.
 
    If FILENAME contains Exif tags (JPEG and TIFF only), then the INFO
    struct may also contain 'DigitalCamera' or 'GPSInfo' (global
    positioning system information) fields.
 
    The value of the GIF format's 'DelayTime' field is given in hundredths
    of seconds.
 
    Example:
      
       info = imfinfo('ngc6543a.jpg');
 
    See also imread, imwrite, imformats.

    Reference page in Help browser
       doc imfinfo

LisA JuPiTeR
2012-01-12 10:44:43 LisA JuPiTeR (從今以後,勿復相思)

这是啥东东

少陵野老
2012-01-12 10:45:14 少陵野老 (Isis ♥ Bast)

上课记的程序代码