Capturing Lossless Images with USB Webcam Package

Hi everyone,
I am using Matlab to capture images from a USB camera. I want to save in bitmap to avoid any compression but the images appear to have compression artefacts. Below is a simple version of the routine I am using to capture and save images:
aa=webcam('Camera_name_here');
aa.Resolution='1920x1080';
img=snapshot(aa);
img=imcrop(img,[1219 300 600 200]);
filename='test2.bmp';
imwrite(img,filename);
Might there be any hidden compression in these steps? The file size is large as expected from bitmap images but the image itself is not bitmap quality. Are there any settings that I can change to ensure that there is no compression during the capture? Is using the webcam package functions causing issues? Should I use functions from the Image Acquisition Toolbox? I know webcams do compress images but what I am using is a camera with USB connection, not a simple webcam.

6 commentaires

It is common for webcam with usb connection to make compressed images available.
Hakan Caldag
Hakan Caldag le 13 Déc 2024
Modifié(e) : Hakan Caldag le 13 Déc 2024
Don't know if it helps but I am using this camera.
According to that page, the camera supports
  • H.264 (which is lossy compression)
  • MJPEG (which is lossy compression)
  • YUY2 (which is a different kind of lossy compression)
Activating the YUY2 would probably require using the Image Acquisition Toolbox
Thank you for the suggestion, I will write here when I try it with the Image Acquisition Toolbox.
Thank you @Swastik Sarkar, I will check this.

Connectez-vous pour commenter.

Réponses (0)

Produits

Version

R2024a

Commenté :

le 18 Déc 2024

Community Treasure Hunt

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

Start Hunting!

Translated by