The image of the duck is given as described in Figure 1. You must enter a Matlab code to get the displayed image in Figure 2 by using a convolution function.

조회 수: 3 (최근 30일)
  댓글 수: 4
ahmad dabbah
ahmad dabbah 2022년 12월 17일
clc
clear all
close all
im=im2double(rgb2gray(imread('duck.jpeg')));
[m, n] = size(im);
Factor = 4;
f1=zeros(Factor*m, Factor*n);
for k1=1:1.5:(Factor)
for k2=1:2:(Factor)
f1 (k1*m,k2*n) = 1;
end
end
y1=conv2(im,f1);
M1=max(max(y1));
y1=255.*(y1./M1);
imshow(uint8((y1)));
title('Convolution ')

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 12월 17일
This demonstration is deliberately not exactly the same as what you are asked to produce.
im = imread('cameraman.tif');
mask = 1;
mask(floor(size(im,1)/2)+1,size(im,2)+1) = 1;
mask(1,size(im,2)*2+1) = 1;
newimg = cast(conv2(mask, im), class(im));
imshow(newimg)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by