can I get some idea from the expert of MATLAB?

조회 수: 5 (최근 30일)
Raushan
Raushan . 2022년 7월 18일
편집: Walter Roberson . 2022년 7월 24일
I want to use 4 Basler Ace cameras to capture images using MATLAB. How can I start writting MATLAB script for this.
Any help will be appreciated!
  댓글 수: 7
Raushan
Raushan 2022년 7월 20일
I tried Image acquisition app in matlab for 1 camera and got preview and captured some image too. Here is the code for capturing one image from one camera
vid = videoinput('gentl', 2, 'Mono8');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
vid.ROIPosition = [1273 253 806 909];
start(vid);
stoppreview(vid);
imwrite(getdata(vid), 'E:\Raushan\7-19-22\pic_5.tiff');
I want to use 4 basler ace camera camera to captured 4 image at the same time. Can you please help me to proceed with. I will appriciate any kind of help.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2022년 7월 18일
편집: Image Analyst 님. 2022년 7월 18일
Machine vision cameras can often be seen as generic webcams, though not with all the functionality or resolutions you'd get with the Image Acquisition Toolbox. For example, see my camera list below.
I have three cameras: (1) integrated webcam inside the laptop computer, (2) external Logitech c930e webcam, and (3) external Lumenera machine vision camera.
The upper list is a list of all possible resolution modes for the Lumenera camera that are available with the Image Acquisition Toolbox. You can see there are a lot. The camera uses its own third party (manufacturer) adapter called lumeneraimaq-1. It does not use a winvideo adapter in that case.
However the Lumenera camera also shows up at the bottom as winvideo-3, but it has only two resolution modes to choose from. And of course a lot of other functionality that the camera has is missing, like flipping/mirroring, white balancing, adjusting gains of each color channel independently, frame rate, etc. If I want to use the Lumenera camera as a dumb webcam, I can select the winvideo-3 adapter for it and I believe it would still work. I haven't tried it because why would I want to give up all the functionality I have available to me?
So you might be able to run your Basler camera as just a dumb webcam if you want.
camera = webcam; % Connect to the camera
net = alexnet; % Load the neural network
while true
im = snapshot(camera); % Take a picture
image(im); % Show the picture
im = imresize(im,[227 227]); % Resize the picture for alexnet
label = classify(net,im); % Classify the picture
title(char(label)); % Show the class label
drawnow
end
  댓글 수: 12
Walter Roberson
Walter Roberson 2022년 7월 24일
편집: Walter Roberson 님. 2022년 7월 24일
Take 3 initial images.
Make them the old images
while true
wait 10 minutes
trigger
record the 3 images
compare the images to the old images
if they are different enough, break
make the images just recorded the old images
end of loop

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by