How to run the code?
显示 更早的评论
https://in.mathworks.com/matlabcentral/fileexchange/45038-generate-digital-signature-of-images?focused=3805874&tab=function
I found this link for digital signature for images. This is exactly what I wanted. I saved all the functions. The main program is hash.m right? I tried running it, but got an error stating:
hash
Undefined function or variable 'METH'.
Error in hash (line 7)
if(METH=='SHA160')
采纳的回答
From the overview given by your link, the main function is:
function [digest, MSG_PADDED] = image_hash(V_LEN,H_LEN,METH,IMG_FILE)
There is also a list indicating what the arguments are, including METH
11 个评论
Yes, I saved this code too. I run this and the run the hash.m file. I am not able to compile it?
You should only have to call the main function, the main function and subfunctions will call whatever they need to call themselves (you just need to make sure the functions are present on your system - which you seem to have done). When you say you are not able to compile it, are you talking about creating standalone code that runs outside of Matlab?
SHA160=0;
SHA224=0;
SHA256=0;
SHA384=0;
SHA512=0;
if(METH=='SHA160')
SHA160=1;
elseif(METH=='SHA224')
SHA224=1;
elseif(METH=='SHA256')
SHA256=1;
elseif(METH=='SHA384')
SHA384=1;
elseif(METH=='SHA512')
SHA512=1;
end
The hash.m starts with these lines,there is no calling function of image_hash() in that line. What should be done?
Sir I downloaded all the above files. I tried to run hash.m file. I got this error.
David Fletcher
2018-4-15
编辑:David Fletcher
2018-4-15
YOU should be calling image_hash(V_LEN,H_LEN,METH,IMG_FILE) NOT hash(). image_hash(V_LEN,H_LEN,METH,IMG_FILE) then calls hash (see the last line of image_hash). In turn I imagine hash then calls the other functions you have downloaded). Beyond dealing with the results image_hash returns (or the errors it produces), your interest in the matter ends with calling image_hash
So what must be done sir?
Darsana P M
2018-4-15
编辑:Darsana P M
2018-4-15
Sir, hash.m here its not a function. image_hash() is a function. At the end I see hash too. What change should i do to remove the error? I am confused now, but i really want to work this out. If you could help me, please do help.
Right now, I tried running hash.m, I got an error?
David Fletcher
2018-4-15
编辑:David Fletcher
2018-4-15
I've just had a closer look and noticed that hash is an m file rather than a function. I've tried setting the variables in the workspace and running image_hash on a test file. No errors as such, but that was about half an hour ago and it's still running. Maybe there's a reason the submission has no stars awarded.
V_LEN=169
H_LEN=298
METH='SHA160'
image_hash(V_LEN,H_LEN,METH,'three.jpg')
Yes sir. Thanks sir.Now there is no error, but the program is still running. is there a way out?
Can you suggest some other algorithms for digital signature on images.
David Fletcher
2018-4-15
编辑:David Fletcher
2018-4-15
It was running on my computer for over an hour before I interrupted it. Maybe it will eventually give an answer, or maybe it is badly written and gone into an infinite loop. Sorry, but I'm not much inclined trying to debug other people's submitted code. It might be worth putting a question out there asking for any recommendations for functions that do what you need. It's not really my area of expertise (not that I have any real areas of expertise anyway)
ok sir. Thanks a lot
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Signal Attributes and Indexing 的更多信息
标签
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
