필터 지우기
필터 지우기

This image correspond to a specimen deformed in the vertical direction. Would you have any suggestion to lift deformed pixels and make a "perfecly horizontal block"

조회 수: 1 (최근 30일)
NOTE: A mask can be easily created. Thank you.

채택된 답변

Image Analyst
Image Analyst 2016년 12월 20일
Just go along your mask finding the top line, then use circshift or imtranslate or simple indexing to lift the line.
[rows, columns] = size(mask);
for col = 1 : columns
thisColumn = grayImage(:, col);
topLine = find(mask(:, col), 1, 'first');
thisColumn = [thisColumn(topLine:end), zeros(topLine-1, 1)];
grayImage(:, col) = thisColumn;
end

추가 답변 (1개)

Santi
Santi 2016년 12월 21일
편집: Santi 2016년 12월 21일
Thank you for this great approach; worked and very easy to understand.
Best regards

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by