To import the array of the gray levels of a frame (or, of several frames) of a movie, you have to open it in Smile.
-
In order to work on a movie in Smile, you must first open the movie in grayscale. By default Smile opens movies in color (a default that you can change in the Preferences dialog). To change this setting temporarily by script, use the my gMovieGrey global property.
set savedmode to my gMovieGrey
set my gMovieGrey to true
set mw to DoOpen(aMoviePath)
set my gMovieGrey to savedmode
-
To read the 2-d array of the gray levels of the current frame as a matrix, use the image property of the movie windows.
set m to image of mw
QuickScalarMap(0, 0, m, 0) -- display m in a scalar map
-
To go to the next or the previous frame of the movie, use the «class STEP» property followed by draw.
set «class STEP» of mw to 1 -- next frame
draw mw
set «class STEP» of mw to -3 -- third previous frame
draw mw
|