Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
question about how to use "step"

Subject: question about how to use "step"

From: Shingo

Date: 15 Oct, 2010 04:01:07

Message: 1 of 8

Hi, I am a MATLAB user at the beginners level.
I have a few questions about how to use "step".
According to the "help step" or "doc step" explanation, this function is utilized for plotting step response in the control system.

However, when I was watching the webinar for the Video and Image Processing Blockset, entitled, "Computer Vision and Video Processing Using MATLAB", this "step" function was being used in a completely different fashion. I am confused.

For example, in the demo in the webinar, it was used like,
"I = step(reader)", where, reader = video.MultimediaFileReader;
"of = step(optical, rgb2gray(I))", where optical = video.OpticalFlow
or
"Ishp = step(shapes, I, lines)", where shape = video.ShapeInserter

Well, in any case, I wanted to give a trial&error myself, and tried to run the m-file that I've found in one of the demo for the Video and Image Processing Blockset.
Unfortunately, however, MATLAB returned an error at the line for "step".
The following is the error message.

"??? Error using ==> step
Reported by video.BinaryFileReader: Unable to checkout a license for
the Video and Image Processing Blockset."

To be honest, I am at a loss. I have installed and activated the Video and Image Processing Blockset through a legal academic package, and moreover, all the other function, class, etc seems to be working fine for Video and Image Processing Blockset.

I would greatly appreciate it if somebody could help me understand what's going on, or even more specifically, on the following points.

1. Is "step" used in a completely different fashion other than plotting step response for the control system?
2. If so, why my MATLAB does not show a proper help or document for its explanation? What Blockset or Toolbox am I missing?
3. Why my MATLAB keeps giving me the error message for licensing?

Thank you very much.

Shingo.

Subject: question about how to use "step"

From: Cris Luengo

Date: 15 Oct, 2010 08:55:08

Message: 2 of 8

"Shingo " <shingo_yasuhara@yahoo.com> wrote in message <i98jm3$441$1@fred.mathworks.com>...
> Hi, I am a MATLAB user at the beginners level.
> I have a few questions about how to use "step".
> According to the "help step" or "doc step" explanation, this function is utilized for plotting step response in the control system.
>
> However, when I was watching the webinar for the Video and Image Processing Blockset, entitled, "Computer Vision and Video Processing Using MATLAB", this "step" function was being used in a completely different fashion. I am confused.
>
> For example, in the demo in the webinar, it was used like,
> "I = step(reader)", where, reader = video.MultimediaFileReader;
> "of = step(optical, rgb2gray(I))", where optical = video.OpticalFlow
> or
> "Ishp = step(shapes, I, lines)", where shape = video.ShapeInserter
>
> Well, in any case, I wanted to give a trial&error myself, and tried to run the m-file that I've found in one of the demo for the Video and Image Processing Blockset.
> Unfortunately, however, MATLAB returned an error at the line for "step".
> The following is the error message.
>
> "??? Error using ==> step
> Reported by video.BinaryFileReader: Unable to checkout a license for
> the Video and Image Processing Blockset."
>
> To be honest, I am at a loss. I have installed and activated the Video and Image Processing Blockset through a legal academic package, and moreover, all the other function, class, etc seems to be working fine for Video and Image Processing Blockset.
>
> I would greatly appreciate it if somebody could help me understand what's going on, or even more specifically, on the following points.
>
> 1. Is "step" used in a completely different fashion other than plotting step response for the control system?
> 2. If so, why my MATLAB does not show a proper help or document for its explanation? What Blockset or Toolbox am I missing?
> 3. Why my MATLAB keeps giving me the error message for licensing?
>
> Thank you very much.
>
> Shingo.

That error message indicates that the license server has no free seats for that toolbox. Either all the licenses are being used, or you do not have the permission to use that particular toolbox. Talk to the administrator at your institution in charge of the MATLAB licenses.

Cris.

Subject: question about how to use "step"

From: Wayne King

Date: 15 Oct, 2010 11:00:06

Message: 3 of 8

"Shingo " <shingo_yasuhara@yahoo.com> wrote in message <i98jm3$441$1@fred.mathworks.com>...
> Hi, I am a MATLAB user at the beginners level.
> I have a few questions about how to use "step".
> According to the "help step" or "doc step" explanation, this function is utilized for plotting step response in the control system.
>
> However, when I was watching the webinar for the Video and Image Processing Blockset, entitled, "Computer Vision and Video Processing Using MATLAB", this "step" function was being used in a completely different fashion. I am confused.
>
> For example, in the demo in the webinar, it was used like,
> "I = step(reader)", where, reader = video.MultimediaFileReader;
> "of = step(optical, rgb2gray(I))", where optical = video.OpticalFlow
> or
> "Ishp = step(shapes, I, lines)", where shape = video.ShapeInserter
>
> Well, in any case, I wanted to give a trial&error myself, and tried to run the m-file that I've found in one of the demo for the Video and Image Processing Blockset.
> Unfortunately, however, MATLAB returned an error at the line for "step".
> The following is the error message.
>
> "??? Error using ==> step
> Reported by video.BinaryFileReader: Unable to checkout a license for
> the Video and Image Processing Blockset."
>
> To be honest, I am at a loss. I have installed and activated the Video and Image Processing Blockset through a legal academic package, and moreover, all the other function, class, etc seems to be working fine for Video and Image Processing Blockset.
>
> I would greatly appreciate it if somebody could help me understand what's going on, or even more specifically, on the following points.
>
> 1. Is "step" used in a completely different fashion other than plotting step response for the control system?
> 2. If so, why my MATLAB does not show a proper help or document for its explanation? What Blockset or Toolbox am I missing?
> 3. Why my MATLAB keeps giving me the error message for licensing?
>
> Thank you very much.
>
> Shingo.

Hi Shingo, I'll address your questions # 1 and 2. As Chris suggested, the licensing issue you will need to sort out with your local MATLAB administrator.

The short answer is that the step() you are seeing is NOT the unit step response. The step you are seeing is a method associated with each System object.
I'll explain.

With System objects, the method that actually implements the algorithm is called step(). In other words, step() is what processes the data. But step does much more than that, step() handles initialization, and if there are states involved, it manages the state information as well. So step() takes care of a lot of processing that prior to System objects, you may have had to manage explicitly yourself with code.

Every System object has its own step method, the step method syntax for each object is documented both in the command line help and in the documentation.

See:

>>help video.MultimediaFileReader

and

>>doc video.MultimediaFileReader

If you scroll down on the help page for the object (the class MultimediaFileReader), you will see a list of Methods. Click on the hyperlink for step, you will get the help page for the step method applicable to that particular object.

If you want to look directly at the command line help, or the documentation for the step method of a particular System object, you can enter:

>> help video.MultimediaFileReader/step
or
>> doc video.MultimediaFileReader/step

Remember, every step method is linked to its own System object. To understand the behavior of a given call to the step method, you have to read the step method help for that particular object.

So here is the command line help example for video.MultimediaFileReader. I'll annotate it to try and explain what the code means:

First create the MultimediaFileReader object.

hmfr = video.MultimediaFileReader('viplanedeparture.avi');

If you enter hmfr at the command line, you will see all the properties of the object you have created. hmfr is now a handle to your object.
Next, you will want to play your video, so let's create a VideoPlayer object.

 hp = video.VideoPlayer;

Again, if you enter hp at the command line, you will see the properties of the VideoPlayer object. hp is a handle to your object. Note that you have created your objects before you actually process data. Once you have created your System objects the way you want them, you are ready to use their step methods to process data.

Let's read and play the video in the file viplanedeparture.avi

while ~isDone(hmfr)

isDone() is a method of the object that hmfr represents--MultimediaFileReader
isDone() returns true if the file reader has reached the end of the file, so
while ~isDone(hmfr) says, "As long as you have not reached the end of the file, do
something."

Now call the step method for MultimediaFileReader.
         videoFrame = step(hmfr);

Note that the input to step is the handle hmfr. This is a handle to a
MultimediaFileReader object. Because you are inputting a handle to a particular type of object, MATLAB knows exactly what step method you want to use.

If you read the help for the video.MultimediaFileReader/step method, you will see that:

videoFrame = step(hmfr);

outputs one frame of video each time you call it. Since you are calling it in a loop, it will continue to output one frame of video until you exit the loop (when the end of the file is reached).

After you read each frame, you want to play it. For this, you use the step method of the VideoPlayer object.

step(hp, videoFrame);

Look at the help for video.VideoPlayer/step. This takes as inputs the handle to the VideoPlayer object AND the videoFrame you read the line before. Again, because you are calling this in a loop, the VideoPlayer object's step method continues to play a videoFrame each time you call step, until the loop exits.
       
After the end of the while statement (so after you exit the loop), the release() method for both the video player (handle -- hp) and the multimedia file reader (handle -- hmfr) are used to basically clean things up.

 release(hp);
 release(hmfr);

Hope that helps,
Wayne

Subject: question about how to use "step"

From: Steven_Lord

Date: 15 Oct, 2010 14:09:04

Message: 4 of 8



"Shingo " <shingo_yasuhara@yahoo.com> wrote in message
news:i98jm3$441$1@fred.mathworks.com...
> Hi, I am a MATLAB user at the beginners level.
> I have a few questions about how to use "step".
> According to the "help step" or "doc step" explanation, this function is
> utilized for plotting step response in the control system.

That is one version of the STEP function, yes.

> However, when I was watching the webinar for the Video and Image
> Processing Blockset, entitled, "Computer Vision and Video Processing Using
> MATLAB", this "step" function was being used in a completely different
> fashion. I am confused.
>
> For example, in the demo in the webinar, it was used like, "I =
> step(reader)", where, reader = video.MultimediaFileReader;

That call to STEP was not invoking the STEP _function_ in Control System
Toolbox:

http://www.mathworks.com/help/toolbox/control/ref/step.html

but the STEP _method_ of the video.MultimediaFileReader class.

http://www.mathworks.com/help/toolbox/vipblks/ref/video.multimediafilereader.step.html

Classes in MATLAB can "overload" functions to do something slightly
different when called with an instance of that class.

http://www.mathworks.com/help/techdoc/matlab_oop/brdqi79.html

> "of = step(optical, rgb2gray(I))", where optical = video.OpticalFlow
> or
> "Ishp = step(shapes, I, lines)", where shape = video.ShapeInserter
> Well, in any case, I wanted to give a trial&error myself, and tried to run
> the m-file that I've found in one of the demo for the Video and Image
> Processing Blockset.
> Unfortunately, however, MATLAB returned an error at the line for "step".
> The following is the error message.
>
> "??? Error using ==> step
> Reported by video.BinaryFileReader: Unable to checkout a license for
> the Video and Image Processing Blockset."

I agree with Cris's diagnosis here.

*snip*

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: question about how to use "step"

From: Raymond Phan

Date: 10 Jul, 2012 03:49:39

Message: 5 of 8

Dear Wayne,

Even though this is 2 years later, I just wanted to tell you that this is the most comprehensive explanation on how to use the step function when it pertains to system objects. I've been looking around for days on how the step function works, and every time I tried looking it up, it would bring me to the unit step response doc. There were many image and video processing webinars that I took a look at that used the step function, and I couldn't make any sense out of it.

This answered a lot of my questions, and I just wanted to thank you for a very well explained primer on how step works.

Thanks again,
- Ray.

"Wayne King" wrote in message <i99c7l$c1h$1@fred.mathworks.com>...
> Hi Shingo, I'll address your questions # 1 and 2. As Chris suggested, the licensing issue you will need to sort out with your local MATLAB administrator.
>
> The short answer is that the step() you are seeing is NOT the unit step response. The step you are seeing is a method associated with each System object.
> I'll explain.
>
> With System objects, the method that actually implements the algorithm is called step(). In other words, step() is what processes the data. But step does much more than that, step() handles initialization, and if there are states involved, it manages the state information as well. So step() takes care of a lot of processing that prior to System objects, you may have had to manage explicitly yourself with code.
>
> Every System object has its own step method, the step method syntax for each object is documented both in the command line help and in the documentation.
>
> See:
>
> >>help video.MultimediaFileReader
>
> and
>
> >>doc video.MultimediaFileReader
>
> If you scroll down on the help page for the object (the class MultimediaFileReader), you will see a list of Methods. Click on the hyperlink for step, you will get the help page for the step method applicable to that particular object.
>
> If you want to look directly at the command line help, or the documentation for the step method of a particular System object, you can enter:
>
> >> help video.MultimediaFileReader/step
> or
> >> doc video.MultimediaFileReader/step
>
> Remember, every step method is linked to its own System object. To understand the behavior of a given call to the step method, you have to read the step method help for that particular object.
>
> So here is the command line help example for video.MultimediaFileReader. I'll annotate it to try and explain what the code means:
>
> First create the MultimediaFileReader object.
>
> hmfr = video.MultimediaFileReader('viplanedeparture.avi');
>
> If you enter hmfr at the command line, you will see all the properties of the object you have created. hmfr is now a handle to your object.
> Next, you will want to play your video, so let's create a VideoPlayer object.
>
> hp = video.VideoPlayer;
>
> Again, if you enter hp at the command line, you will see the properties of the VideoPlayer object. hp is a handle to your object. Note that you have created your objects before you actually process data. Once you have created your System objects the way you want them, you are ready to use their step methods to process data.
>
> Let's read and play the video in the file viplanedeparture.avi
>
> while ~isDone(hmfr)
>
> isDone() is a method of the object that hmfr represents--MultimediaFileReader
> isDone() returns true if the file reader has reached the end of the file, so
> while ~isDone(hmfr) says, "As long as you have not reached the end of the file, do
> something."
>
> Now call the step method for MultimediaFileReader.
> videoFrame = step(hmfr);
>
> Note that the input to step is the handle hmfr. This is a handle to a
> MultimediaFileReader object. Because you are inputting a handle to a particular type of object, MATLAB knows exactly what step method you want to use.
>
> If you read the help for the video.MultimediaFileReader/step method, you will see that:
>
> videoFrame = step(hmfr);
>
> outputs one frame of video each time you call it. Since you are calling it in a loop, it will continue to output one frame of video until you exit the loop (when the end of the file is reached).
>
> After you read each frame, you want to play it. For this, you use the step method of the VideoPlayer object.
>
> step(hp, videoFrame);
>
> Look at the help for video.VideoPlayer/step. This takes as inputs the handle to the VideoPlayer object AND the videoFrame you read the line before. Again, because you are calling this in a loop, the VideoPlayer object's step method continues to play a videoFrame each time you call step, until the loop exits.
>
> After the end of the while statement (so after you exit the loop), the release() method for both the video player (handle -- hp) and the multimedia file reader (handle -- hmfr) are used to basically clean things up.
>
> release(hp);
> release(hmfr);
>
> Hope that helps,
> Wayne

Subject: question about how to use "step"

From: Pierre Gravel

Date: 24 Apr, 2013 13:49:09

Message: 6 of 8

Hi

This problem might have a solution already but I am not aware of it. This is about the step function for the Computer Vision Toolbox.
I have read the thread on the subject but I don't see a practical solution.

I get the message

Error using MorphologicalDilate/step
Unable to checkout a license for the Computer Vision System Toolbox.

when I run the following CVT and IPT demos:

IPT: Finding the Rotation and Scale of an Image Using Automated Feature Matching
CVT: Video Stabilization

Both demos stop at the lines of code involving the step function.

I don't think the error has anything to do with the license for the CVT or the number of used tokens because I can call other CVT
functions at anytime without having error messages.

Is there an easy solution/fix to the step problem?

I use Matlab on a Mac with the OS X version 10.8.3

Pierre

Subject: question about how to use "step"

From: dpb

Date: 24 Apr, 2013 14:12:58

Message: 7 of 8

On 4/24/2013 8:49 AM, Pierre Gravel wrote:
...

> I get the message
>
> Error using MorphologicalDilate/step
> Unable to checkout a license for the Computer Vision System Toolbox.
>
> when I run the following CVT and IPT demos:
>
> IPT: Finding the Rotation and Scale of an Image Using Automated Feature
> Matching
> CVT: Video Stabilization
>
> Both demos stop at the lines of code involving the step function.
>
> I don't think the error has anything to do with the license for the CVT
> or the number of used tokens because I can call other CVT functions at
> anytime without having error messages.
> Is there an easy solution/fix to the step problem?
> I use Matlab on a Mac with the OS X version 10.8.3

Contact TMW official support for installation/licensing issues at the
mathworks.com site.

--

Subject: question about how to use "step"

From: witek@mathworks.com

Date: 24 Apr, 2013 14:46:39

Message: 8 of 8

Hi Pierre,

It looks like you don't have a license for Computer Vision System Toolbox.

The step() call invokes a method on objects contained in the toolbox.

Witek


Pierre Gravel <pgscientifix@gmail.com> wrote:
> Hi
>
> This problem might have a solution already but I am not aware of it. This is about the step function for the Computer Vision Toolbox.
> I have read the thread on the subject but I don't see a practical solution.
>
> I get the message
>
> Error using MorphologicalDilate/step
> Unable to checkout a license for the Computer Vision System Toolbox.
>
> when I run the following CVT and IPT demos:
>
> IPT: Finding the Rotation and Scale of an Image Using Automated Feature Matching
> CVT: Video Stabilization
>
> Both demos stop at the lines of code involving the step function.
>
> I don't think the error has anything to do with the license for the CVT or the number of used tokens because I can call other CVT
> functions at anytime without having error messages.
>
> Is there an easy solution/fix to the step problem?
>
> I use Matlab on a Mac with the OS X version 10.8.3
>
> Pierre

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us