0

I am trying to do the operations like rgb2gray(img) on a live video read using vid=videoinput() like rgb2gray(vid).

It is a type mismatch but I am stuck here. Should I convert the vid to any image format and store it in a matrix or is there any other way like to do rgb2gray? I don't want to use vid.ReturnedColorSpace = 'grayscale', as I need to convert the video into images or matrix and do rgb2gray operation.

Tom Zych
  • 13,329
  • 9
  • 36
  • 53

1 Answers1

0

In your code vid is a videoinput object that lets you capture frames from a camera. You cannot pass it to rgb2gray. What you can do is grab the frames one at a time in a loop, and pass each one to rgb2gray individually.

Dima
  • 38,860
  • 14
  • 75
  • 115