Home        Store        Docs        Blog

ROV Camera feed into Matlab

I have adapted an object detector in Matlab that I plan on implementing on the BlueROV2 live video stream. The code I currently have to access a webcam is below but I am wondering how to access the on board camera and send the feed to Matlab.

"camera = webcam(‘HP Wide Vision FHD Camera’);
net = detector;

h=figure;
while ishandle(h)
im = snapshot(camera);
image(im);
[bboxes,scores,labels] = detect(net,im,‘Threshold’,.2);
if(isempty(labels) == 0)
for k = 1:size(bboxes,1)
rectangle(‘position’,bboxes(k,:),‘Edgecolor’,‘b’);
title({char(labels),num2str(scores)});
drawnow
end
else
drawnow
end
end"

Hi,

Check our OpenCV documentation, you should probably be able to do the same thing in matlab.
Remember that the video us encoded with H264 and transmitted via UDP.

You can find some information in the internet about it: https://www.mathworks.com/matlabcentral/answers/272160-how-can-i-receive-stream-video-content-over-a-network-with-udp-protocol