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 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Santi
am 20 Dez. 2016
Bearbeitet: Santi
am 21 Dez. 2016
NOTE: A mask can be easily created. Thank you.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 20 Dez. 2016
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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!