×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

URGENT : imtransform & makeresampler

URGENT : imtransform & makeresampler

URGENT : imtransform & makeresampler

(OP)
HI everyone,
 
I'm trying to use a customed "imtransform" function.
 
The Matlab help is very vague about how to use this function. Neither
does it provide an example...
 
I really don't understand how to do use "makeresampler":
 
If you are using a custom interpolating kernel, you can specify
interpolant
as a cell array in either of these forms:
 
{half_width, positive_half} half_width is a positive scalar
designating the
half width of a symmetric interpolating kernel. positive_half is a
vector of
values regularly sampling the kernel on the closed interval [0
positive_half].
 
{half_width, interp_fcn} interp_fcn is a function handle that returns
 
interpolating kernel values, given an array of input values in the
interval
[0 positive_half].
 
Can anybody help?
 
Thanks a lot!
 
callingrohit

RE: URGENT : imtransform & makeresampler

"Neither does it provide an example... "

yes it does. 3 in fact.

"Example 1
    ---------
    Apply a horizontal shear to an intensity image.
 
        I = imread('cameraman.tif');
        tform = maketform('affine',[1 0 0; .5 1 0; 0 0 1]);
        J = imtransform(I,tform);
        imshow(I), figure, imshow(J)
 
    Example 2
    ---------
    A projective transformation can map a square to a quadrilateral.  In
    this example, set up an input coordinate system so that the input
    image fills the unit square and then transform the image from the
    quadrilateral with vertices (0 0), (1 0), (1 1), (0 1) to the
    quadrilateral with vertices (-4 2), (-8 -3), (-3 -5), and (6 3).  Fill
    with gray and use bicubic interpolation.  Make the output size the
    same as the input size.
 
        I = imread('cameraman.tif');
        udata = [0 1];  vdata = [0 1];  % input coordinate system
        tform = maketform('projective',[ 0 0;  1  0;  1  1; 0 1],...
                                       [-4 2; -8 -3; -3 -5; 6 3]);
        [B,xdata,ydata] = imtransform(I,tform,'bicubic','udata',udata,...
                                                        'vdata',vdata,...
                                                        'size',size(I),...
                                                        'fill',128);
        subplot(1,2,1), imshow(udata,vdata,I), axis on
        subplot(1,2,2), imshow(xdata,ydata,B), axis on
 
    Example 3
    ---------  
    Register an aerial photo to an orthophoto.
   
        unregistered = imread('westconcordaerial.png');
        figure, imshow(unregistered)
        figure, imshow('westconcordorthophoto.png')
        load westconcordpoints % load some points that were already picked     
        t_concord = cp2tform(input_points,base_points,'projective');
        info = imfinfo('westconcordorthophoto.png');
        registered = imtransform(unregistered,t_concord,...
                                 'XData',[1 info.Width], 'YData',[1 info.Height]);
        figure, imshow(registered)                       
 "

Cheers

Greg Locock

RE: URGENT : imtransform & makeresampler

(OP)
Hi
Thanks for the info. I did go through those examples but still they don't help me bcoz i need to build my own kernel using the following

{half_width, positive_half} half_width is a positive scalar designating the half width of a symmetric interpolating kernel. positive_half is a vector of values regularly sampling the kernel on the closed interval [0 positive_half].
 
{half_width, interp_fcn} interp_fcn is a function handle that returns interpolating kernel values, given an array of input values in the interval [0 positive_half].

and also for makeresampler.

thanks bye

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources