Re: Scale a vector



Matteo Migliore wrote:
Peter Duniho wrote:
Matteo Migliore wrote:
[...]
But no, I need to resize a one-dimensional array.

For what it's worth, you still haven't provided any guidance
regarding _how_ you want the data in the array to be calculated. Is
that because you yourself do not know?

I arrived to the conclusion that I can use the straight line equation
to interpolate value in X1 to X2 and value X3 to X4 etc... If the size
parameter
is greater than the width of the original bitmap.

Yes, that's one way.

Your vector contains a sampling of a function of one variable (the function
is "median luminosity by column in an image") at some frequency (e.g 300
pixel/inch), and what you're wanting to do is resample that function at a
different frequency (e.g. 72 pixels/inch). Doing linear interpolation
between adjacent points models the function as a series of straight line
segments. That might be good enough, but there are many other
interpolataion functions possible. For example, you could use quadratic or
cubic interpolation (e.g. modelling the base function as a series or
parabolic or cubic curve segments). You really need to know something about
the true nature of the data to know which interpolation function will give
the most useful results.

For high quality 2D image scaling, bi-quadratic or bi-cubic interpolation is
usually used, so I'd propose that quadratic or cubic interpolation is
probably what you want.

-cd




.



Relevant Pages

  • Re: interpolation with cubicmx.mexmaci from griddata
    ... performs the zi interpolation) is not accessible, ... helper function for GRIDDATA, not to be invoked directly by the user. ... matched to the planar triangles using TSEARCH, ... element, but when you move to cubic interpolation, you need more than ...
    (comp.soft-sys.matlab)
  • Re: non-uniform data interpolation?
    ... pixels, how am i supposed to get a new image with cubic ... The cubic interpolation thing provided by matlab only accept ... spacing nodes i think, is there any other way i can do it? ...
    (comp.soft-sys.matlab)
  • Re: Scale a vector
    ... For high quality 2D image scaling, ... cubic interpolation is probably what you want. ... Quadratic or cubic interpolation is not hard - IIRC, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Scale a vector
    ... and what you're wanting to do is ... resample that function at a different frequency (e.g. 72 ... Doing linear interpolation between adjacent points ... parabolic or cubic curve segments). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Scale a vector
    ... For high quality 2D image scaling, bi-quadratic or bi-cubic interpolation is usually used, so I'd propose that quadratic or cubic interpolation is probably what you want. ... But wouldn't the performance cost of that be very similar to the cost of the equivalent image-processing version? ...
    (microsoft.public.dotnet.languages.csharp)