Changeset 16437


Ignore:
Timestamp:
10/16/13 17:01:19 (11 years ago)
Author:
cborstad
Message:

NEW: overlay_adjust parameters added for better tuning of brightness and contrast of overlay images.
Parameters a,b,c,d must be in [0,1]. In general:
To decrease contrast: increase a
To increase contrast: decrease b
To increase brightness: increase c
To decrease brightness: decrease d
Some trial-and-error is needed, and it helps to look at a histogram of the intensity first.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/radarpower.m

    r14026 r16437  
    2525ylim    = getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
    2626posting = getfieldvalue(options,'posting',0); % 0 -> image posting default
     27a = getfieldvalue(options,'overlay_adjust_a',0);
     28b = getfieldvalue(options,'overlay_adjust_b',1);
     29c = getfieldvalue(options,'overlay_adjust_c',0);
     30d = getfieldvalue(options,'overlay_adjust_d',1);
    2731
    2832%find gdal coordinates
     
    8589                %Read in temp.tif:
    8690                im=imread('temp.tif','TIFF');
     91                %adjust contrast and brightness
     92                im=imadjust(im,[a b],[c d]);
    8793                pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
    8894                md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
     
    114120                %Read in temp.tif:
    115121                im=imread('temp.tif','TIFF');
     122                %adjust contrast and brightness
     123                im=imadjust(im,[a b],[c d]);
    116124                pixelskip=max(1,ceil(posting/((x1-x0)/(size(im,2)))));
    117125                md.radaroverlay.pwr=double(flipud(im(1:pixelskip:end,1:pixelskip:end)));
     
    144152        disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
    145153        im=imread(overlay_image);
     154        %adjust contrast and brightness
     155        im=imadjust(im,[a b],[c d]);
    146156        im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
    147157        md.radaroverlay.pwr=double(flipud(im));
Note: See TracChangeset for help on using the changeset viewer.