更多本人做的可见光通信工作请见博客:
直接给出代码和视觉效果
clc
clear
close all
s=strcat('frame0010','.jpg');
A=imread(s);
Agray=rgb2gray(A);
Agray = Agray(780:870,895:988);
imshow(Agray);
[row,col] = size(Agray);
%%%a=row%%%%%行
%%%b=col%%%%%%列
Agray = double(Agray);
%col = Agray(783:865,923);
a=zeros(row,1)