Main Content

hasView

(To be removed) Check if view exists

The viewSet object and its hasView function will be removed in a future release. Use the imageviewset object and its hasView function instead. For more information, see Compatibility Considerations.

Description

example

tf = hasView(vSet,viewId) returns 1 if the view specified by viewID exists and 0 if it does not exist.

Examples

collapse all

Create an empty viewSet object.

vSet = viewSet;

Detect interest points in the image.

imageDir = fullfile(toolboxdir('vision'),'visiondata','structureFromMotion');
I = imread(fullfile(imageDir,'image1.jpg'));
points = detectSURFFeatures(im2gray(I));

Add a new view.

vSet = addView(vSet, 1,'Points',points);

Confirm that the view with ID 1 exists.

tf = hasView(vSet,1);

Input Arguments

collapse all

viewSet object.

View ID in the viewSet object, specified as an integer.

Output Arguments

collapse all

Validity of view connection, returned as a logical 1 or 0.

Version History

Introduced in R2016a

collapse all

R2020a: hasView function of viewSet object will be removed

The viewSet object and its hasView function will be removed in a future release. Instead, manage views and pairwise connections between views of data using use the imageviewset object. Check if a view exists in the imageviewset object using its hasView function.