stright line in one column or raw
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
majed majed
am 14 Mär. 2015
Bearbeitet: majed majed
am 30 Mär. 2015
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147862/image.bmp)
could any one help me ?
if i have a line as figure shown with pexils which does not exixt in one line (raw or column ) how can i make this line completely stright ? what code i hav to write ?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 14 Mär. 2015
Just get the coordinates
[rows, columns] = find(grayImage < 128);
Then find the max and min:
row1 = min(rows);
row2 = max(rows);
% Find average column
meanColumn = int32(mean(columns));
Then draw the line
grayImage(row1:row2, meanColumn) = 0;
4 Kommentare
Image Analyst
am 15 Mär. 2015
What "cells"? Do you mean pixels? And what does "delete" mean to you, keeping in mind that an image must remain rectangular. Do you just want to replace them (not delete them) with white pixels? Then why not just draw the line on a completely new white image
whiteImage = 255 * ones(rows, columns, 'uint8');
whiteImage(row1:row2, meanColumn) = 0;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!