Excessive median processing time
조회 수: 1 (최근 30일)
이전 댓글 표시
I have found that taking the median with respect to time of a group of image frames can take excessively long and is dependent on how the data is formatted as shown below:
>> tic;median(single(ones([1080 1920 3 30])),4);toc;
Elapsed time is 89.073999 seconds.
>> tic;median(single(ones([1080*1920*3 30])),4);toc;
Elapsed time is 1.509120 seconds.
I'm wondering both:
a) why is the time so different between these two cases?
b) is there any way to get around dumping everything into a massive single dimension like this if I want it to process in a reasonable period of time (because it would be so easy to make mistakes in reorganizing data back and forth like this)
Does anyone have any insight into this behavior and how to get around it?
Thanks in advance, Sean
댓글 수: 0
답변 (1개)
the cyclist
2013년 2월 2일
First off, I assume that in your second case, you meant to take the median along dimension 2. Otherwise, you don't get equivalent results.
I think you will still get very different timing results, based on a quick peek inside the median function, using
>> edit median
I frankly did not dig deeply to get an understanding, but there is very clearly code (lines 93-101) that takes advantage of vectorization for 2-dimensional arrays.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!