Performing sliding window for feature extraction on a test image is very slow. What is the reason

조회 수: 1 (최근 30일)
I am new to Matlab. Please help me to clear the issue. I need to perform feature extraction on a test image by sliding the window on image of size 512x512. The window size is 70x30. First I am cropping the image and extracting the feature, the storing in a CSV file for further manipulation. Performing the said operation is very slow. Matlab shows the status as busy for long time. I could not understand why the process is very slow. How to make it fast. the code is:
img=imread('1.tif');
k=1;
for i=1:512-30
for j=1:512-70
crop_image = imcrop(img,[i,j,30-1,70-1]);
toCsv(k,:) = HOG(crop_image);
k=k+1;
end
end

답변 (1개)

Walter Roberson
Walter Roberson 2016년 3월 2일
imcrop is going to be less efficient than just indexing the image.
crop_image = img(j:j+70-1, i:i+30-1, :)
Could you confirm that you want to move the window by only 1 row (or column) at a time, not by full blocks? I suspect you end up re-calculating a fair bit, but I am not sure how HOG is calculated.
  댓글 수: 1
Beulah A
Beulah A 2016년 3월 2일
Thank you for your immediate response. But in the above said case cropping is done fastly. But the problem is in execution of the next statement.
toCsv(k,:) = HOG(crop_image);
Yes,Instead HOG, I need to use other different feature extraction also later on.

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

카테고리

Help CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by