Connect two pixels

Version 1.0.0.0 (894 octets) par Kanchi
Draw a line between two pixels with any grayscale in any image.
7,4K téléchargements
Mise à jour 3 déc. 2003

Aucune licence

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

Citation pour cette source

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

Compatibilité avec les versions de MATLAB
Créé avec R13
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0