object_line_int( a, b, mask, dist_trld )

Version 1.42.0.0 (7.32 KB) by Violet
Find the intersection between a line between two points and the boundary of an object in a mask
88 Downloads
Updated 24 Jul 2015

View License

This function finds the intersection between a line between points a and b and the boundary of an object in a binary mask. Point a must be inside the object. Point b can be anywhere in the image. The function always returns an intersection point by extending the line beyond point b if necessary.
The points a, b and int are given as [x,y] coordinates. Mask is a binary image containing the object of interest.

Cite As

Violet (2024). object_line_int( a, b, mask, dist_trld ) (https://www.mathworks.com/matlabcentral/fileexchange/52239-object_line_int-a-b-mask-dist_trld), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.42.0.0

Upload example file

1.41.0.0

Add an example on how to run the function.

1.4.0.0

Enable multiple intersection points to be discovered as long as they are further apart that a given threshold.

1.3.0.0

Optimize computation of distances and fix issue with output

1.2.0.0

Fixed issues with some

1.1.0.0

Minor changes to avoid issues when points lie on a vertical line.

1.0.0.0