Zooming in and zooming out an image with matlab (Spacial resolution)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 17

  • @hadisalah5356
    @hadisalah5356 ปีที่แล้ว

    Thank you so much 🥹❤️
    Greetings from Iraq

  • @paolavalles3823
    @paolavalles3823 3 ปีที่แล้ว +2

    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

    • @pratikian
      @pratikian  3 ปีที่แล้ว

      ¿Por qué sientes que los resultados son incorrectos?

  • @jamesjolicoeur2415
    @jamesjolicoeur2415 2 ปีที่แล้ว +1

    does this only work with that exact picture, cause i can't get it to work with a jpg of png file

    • @pratikian
      @pratikian  2 ปีที่แล้ว

      What error are you getting?

  • @manaliparab810
    @manaliparab810 5 ปีที่แล้ว +1

    thank you

  • @nelsondarwinpaktech3954
    @nelsondarwinpaktech3954 5 ปีที่แล้ว

    great buddy,,keep it up,,,,,,,,,,,,,

    • @pratikian
      @pratikian  5 ปีที่แล้ว

      +Nelson Darwin Pak Tech thank you for the feedback ..😊

  • @ruun0293
    @ruun0293 5 ปีที่แล้ว

    Oh thank you very much proud to get this,keep it up please🙏🙏

    • @pratikian
      @pratikian  5 ปีที่แล้ว

      Happy to help .. thank you so much .. 😊

  • @sanidhyameshram
    @sanidhyameshram 4 ปีที่แล้ว

    Can you post programs for zooming by interpolation and by replication separately?

    • @pratikian
      @pratikian  4 ปีที่แล้ว +1

      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

  • @denizbaran5804
    @denizbaran5804 5 ปีที่แล้ว

    I can change picture resolution from 1024x1024 to 256x256, how can change from 256x256 to 1024x1024 again?
    What should i do?

    • @pratikian
      @pratikian  5 ปีที่แล้ว

      Zoom the 256 × 256 image twice you will get your 1024 image

    • @denizbaran5804
      @denizbaran5804 5 ปีที่แล้ว

      @@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)

    • @pratikian
      @pratikian  5 ปีที่แล้ว

      @@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

    • @Abhishek-ht9xb
      @Abhishek-ht9xb 4 ปีที่แล้ว

      @@denizbaran5804 hjj