How to extend an image using convolution

Hi I have this plot which I saved as an image. I need to extend it to a certain width. I think I can use convolution? I haven't done any image processing before. Absolutely new to this. Read about convolution so have an idea what it is. Can someone please guide me through this. How do I perform convolution for this?

Antworten (1)

Image Analyst
Image Analyst am 16 Mai 2014

0 Stimmen

Convolution will enlarge an image but it filters the image and you haven't said that you want to blur or sharpen the image. Why not try padarray() to just add some layers of zero value pixels around the outer edge of the image?

12 Kommentare

Mahi Nazir
Mahi Nazir am 16 Mai 2014
How will padding some layers of zero value pixels give the natural decay (not sure if I am using the right term) of the function over the specified width? If I say ok I want to blur my image but I need to extend it to say 0.9 cm with... how do I do that? Whats different in sharpening? because I want my profile extended to a width of say 0.9 cm
Mahi Nazir
Mahi Nazir am 16 Mai 2014
by decay I mean like a sinc function
Image Analyst
Image Analyst am 16 Mai 2014
You said "plot which I saved as an image" meaning that you made a plot , then you saved the plot (axes, blue line, tick labels, white space, etc.) as an image using something like saveas() or export_fig(). You didn't say anything about the blue line in the image which you plotted in that plot/chart/graph. That blue line is a 1-D signal, not an image so I did not expect that you would be talking about that. Is it THAT that you want to talk about rather than the "plot which I saved as an image"?
Mahi Nazir
Mahi Nazir am 16 Mai 2014
Sorry for not being so clear... yes all I want is about the blue plot inside
Mahi Nazir
Mahi Nazir am 16 Mai 2014
I am not sure if I even need this image ... I have a vector for that blue plot.. what do I do next to extend it sideways (decreasing) to a certain width?
Mahi Nazir
Mahi Nazir am 16 Mai 2014
I don't need the axes and other markings... Can you please help
OK, so you have a 1D array that is your signal. You can extend it by setting a later index. Let's say it's 15 long and you want it to be 30 long. You can do this:
vec(30) = 99; % Fill elements 16-29 with 0 and element 30 with 99.
Of course you can have the 99 be zero, but I just wanted to illustrate that all the "in between values" will be zero and the one you set will have the value you set.
Mahi Nazir
Mahi Nazir am 16 Mai 2014
That's not what I want... I have a 1D array which is 41 long... I have to extend it... broaden it not lengthen it.... so the width of the array will change and it will have to become a matrix....
To make the line broader, set the 'LineWidth' option:
plot(x,y, 'LineWidth', 5);
Mahi Nazir
Mahi Nazir am 16 Mai 2014
I need something like a surface plot as my result... something like the image attached(only the central part of if obviously)... not just increased width
Image Analyst
Image Analyst am 16 Mai 2014
Try the surf() function.
Mahi Nazir
Mahi Nazir am 16 Mai 2014
For surf we need to have a matrix, I have a vector... that's why I was trying to get additional values from convolution? Any idea how convolution can be done here?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 16 Mai 2014

Kommentiert:

am 16 Mai 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by