我有一个程序需要使用 DrawDots 函数:
[minSmoothPointSize, maxSmoothPointSize, minAliasedPointSize, maxAliasedPointSize] =
Screen('DrawDots', windowPtr, xy [,size] [,color] [,center] [,dot_type][, lenient]);
我的代码行如下所示:Screen('DrawDots', scr,[x,y],r*2,color,[],2)
但是,当我运行代码时,我收到与此函数相关的以下错误:
PTB-ERROR: You requested a point size of 49.200000 units, which is not in the range (1.000000 to 20.000000) supported by your graphics hardware.
Error in function DrawDots: Usage error
Unsupported point size requested in Screen('DrawDots').
我运行此程序的计算机是全新的,但只有集成显卡(Intel UHD Graphics 630)。但是,该代码在其他具有较低质量集成显卡的计算机上运行没有问题(Intel HD Graphics 620),所以我想知道是否存在其他问题。
我尝试将 Matlab 切换为运行 OpenGL 而不是显卡本身,但这不起作用,并且出现了相同的错误。而且,我尝试在操作系统设置为较低的屏幕分辨率时运行该程序,但这也不起作用。我在所有测试过代码的 PC 上运行 Matlab 2016b。
任何有关如何解决此问题的建议将不胜感激。谢谢。
最佳答案
尝试的两个建议:
1) 使用 Psychtoolbox Shader 实现(在 DrawDots 调用的最终参数中使用“3”,而不是“2”):
Screen('DrawDots', scr,[x,y],r*2,color,[],3)
2) 请改用 FillOval 函数,尽管这需要每个点 4 个参数(因为 FillOval 也可以绘制不是圆形的椭圆形),因此在指定坐标时请注意差异:
Screen('FillOval', scr, color, CenterRectOnPointd([0 0 r*2 r*2], x, y));
我不确定您是否想在一次调用中绘制单个点或多个点,但 DrawDots
和 FillOval
在绘制方式上也略有不同指定多个点的参数。
关于matlab - 如何修复 "Unsupported point size requested in Screen(' DrawDots')"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54540423/