Matlab相关 发表于 2019-12-07 | 分类于 Matlab rgb三分量的分离和结合 RGB三分量的分离和结合 123456% 分离 img_r = img(:,:,1); img_g = img(:,:,2); img_b = img(:,:,3); % 结合 img = im2uint8(cat(3, img_r, img_g, img_b)); 调用摄像头 附加功能 -> 获取硬件支持包 -> 搜索 Image 选第一个安装 12345678910111213141516info = imaqhwinfo('winvideo'); % 选用设备 obj = videoinput('winvideo',1,'MJPG_848x480'); % 可选不同分辨率 h = preview(obj); figure while ishandle(h) frame = getsnapshot(obj); % 获取帧 % ---------------添加操作--------------------- img = rgb2gray(frame); img = histeq(img); % ------------------------------------------- subplot(1,2,1); imshow(frame); subplot(1,2,2); imshow(img); drawnow end 画离散点 123x = [1,2,3,4] y = [4,3,2,1] scatter(x,y,'r*');