Image Processing on Matlab
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I'm working in an engineering lab right now and I've been given a relatively simple task which I just can't get to work. My lab uses imageJ to browse through their recorded video frame by frame for some measurements. However, they've recently been running into problems where imageJ can only handle a certain number of frames and the lab's video goes well over the limit often. So my task is somehow use matlab and be able to display the data(which is in TIFF format) in real time. I saw the image sequencing manual on matlab, where the code went
%load filename
%implay(filename)
well first of all, that load command doesn't work for me for some reason. I set the directory to the folder that contains the TIFF image.
%load filename
tells me that Matlab is unable to read the file and if I try
%load 'filename.tif'
Matlab throws me this error
??? Error using ==> load Number of columns on line 1 of ASCII file C:\Documents and Settings\Administrator\Desktop\lab-track\test.tif must be the same as previous lines.
If anyone can straighten this out, I'd greatly appreciate it. Thank You
[Edit Moving comment to Question - AU]
well i tried the following code:
%fname = 'my_file_with_lots_of_images.tif';
%info = imfinfo(fname);
%num_images = numel(info);
%for k = 1:num_images
%A = imread(fname, k, 'Info', info);
%implay(A)
%end
but this only displayed the first frame on the movie player. Gahh this is so frustrating.....
댓글 수: 0
답변 (2개)
Ashish Uthama
2011년 7월 14일
Do you just want to display the frames in sequence or is there any other reason you want to use implay?
[Edit: Add example - AU]
If your frames are grayscale, and each frame has the same dimensions (x by Y), then use this to create the I variable:
I=[];
for k = 1:num_images
I(:,:,k) = imread(fname, k, 'Info', info);
end
implay(I);
Depending on the number of frames (num_image). The variable I could end up being large, making the code slow. If you just wanted to perform computations, it might be faster to read in and process one/two frames at a time to keep the memory utilization low.
댓글 수: 8
Sean de Wolski
2011년 7월 18일
what does
class(I)
return?
implay() prefers its data to be binary (class logical) or uint8.
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!