f



is this right?

hello! I'm trying to add many images, in the same figure then I try to
get the standard deviation & contast....
I began with this:

To read in the raw image data, For example, a 640x480 set of 10
images:
%  f=fopen('filename','rb');
%  I=reshape(fread(fp,640*480*10,'uchar'),[640 480 10]);
%  fclose(f);

Now  I compute the contrast for a 7x7 region for all 10 files
Nf=10;
SC=zeros(size(I));
for i=1:Nf,
    SC(:,:,i)=colfilt(I(:,:,i),[7 7],'sliding',contrast);
end
Now I get the average the 10 files together
SCm=mean(SC,3);

why it does nor work, and how I can oppen all files,  i have 10 image,

Please help....

0
man6668 (7)
1/30/2005 3:18:59 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
402 Views

Similar Articles

[PageSpeed] 32

peter wrote:
> hello! I'm trying to add many images, in the same figure then I try to
> get the standard deviation & contast....
> I began with this:
> 
> To read in the raw image data, For example, a 640x480 set of 10
> images:
> %  f=fopen('filename','rb');
> %  I=reshape(fread(fp,640*480*10,'uchar'),[640 480 10]);
> %  fclose(f);
> 
> Now  I compute the contrast for a 7x7 region for all 10 files
> Nf=10;
> SC=zeros(size(I));
> for i=1:Nf,
>     SC(:,:,i)=colfilt(I(:,:,i),[7 7],'sliding',contrast);
> end
> Now I get the average the 10 files together
> SCm=mean(SC,3);
> 
> why it does nor work, and how I can oppen all files,  i have 10 image,
> 
> Please help....
> 

I think you forgot that you have to pass a function handle (so you need 
the @-character, see help colfilt) try (for files image1.gif ... 
image10.gif):

SC=[];
for i=1:10
	Im=imread(['image' num2str(i) '.gif']);
	if size(Im,3)>1
		Im=rgb2gray(Im); % convert to grayscale
	end
	SC(:,:,i) = colfilt(Im,[7 7],'sliding',@contrast);
end
SCm=mean(SC,3);



Good luck
Jorg


	
0
boe (110)
1/30/2005 7:28:56 PM
Reply: