program execution

조회 수: 1 (최근 30일)
bhargavi
bhargavi 2011년 3월 23일
[EDIT: 20110610 00:14 CDT - reformat - WDR]
x=imread('bt.jpg');
y=contrast_stretch(x,a,b,alpha,beta,gamma,Ya,Yb)
y=x;
% region 1
I=find(x<a);
y(I)=alpha*x(I);
% region 2
I=find(x>=a&x<b);
y(I)=beta*(x(I)-a)+Ya;
% region 3
I=find(x>=b);
y(I)=gamma*(x(I)-b)+Yb;
what's the error in this program.
  댓글 수: 1
Ashish Uthama
Ashish Uthama 2011년 3월 23일
We dont have access to 'bt.jpg'. And I dont think |contrast_stretch| is a MATLAB function which folks here would have access to either.
You might get a helpful answer if you at least posted the full error message.
Or, you could spend some time getting familiar with debugging in MATLAB : http://www.mathworks.com/help/techdoc/matlab_prog/f10-60570.html . This might help you solve this issue yourself, or post a more detailed question.

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 23일
Your image is an RGB image, and so 3 dimensional, but contrast_stretch only accepts two-dimensional images (grayscale)
  댓글 수: 2
bhargavi
bhargavi 2011년 3월 27일
no its not rgb image..only grayscale
Walter Roberson
Walter Roberson 2011년 3월 28일
Well, show us the exact error message and the line it is complaining about, and show us size(x), class(x) and size(alpha), size(beta), size(gamma)

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

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by