贴一个,Simulink的错误报告,哈哈。
---------------------------------VersionLog--------------------------
Version Path
System Generator 2016.2 C:/Xilinx/Vivado/2016.2
Matlab 8.5.0.197613 (R2015a) E:MATLAB
Vivado 2016.2 C:/Xilinx/Vivado/2016.2
---------------------------------------------------------------------
Summary of Errors:
Error 0001: Illegal parameterization: Input number of bits
Block: 'untitled/CMult2'
Error 0002: Illegal parameterization: Input number of fraction-bits
Block: 'untitled/CMult2'
Error 0003: Illegal type on port: a
Block: 'untitled/CMult2'
---------------------------------------------------------------------
Error 0001:
Reported by:
'untitled/CMult2'
Details:
For floating point operation, number of bits of both the operands
should be same. Number of bits is 16 for input port a and 32 for
constant operand.
Error occurred during "Rate and Type Error Checking".
---------------------------------------------------------------------
Error 0001:
Reported by:
'untitled/CMult2'
Details:
For floating point operation, number of fraction-bits of both the
operands should be same. Number of fraction-bits is 14 for input
port a and 24 for constant operand.
Error occurred during "Rate and Type Error Checking".
---------------------------------------------------------------------
Error 0001:
Reported by:
'untitled/CMult2'
Details:
The a port has data type Fix_16_14.
The a port must be a float signal.
Error occurred during "Rate and Type Error Checking".
---------------------------------------------------------------------
解决:把Constant Type改为默认的Fixed-point
从MATLAB打开出现错误
Error evaluating ‘MoveFcn’ callback of Xilinx Adder/Subtracter Block
C盘找不到指定模块
解决:从Xilinx Design Tools下启动MATLAB并打开文件
灰度分级代码
function J = regionGrow(I)
% 区域生长,需要以交互方式设定初始种子点,具体方法为鼠标单击图像中一点后,按下回车键
%
% 输入:I - 原图像
% 输出:J - 输出图像
if isinteger(I)
I=im2double(I);
end
figure,imshow(I),title('原始图像')
[M,N]=size(I);
[y,x]=getpts; %获得区域生长起始点
x1=round(x); %横坐标取整
y1=round(y); %纵坐标取整
seed=I(x1,y1); %将生长起始点灰度值存入seed中
J=zeros(M,N); %作一个全零与原图像等大的图像矩阵J,作为输出图像矩阵
J(x1,y1)=1; %将J中与所取点相对应位置的点设置为白
sum=seed; %储存符合区域生长条件的点的灰度值的和
suit=1; %储存符合区域生长条件的点的个数
count=1; %记录每次判断一点周围八点符合条件的新点的数目
threshold=0.15; %阈值,注意需要和double类型存储的图像相符合
while count>0
s=0; %记录判断一点周围八点时,符合条件的新点的灰度值之和
count=0;
for i=1:M
for j=1:N
if J(i,j)==1
if (i-1)>0 & (i+1)<(M+1) & (j-1)>0 & (j+1)<(N+1) %判断此点是否为图像边界上的点
for u= -1:1 %判断点周围八点是否符合阈值条件
for v= -1:1
if J(i+u,j+v)==0 & abs(I(i+u,j+v)-seed)<=threshold& 1/(1+1/15*abs(I(i+u,j+v)-seed))>0.8
J(i+u,j+v)=1;
%判断是否尚未标记,并且为符合阈值条件的点
%符合以上两条件即将其在J中与之位置对应的点设置为白
count=count+1;
s=s+I(i+u,j+v); %此点的灰度之加入s中
end
end
end
end
end
end
end
suit=suit+count; %将n加入符合点数计数器中
sum=sum+s; %将s加入符合点的灰度值总合中
seed=sum/suit; %计算新的灰度平均值
end
项目预期效果图,通过网口把处理好的图像传至PC或者pmod转VGA显示吧,显示部分还在完善中。
总结:
首先,感谢“
电子发烧友论坛”
和“xilinx”举办的这次Artix-7
试用活动,使我有机会接触到了xilinx系列FPGA板卡
,获得了一系列的体会--从FPGA到数字图像处理,当然我会继续完善项目。 授人以鱼不如授人以渔,微盘里面有很多书籍资源,我也上传一部分。