2022 How to Downsample an Image in MATLAB | Image Processing

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 9

  • @KevinSmith-gu7fb
    @KevinSmith-gu7fb 9 месяцев назад +1

    Thanks, what's the equivalent upsampling code for line 234: img = img(1:10:end, 1:10:end); ?

    • @philparisi_
      @philparisi_  9 месяцев назад

      Hi Kevin, line 234 is downsampling the image. We select a subset of the data, and save that so a new image “img”.
      Can you specify what you mean by “upsampling”? We can’t increase the ‘size’ our image and ‘add resolution’ in the regard… let me know!

    • @KevinSmith-gu7fb
      @KevinSmith-gu7fb 9 месяцев назад +1

      @@philparisi_ Yes, upsampling as in going back up from 32x32 to 64x64 to 128x128 to 256x256 to 512x512 to 1024x1024.

    • @philparisi_
      @philparisi_  9 месяцев назад

      Ahh ok. Once you overwrite the ‘img’ variable, you lose the data of those pixels. So I don’t think there’s a way to go back up and artificially create resolution (unless using advanced modern AI to improve image quality).
      What you could do, is create variables
      - img_1024
      - img_512
      - img_256
      and so on, and then use each these images when needed. Not quite what you want at least now you can go back to higher images.

    • @KevinSmith-gu7fb
      @KevinSmith-gu7fb 9 месяцев назад +1

      @@philparisi_ Yes, you do lose those pixels, so when you enlarge back up, the resolution sucks, but you can still enlarge back to the higher dimensions. Anyway, I found a way to do it. It's not as simple as one line, though. There were several lines involved, and I may not have done it right, but we'll see. Thanks, anyway.

    • @philparisi_
      @philparisi_  9 месяцев назад

      Ahhhh ok I see what you are saying. Essentially force the pixels you have into the larger ‘grid’. Can you share your solution in this thread so others may use it in the future?