Connect two pixels

버전 1.0.0.0 (894 Bytes) 작성자: Kanchi
Draw a line between two pixels with any grayscale in any image.
다운로드 수: 7.4K
업데이트 날짜: 2003/12/3

라이선스 없음

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

인용 양식

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

MATLAB 릴리스 호환 정보
개발 환경: R13
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Image Arithmetic에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0