Capturing Lossless Images with Image Acquisition Toolbox (getsnasphot)
Hello everyone,
This is a follow-up to an earlier question I had asked about capturing lossless images with Matlab. Earlier, I was using USB Webcam Package’s snapshot() function to capture, yet it seemed that there was some compression going on possibly because it was not possible to access YUY2 (I am not sure if this is relevant as I want to capture images rather than recording videos). Now I have moved on to use the Image Acquisition Toolbox and the interface generated the following code to capture images:
v = videoinput("winvideo", 1, "YUY2_3840x2160"); % Video device
v.ReturnedColorspace = "RGB";
src = getselectedsource(v);
src.Exposure = 0; % Camera parameters
image1 = getsnapshot(v); % Capturing the image
filename = "snapshot1.bmp"; % I changed the code to save the image as .bmp
imwrite(image1, filename, "bmp"); % Saving the file
Now the code is using the getsnapshot() function instead. Should this apply any additional compression on Matlab’s side of things? I know that the camera may do something but I want to ensure that Matlab does not.Hello everyone,
This is a follow-up to an earlier question I had asked about capturing lossless images with Matlab. Earlier, I was using USB Webcam Package’s snapshot() function to capture, yet it seemed that there was some compression going on possibly because it was not possible to access YUY2 (I am not sure if this is relevant as I want to capture images rather than recording videos). Now I have moved on to use the Image Acquisition Toolbox and the interface generated the following code to capture images:
v = videoinput("winvideo", 1, "YUY2_3840x2160"); % Video device
v.ReturnedColorspace = "RGB";
src = getselectedsource(v);
src.Exposure = 0; % Camera parameters
image1 = getsnapshot(v); % Capturing the image
filename = "snapshot1.bmp"; % I changed the code to save the image as .bmp
imwrite(image1, filename, "bmp"); % Saving the file
Now the code is using the getsnapshot() function instead. Should this apply any additional compression on Matlab’s side of things? I know that the camera may do something but I want to ensure that Matlab does not. Hello everyone,
This is a follow-up to an earlier question I had asked about capturing lossless images with Matlab. Earlier, I was using USB Webcam Package’s snapshot() function to capture, yet it seemed that there was some compression going on possibly because it was not possible to access YUY2 (I am not sure if this is relevant as I want to capture images rather than recording videos). Now I have moved on to use the Image Acquisition Toolbox and the interface generated the following code to capture images:
v = videoinput("winvideo", 1, "YUY2_3840x2160"); % Video device
v.ReturnedColorspace = "RGB";
src = getselectedsource(v);
src.Exposure = 0; % Camera parameters
image1 = getsnapshot(v); % Capturing the image
filename = "snapshot1.bmp"; % I changed the code to save the image as .bmp
imwrite(image1, filename, "bmp"); % Saving the file
Now the code is using the getsnapshot() function instead. Should this apply any additional compression on Matlab’s side of things? I know that the camera may do something but I want to ensure that Matlab does not. image acquisition, lossless image, bitmap, camera, recording, video, image MATLAB Answers — New Questions