connectedViews
Syntax
Description
specifies options using one or more name-value arguments in addition to any combination of
arguments from previous syntaxes For example, viewTable
= connectedViews(vSet
,viewId
,Name=Value
)MaxDistance=1
additionally sets the distance between two connected views.
Examples
Get Connected Views in View Set
Create an empty imageviewset
object.
vSet = imageviewset;
Add views to the image view set.
pose1 = rigidtform3d; vSet = addView(vSet,1,pose1,Features=rand(10,3),Points=rand(10,2)); pose2 = rigidtform3d([0 0 0],[1 0 0]); vSet = addView(vSet,2,pose2,Features=rand(10,3),Points=rand(10,2)); pose3 = rigidtform3d([0 0 0],[2 0 0]); vSet = addView(vSet,3,pose3,Features=rand(10,3),Points=rand(10,2)); pose4 = rigidtform3d([0 0 0],[0 1 0]); vSet = addView(vSet,4,pose4,Features=rand(10,3),Points=rand(10,2)); pose5 = rigidtform3d([0 0 0],[0 -1 0]); vSet = addView(vSet,5,pose5,Features=rand(10,3),Points=rand(10 ,2));
Connect views in the image view set.
vSet = addConnection(vSet,1,2,Matches=[1 2; 2 3; 3 4; 4 5]); vSet = addConnection(vSet,2,3,Matches=[1 2; 2 3; 3 4]); vSet = addConnection(vSet,2,4,Matches=[4 1]); vSet = addConnection(vSet,3,4,Matches=[4 1]); vSet = addConnection(vSet,1,5,Matches=[1 2; 4 1]);
Display the view set with view IDs.
plot(vSet,ShowViewIds="on");
Get the strongly connected views of view 2
with the at least 3 matched feature points.
viewTableStrong = connectedViews(vSet,2,MinNumMatches=3)
viewTableStrong=2×4 table
ViewId AbsolutePose Features Points
______ ________________ _____________ _____________
1 1×1 rigidtform3d {10×3 double} {10×2 double}
3 1×1 rigidtform3d {10×3 double} {10×2 double}
Get views with maximum distance of 2
, within view 3
.
[viewTableNeaby,dist] = connectedViews(vSet,3,MaxDistance=2)
viewTableNeaby=3×4 table
ViewId AbsolutePose Features Points
______ ________________ _____________ _____________
2 1×1 rigidtform3d {10×3 double} {10×2 double}
4 1×1 rigidtform3d {10×3 double} {10×2 double}
1 1×1 rigidtform3d {10×3 double} {10×2 double}
dist = 3×1
1
1
2
Input Arguments
vSet
— Image view set
imageviewset
object
Image view set, specified as an imageviewset
object.
viewId
— View identifier
positive integer
View identifier, specified as an integer. View identifiers are unique to a specific view.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: MaxDistance=2
sets the distance between two connected views
to 2
.
MaxDistance
— Maximum distance between connected views and viewId
view
1
(default) | positive integer
Maximum distance between connected views and the view that corresponds to
viewId
, specified as a positive integer. The distance between
any two connected views must be equal to 1
. To find indirectly
connected views, set MaxDistance
to a value greater than
1
.
MinNumMatches
— Minimum number of matched feature points
0
(default) | nonnegative integer
Minimum number of matched feature points in a connection for the view to be counted as a connected view, specified as a nonnegative integer.
Output Arguments
viewTable
— One or more views
three-column table
One or more connected or indirectly connected views, returned as a three-column table. The table must contain the columns as described in this table.
Column | Description |
---|---|
ViewID | View identifier, specified as an integer. View identifiers are unique to a specific view. |
AbsolutePose | Absolute pose of the view, specified as a rigidtform3d object. |
Points | Point cloud for the view, specified as a pointCloud object. |
By default, the function returns only directly connected views. The
distance between any two directly connected views must be equal to 1
.
To find indirectly connected views, set the MaxDistance
name-value
argument to a value greater than 1
.
dist
— Distance between identified view and each view in the view table
positive integers
Distance between the view identified in viewID
and each view in
the view table viewTable
, specified as an M-by-1
vector of positive integers.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2020aR2022b: Supports premultiply geometric transformation convention
Starting in R2022b, most Computer Vision Toolbox™ functions create and perform geometric transformations using the premultiply
convention. Accordingly, the connectedViews
function now returns the
AbsolutePose
value in the viewTable
argument as a
rigidtform3d
object, which uses the premultiply convention. Before, the function returned
AbsolutePose
as a rigid3d
object,
which uses the postmultiply convention. For more information, see Migrate Geometric Transformations to Premultiply Convention.
Query indirectly-connected camera views in an imageviewset
Added a new Name-Value argument, MaxDistance
. Use
MaxDistance
to find indirectly-connected views by setting it to a value
greater than 1
.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)