Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Image linear interpolation with Matlab. I am attempting to reconstruct a down sampled grayscale image using interp1. I have this code but I am confused

Image linear interpolation with Matlab.

I am attempting to reconstruct a down sampled grayscale image using interp1. I have this code but I am confused to why it is not working. I am getting an error on line 4. Basically, what do I need to put in place of the image name in line 4?

[r_L,col_L]=size(image); %generalize so it works for any image r3i = 1:(1/3):r_L; % locations between the row indices are created c3i = 1:(1/3):col_L; %-- locations between the column indices are created

%Error occurs here xxrowi=interp1(1:1:r_L,image,r3i);%interpolation on image width xxlinear=interp1(1:1:col_L,xxrowi',c3i); %transposing allows one to interpolate on a length xxlinear=xxlinear'; %retransposing image vector show_img(xxlinear)

It can work with any image but first we need to change it to grayscale and downsample by a factor of 3.

image_bw=rgb2gray(image);

image_DS=downsample(image,3);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

What do you understand is meant by OHSAS 18001?

Answered: 1 week ago

Question

What did they do? What did they say?

Answered: 1 week ago