A customer asked me last week how to do multidimensional interpolation with integer inputs. The MATLAB function interpnsupports only double- and single-precision inputs.
It's possible to do this using a little-known Image Processing Toolbox function called tformarray. But tformarray is a general spatial transformation engine with a complicated syntax. It isn't easy to figure out how to use it for interpolation, so I decided to write a wrapper M-file to do it.
The function iminterpn, which has a syntax similar to interpn, is now available on the MATLAB Central File Exchange. I hope some of you find it useful.
i have a gray value image(512×512), it has some high contrast objects in it. i extracted the high contrast objects from the gray value image and created another binary image of same size. now, i want to do interpolation on the gray value image where/under the high contrast objects are, and i also want to overlay the high contrast objects image on the interploated new image. could you please help me in this step?
Damodar—You might find the function roifill to be useful for interpolating in the gray value image based on the locations of the high contrast objects. I’m not I understand your second question. If you overlay the high-contrast objects over the original image, which has been changed only by modifying the pixels where the high-contrast objects are, wouldn’t you expect the result to look just like the original image?
thank you very much for giving information for my last question.sir now I want to upsample the image using cubic spline interpolation.sir I used the following code [X,Y]=meshgrid(2:2:256)
Z(X,Y)=Image
[X1,Y1]=meshgrid(2:1:256)
Z1 = interp2(X,Y,Z,X1,Y1,’spline’)
I got the error” Subscripted assignment dimension mismatch”.
Can I use ‘interp2′ instruction for cubic spline interpolation of image(both colour and grey)
reji
hai
I want to upsample the image using cubic spline interpolation.
Can I use ‘interp2′ instruction for cubic spline interpolation of image(both colour and grey)
Can I use convolution methods for cubic spline interpolation
‘Pratt’ in his image processing book mentioned that convolution kernals can be used for interpolation.
reji
Reji—Yes, you can use interp2 for cubic spline interpolation of an image. I do not know why you received an error message. You’ll need to check your interp2 inputs carefully against the description in the reference page for interp2.
Continuous-time convolution kernels can be used for interpolation. For example, linear interpolation can be viewed as convolution of an impulse train with a triangular kernel. However, cubic spline interpolation is more involved, because the proper kernel weights are data-dependent.
Leave a Reply
About
Steve Eddins manages the Image & Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.
thank u sir
Hi Steve:
i have a gray value image(512×512), it has some high contrast objects in it. i extracted the high contrast objects from the gray value image and created another binary image of same size. now, i want to do interpolation on the gray value image where/under the high contrast objects are, and i also want to overlay the high contrast objects image on the interploated new image. could you please help me in this step?
Thank U.
Sincerely
Damodar
Damodar—You might find the function roifill to be useful for interpolating in the gray value image based on the locations of the high contrast objects. I’m not I understand your second question. If you overlay the high-contrast objects over the original image, which has been changed only by modifying the pixels where the high-contrast objects are, wouldn’t you expect the result to look just like the original image?
Sir
thank you very much for giving information for my last question.sir now I want to upsample the image using cubic spline interpolation.sir I used the following code [X,Y]=meshgrid(2:2:256)
Z(X,Y)=Image
[X1,Y1]=meshgrid(2:1:256)
Z1 = interp2(X,Y,Z,X1,Y1,’spline’)
I got the error” Subscripted assignment dimension mismatch”.
Can I use ‘interp2′ instruction for cubic spline interpolation of image(both colour and grey)
reji
hai
I want to upsample the image using cubic spline interpolation.
Can I use ‘interp2′ instruction for cubic spline interpolation of image(both colour and grey)
Can I use convolution methods for cubic spline interpolation
‘Pratt’ in his image processing book mentioned that convolution kernals can be used for interpolation.
reji
Reji—Yes, you can use interp2 for cubic spline interpolation of an image. I do not know why you received an error message. You’ll need to check your interp2 inputs carefully against the description in the reference page for interp2.
Continuous-time convolution kernels can be used for interpolation. For example, linear interpolation can be viewed as convolution of an impulse train with a triangular kernel. However, cubic spline interpolation is more involved, because the proper kernel weights are data-dependent.