Connect two pixels

Versión 1.0.0.0 (894 Bytes) por Kanchi
Draw a line between two pixels with any grayscale in any image.
7,4K descargas
Actualizado 3 dic 2003

Sin licencia

Connect two pixels in an image with the desired graylevel

Command line
------------
result = func_DrawLine(Img, X1, Y1, X2, Y2)
input: Img : the original image.
(X1, Y1), (X2, Y2) : points to connect.
nG : the gray level of the line.
output: result

Note
----
Img can be anything
(X1, Y1), (X2, Y2) should be NOT be OUT of the Img

The computation cost of this program is around half as Cubas's [1]
[1] As for Cubas's code, please refer
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4177

Example
-------
result = func_DrawLine(zeros(5, 10), 2, 1, 5, 10, 1)
result =
0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0
0 0 0 0 0 0 1 1 1 0
0 0 0 0 0 0 0 0 0 1

Citar como

Kanchi (2024). Connect two pixels (https://www.mathworks.com/matlabcentral/fileexchange/4211-connect-two-pixels), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R13
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0