Filter löschen
Filter löschen

What does this instruction returns.

1 Ansicht (letzte 30 Tage)
Neelum Dave
Neelum Dave am 18 Feb. 2016
Beantwortet: Jos (10584) am 18 Feb. 2016
[hueChannel,~,~] = rgb2hsv(videoFrame)

Antworten (1)

Jos (10584)
Jos (10584) am 18 Feb. 2016
Apparently, the function rgb2hsv can return three output arguments. This line of code explicitly ignores the last two. A similar result can be obtained by implicitly ignoring them, by just retrieving one output.
hueChannel = rgb2hsv(videoFrame)
The use of the ~ is more commonly used to retrieve later output arguments and ignoring the earlier ones. As an example:
A = [1 4 5 3] ;
[maxValue, maxIndex] = max(A) % retrieve both
[~, maxIndex] = max(A) % use this if you are only interested in the second output
You have to look in the help of rgb2hsv to see what the first output variable will hold exactly.

Community Treasure Hunt

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

Start Hunting!

Translated by