필터 지우기
필터 지우기

How to run standalone executable from msdos

조회 수: 2 (최근 30일)
Prashant Somani
Prashant Somani 2012년 2월 17일
편집: Matt J 2013년 10월 15일
Dear Friends,
I have made a below command and need to call it in batch file as
myprogram.exe input.jpg output.jpg
My code is as below
im=imread(input.jpg);
imb=im2bw(im,0.2);
for j=0:7
imro=imrotate(imb,45*j);
for k=1:size(imro,2)
if sum(imro(k,:))~=0
pos(j+1,1)=sum(sum(imro(k:k+20,:)));
pos(j+1,2)=j*45;
break
end
end
end
pos=sortrows(pos,1)
imf=imrotate(im,pos(1,2));
imf=imcrop(imf,[size(imf,1)/2-100,size(imf,2)/2-100,200,200]);
imwrite(imf,output.jpg,'Quality',100)
  댓글 수: 1
Friedrich
Friedrich 2012년 2월 17일
What is your actual question? The way you call your exe is fine. So what is your actual problem?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2012년 2월 17일
At the top add
function myprogram(infilename, outfilename)
Change your line
im=imread(input.jpg);
to
im = imread(infilename);
Change your line
imwrite(imf,output.jpg,'Quality',100)
to
imwrite(imf, outfilename, 'Quality', 100)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by