回答:
step() 输出 ROW X COLUMN X pixel_color
其中 pixel_color = index 1 是像素中的红色量。
pixel_color = index 2 是像素中的绿色量。
pixel_color = index 3 是像素中的蓝色量。
例如,对于 X 处像素的颜色,Y = 5,10 = 第 5 行第 10 列
然后:
红色量 = (5, 10, 1)
绿色的量是 = (5, 10, 2)
蓝色的量是 = (5, 10, 3)
显示带有红色列和绿色行的框架的示例用法........
% 获取视频帧:
load('handshakeStereoParams.mat');
videoFileLeft = 'handshake_left.avi';
readerLeft = vision.VideoFileReader(videoFileLeft, 'VideoOutputDataType', 'uint8');
frameLeft = readerLeft.step();
live_scene_player = vision.VideoPlayer('位置', [20, 600, 850, 500], '姓名','LEFT');
% 在图像的第 10 行制作绿色水平条纹:
frameLeft(10,:,1)=0; % 从条纹中去除红色
frameLeft(10,:,2)=255; % 开启全绿
frameLeft(10,:,3)=0; % 去除条纹中的蓝色
% 在图像的第 10 列制作红色水平条纹:
frameLeft(:,10,1)=255; % 从条纹中去除红色
frameLeft(:,10,2)=0; % 开启全绿
frameLeft(:,10,3)=0; % 去除条纹中的蓝色
% 显示它:
步骤(live_scene_player,frameLeft); % 最初来自 frameLeftRect