How to run the code?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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일
0 개 추천
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!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)
