clc; clear; a= imread('cameraman.tif'); a=double(a); [m,n]=size(a); for i=1:3*m for j=1:3*n x=abs(i-floor(i/1.5)); x1=abs(x-floor(x/1.5));
y=abs(j-floor(j/1.5)); y1=abs(y-floor(y/1.5));
b(i,j) = a(x1,y1); end end a=uint8(a); b=uint8(b); figure;imshow(a) figure;imshow(b) El programa si corre pero al mostrar los resultados sale incorrecto
You can get that here drive.google.com/file/d/1GAGjgnEGaN4Dwn4yCgSE84JwD-ZdTOsH/view?usp=sharing I have used a slightly different algorithm for zooming and used a basic average for interpolation
@@pratikian I can convert to 1024 to 256. I have to use 256x256 image on MATLAB (not choose on desktop) and i want to convert from 256*256 to 1024*1024, matlab codes are below. Up to the figure;imshow(b), codes works but after the figure;imshow(b), program gives error: Attempted to access b(1,257); index out of bounds because size(b)=[256,256]. Error in soru2 (line 23) c(i,j)=b(x,y); matlab codes; a = imread(.....) [m,n]=size(a); for i=1:m/4 for j=1:n/4 p = i*4; q = j*4;
b(i,j)=a(p,q); end end figure;imshow(a) figure;imshow(b) [m,n]=size(b) for i=1:m*4 for j=1:n*4 x = i-floor(i/4); y = j-floor(j/4);
@@denizbaran5804 this logic that you have applied is wrong for i=1:m*4 for j=1:n*4 x = i-floor(i/4); y = j-floor(j/4);
c(i,j)=b(x,y); the logic of p=i - floor(i/2) only works to double the no of pixels if you want to increase by 4 times you have to use this logic twice as shown for i=1:m*4 for j=1:n*4 x = i-floor(i/2); x1 = x - floor(x/2);
Thank you so much 🥹❤️
Greetings from Iraq
clc;
clear;
a= imread('cameraman.tif');
a=double(a);
[m,n]=size(a);
for i=1:3*m
for j=1:3*n
x=abs(i-floor(i/1.5));
x1=abs(x-floor(x/1.5));
y=abs(j-floor(j/1.5));
y1=abs(y-floor(y/1.5));
b(i,j) = a(x1,y1);
end
end
a=uint8(a);
b=uint8(b);
figure;imshow(a)
figure;imshow(b)
El programa si corre pero al mostrar los resultados sale incorrecto
¿Por qué sientes que los resultados son incorrectos?
does this only work with that exact picture, cause i can't get it to work with a jpg of png file
What error are you getting?
thank you
great buddy,,keep it up,,,,,,,,,,,,,
+Nelson Darwin Pak Tech thank you for the feedback ..😊
Oh thank you very much proud to get this,keep it up please🙏🙏
Happy to help .. thank you so much .. 😊
Can you post programs for zooming by interpolation and by replication separately?
You can get that here
drive.google.com/file/d/1GAGjgnEGaN4Dwn4yCgSE84JwD-ZdTOsH/view?usp=sharing
I have used a slightly different algorithm for zooming and used a basic average for interpolation
I can change picture resolution from 1024x1024 to 256x256, how can change from 256x256 to 1024x1024 again?
What should i do?
Zoom the 256 × 256 image twice you will get your 1024 image
@@pratikian I can convert to 1024 to 256. I have to use 256x256 image on MATLAB (not choose on desktop) and i want to convert from 256*256 to 1024*1024, matlab codes are below. Up to the figure;imshow(b), codes works but after the figure;imshow(b), program gives error:
Attempted to access b(1,257); index out of bounds because size(b)=[256,256].
Error in soru2 (line 23)
c(i,j)=b(x,y);
matlab codes;
a = imread(.....)
[m,n]=size(a);
for i=1:m/4
for j=1:n/4
p = i*4;
q = j*4;
b(i,j)=a(p,q);
end
end
figure;imshow(a)
figure;imshow(b)
[m,n]=size(b)
for i=1:m*4
for j=1:n*4
x = i-floor(i/4);
y = j-floor(j/4);
c(i,j)=b(x,y);
end
end
figure;imshow(c)
@@denizbaran5804 this logic that you have applied is wrong
for i=1:m*4
for j=1:n*4
x = i-floor(i/4);
y = j-floor(j/4);
c(i,j)=b(x,y);
the logic of p=i - floor(i/2) only works to double the no of pixels if you want to increase by 4 times you have to use this logic twice as shown
for i=1:m*4
for j=1:n*4
x = i-floor(i/2);
x1 = x - floor(x/2);
y = j-floor(j/2);
y1 = y - floor(y/2);
c(i,j)= a(x1,y1);
end
end
hope this helps
@@denizbaran5804 hjj