Question: MATLAB project: I need help to complete this MATLAB code x=double(imread('cameraman.tif')); whos x x1= ; imshow(x1,[]); % increase the spatial image resolution by a factor

MATLAB project:

I need help to complete this MATLAB code

x=double(imread('cameraman.tif'));

whos x

x1=;

imshow(x1,[]);

% increase the spatial image resolution by a factor of two (also-called up-sampling) % Hint: use >help imresize or >help interp2 to learn how to use these two

x2=;

%{report what kind of visual quality degradation you observe when comparing %x2 with the original x.}

% . reduce the bit-depth image resolution of x from 256 to 16 Q=;

x3=round(x/Q); subplot(1,2,1);imshow(x,[]);title('8-bit image'); subplot(1,2,2);imshow(x3,[]);title('4-bit image');

%{report what kind of visual quality degradation you observe when comparing % x3 with the original x.}

%extract the MSB and LSB of a given image

MSB=; LSB=; subplot(1,2,1);imshow(MSB,[]);title('Most Significant Bitplane (MSB)'); subplot(1,2,2);imshow(LSB,[]);title('Least Significant Bitplane (MSB)');

{report what kind of visual difference between MSB and LSB you can observe.}

% play with a color image of flowers

x=double(imread('fl_orig.ppm')); y=rgb2gray(x/255);

% generate Bayer pattern z % green channels: quincinx lattice

z(1:2:end,1:2:end)=squeeze(x(1:2:end,1:2:end,2)); z(2:2:end,2:2:end)=squeeze(x(2:2:end,2:2:end,2)); red/blue channels: quarter-size z(1:2:end,2:2:end)=squeeze(x(1:2:end,2:2:end,1)); z(2:2:end,1:2:end)=squeeze(x(2:2:end,1:2:end,3));

% Bayer pattern is NOT the grayscale version but visually appears similar % Note that y is normalized within [0,1] and z is within [0,255] imshow([y*255 z],[]);

[write a new matlab function called cfa_interp.m to reconstruct full-resolution color image from the bayer pattern z. ]

% to do CFA interpolation (just Google it!); for MATLAB veterans, you can try out your own ideas of % interpolating each channel independently via linear methods (e.g., imresize or interp2)] xx=cfa_interp(z); % This problem is often called image demosaicing. You can learn more about

% Part: MRI image acquisition in k-space clear all close all %load spiralexampledata % d - spiral data; % k - kspace locations (kx,ky); use plot(real(k),imag(k),'.') to see % w - density compensation function (used to weight the k-space data); load rt_spiral.mat

% a simple implementation of gridding algorithm for MRI reconstruction % choose an image size n=256/2; % read the supplied grid2w.m function and learn how to call it X=; x=; % display the reconstructed result % Hint: if the displayed result does not appear correct, >help fftshift % and understand why you need to use fftshift here (we will discuss this % issue later during the lecture on FT of images) figure(1);imshow(abs(x),[]);

##############################

function [g0,g1,r0,b0]=cfa(r,g,b)

[M,N]=size(r);

g0=g(1:2:M,1:2:N); g1=g(2:2:M,2:2:N); r0=r(1:2:M,2:2:N); b0=b(2:2:M,1:2:N);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!