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')
採用された回答
David Fletcher
2018 年 4 月 15 日
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 件のコメント
Darsana P M
2018 年 4 月 15 日
Yes, I saved this code too. I run this and the run the hash.m file. I am not able to compile it?
David Fletcher
2018 年 4 月 15 日
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?
Darsana P M
2018 年 4 月 15 日
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?
Darsana P M
2018 年 4 月 15 日
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
Darsana P M
2018 年 4 月 15 日
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')
Darsana P M
2018 年 4 月 15 日
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)
Darsana P M
2018 年 4 月 15 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
