How can I resize an array without interpolating new values or mark the original ones?

5 views (last 30 days)
I have data that correspond to image anlysis exported from Tecplot 360. The spreadsheet comes out as a 75x265 array with values. The values represent velocity field from a PIV experiment. The images of the space where the velocities are assigned to are 2160x2560 pixels. I tried to resize the array of the original data with the im resize function:
Velocity1=imresize (Velocity, [2160,2560]);
and I get nice contour plots from it but when try to pick specific rows (or columns, it doesn't matter) from this new matrix to plot some 2d profiles I get too many points which are also hard to filter with a median filter for example because the false values are gaining more weight. Also when I try to scale distances to physical space I think I get wrong values. I was wondering if there is a way to assign the vallues from the 75x265 matrix to the corresponding places in a 2160x2560 area without creating new values between them or at least somehow mark the places of the original points?

Answers (1)

Walter Roberson
Walter Roberson on 24 Jan 2020
| was wondering if there is a way to assign the vallues from the 75x265 matrix to the corresponding places in a 2160x2560 area without creating new values between them
No, there isn't.
If you were using an integer scale factor in both directions then you could replicate pixels, which would give you a blocky-looking result but would not introduce any new values. But you are scaling by 28.8 in one direction and about 9.66 in the other direction, and the only way to do that meaningfully is to interpolate in at least one pixel in each row and each column .

Categories

Find more on Read, Write, and Modify Image 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!