跳转到内容

The Wikibooks community is developing a policy on the use of generative AI. Please review the draft policy and provide feedback on its talk page.

MATLAB 编程/Psychtoolbox/屏幕命令/GetImage

来自,开放的书籍,开放的世界
(重定向自 Psychtoolbox:Screen Commands:GetImage)

用法

imageArray=Screen(windowPtr,'GetImage',[rect])

从窗口中缓慢复制图像,返回一个 MATLAB uint8 数组。如果窗口的 pixelSize>8,则返回的 imageArray 包含三个层,一个 RGB 图像。rect 以窗口坐标表示,默认值为整个窗口。

截至 1998 年 4 月,imageArray 现在是 uint8 而不是 double,以节省空间(系数为 8)。但是,如果您尝试对 uint8 数组进行数学运算,MATLAB 会发出错误,因此您可能需要使用 DOUBLE 进行转换,例如 imageArray/255 会产生错误,但 double(imageArray)/255 是可以的。另请参见 PutImageCopyWindow.

检索自 "https://wikibooks.cn/w/index.php?title=MATLAB_Programming/Psychtoolbox/Screen_Commands/GetImage&oldid=1605411"
华夏公益教科书