2D Interpolation (Linear and spline) of a greyscale image
Show older comments
Hi Guys,
I have a grey scale image (shown below):
http://www.qfpost.com/download.do?get=f8295c24e09fe632b90a1d09ae5ac69a
Which I wish to interpolate to give 10 times the number of pixels - This is so I can find the edge of the beam when using a white-black intensity graph across the image as the edge is not exactly on a pixel - after carrying out a Canny edge detection.
The following code:
ZI = interp2(X,Y,Z,XI,YI,method)
seems to be the code I require where method will be 'linear' etc, however, I am not sure what the values X,Y,Z,XI and YI should be.
I guess that Z is my image, and the X and Y are co-ordinates of some kind but how would I determine then? I think it has something to do with meshgrids but I do not know very much about such techniques.
Any help would be much appreciated! Thanks, Graham
4 Comments
Graham Boag
on 25 Feb 2011
Graham Boag
on 25 Feb 2011
Deepshikha Bhargava
on 3 Dec 2018
did you find the solution?
Image Analyst
on 3 Dec 2018
Yes. Scroll down the page and see the Answer with the green check mark, meaning he accepted that answer.
Accepted Answer
More Answers (4)
Sean de Wolski
on 25 Feb 2011
X,Y are the results of:
[X Y] = meshgrid(1:256)
Xi, Yi are the locations that you want an interpolated value at, for your example:
[Xi Yi] = meshgrid(1:0.1:256);
%SCd
pooja chandrabose
on 25 Jan 2018
0 votes
I need to know how to apply interpolation in a image (biliner,cubic, convolution)plz I need this info as soon as possible
image-pro
on 16 Apr 2022
0 votes
did you get the answer please tell me the code?
1 Comment
Image Analyst
on 16 Apr 2022
I don't know why all the answers were using interp2 and meshgrid when you can do it simply with imresize()
outputImage = imresize(inputImage, [numDesiredRows, numDesiredColumns]);
Image Analyst
on 16 Apr 2022
I don't know why all the answers were using interp2 and meshgrid when you can do it simply with imresize()
outputImage = imresize(inputImage, [numDesiredRows, numDesiredColumns]);
imresize() has several interpolation schemes you can choose from.
2 Comments
Bruno Luong
on 16 Apr 2022
Because imresize requires image processing toolbox.
image-pro
on 17 Apr 2022
i want to know how to apply newton divided difference interpolation in image
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!