HSV/HSL Algorithm

Hello all,

I’ve been thinking about it, and was wondering:

What are the time and space complexities of the HSV/HSL algorithm that runs the vision processing?

Since it’s just a simple loop through a set number of pixels, does that mean it is O(n)?

And I figure it can’t take too much space based on the fact that all of this is happening on the cRIO.

I can’t comment on how the NIVision functions are implemented, but theoretically, since colorspace conversion is a per-pixel operation, it should run in O(n) time and O(1) space (if you don’t count input/output space - especially since it can be done in-place; O(n) space if you do count input/output buffers).

I implemented this a few years ago and used an algorithm from Foley and van Dam. I found it by googling, but don’t remember exactly which site I found it at.

It is O(n) time and can be done either inplace or into another buffer of the same size.

The NIVision algorithms strive for accuracy and I don’t believe they use the approximation algorithm I mention above. I was told that the HSV is faster but less accurate than the HSL, but I haven’t verified this.

Greg McKaskle