Unrecognized function or variable 'delta'.

5 次查看(过去 30 天)
%function fn = retrieve(X,irow,icol);
watermark = imread('watermark.jpg');
watermark=imresize(watermark,[32 32]);
watermarked_img = imread('watermarked_img.jpg');
[irow icol dim] = size(watermark);
watermark=rgb2gray(watermark);
watermark=im2bw(watermark,0.5);
w = reshape(watermark,irow*icol,1);
X=[];
rng(1,'twister');
for i=1:size(w,1)
for j=1:7
r_range=[5 507];
x=randi(r_range,1,1);
y=randi(r_range,1,1);
temp=[];
a=delta(watermarked_img,x,y);
temp=[double(a)];
for j=-2:2
if(j~=0)
temp=[temp ; double(delta(watermarked_img,x+j,y))];
end
end
for j=-2:2
if(j~=0)
temp=[temp ; double(delta(watermarked_img,x,y-j))];
end
end
X=[X double(temp)];
end
end
%%%%%%%%%%%%%%%%%%%%%%
global net
out=net(X);
%count1=0;
for i=1:size(out,2)
if(out(i)>0)
out(i)=1;
%count1=count1+1;
else
out(i)=0;
end
end
j=0;
out2=[];
'bbbbbbbbbbbb'
size(out,2)
for i=[1:7:size(out,2)]
j=j+1;
t=[out(i) out(i+1) out(i+2) out(i+3) out(i+4) out(i+5) out(i+6)];
out2(j)=mode(t);
end
irow
icol
size(out2,2);
w = reshape(out2,irow,icol);
[w map]=gray2ind(w,255);
imwrite(uint8(w), 'retrieve.jpg');
I = imread('retrieve.jpg');
imshow(I)
accuracy();
% T = imread('watermark.jpg');
% imshow(T)
%
  3 个评论
Mostfa Abd El-Aziz
Mostfa Abd El-Aziz 2023-11-18
Dear madhan ravi thanx for your response
kindly, how to define this function ??
Dyuman Joshi
Dyuman Joshi 2023-11-18
We can't tell you that because we do not have any information as to what the code is supposed to do or what you want to do.
In case you are asking how to define a function, refer to this - function

请先登录,再进行评论。

回答(1 个)

Ayush
Ayush 2024-1-1
I understand that you are getting unrecognized function of variable error. The error you are encountering is due to the use of delta, which is not defined as a function in the MATLAB code you have provided. It appears that delta is meant to be a custom function that you are using to process the image at specific pixel coordinates (x,y). You need to define this function or replace it with the correct MATLAB function that performs the intended operation.
Here is how you can define your own custom functions in MATLAB: https://www.mathworks.com/help/matlab/ref/function.html
Thanks,
Ayush

类别

Help CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by