LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling and Mapping Express VI

I want to normalize an image to between 0 and 255 (full dynamic range for 8-bit intensity graph).  I am comparing the output of a VI I wrote with than from the Scaling and Mapping Express VI.  I would have expected the same result for both but not getting that.  Any thoughts?

Don
0 Kudos
Message 1 of 7
(2,907 Views)

Just see if Normalizing each individual Row of your 2 D array, gives you a more closer result

See pic

regards

Dev

 

0 Kudos
Message 2 of 7
(2,899 Views)
Well interestingly enough, I set the original problem up incorrectly as you noted since in once case I was normalizing each line of data (Express VI) and in another case I was normalizing with respect to entire image array.  So I set it up to make it apples to apples (see attached), and I get the same result.  Now I feed the image array into the express node and eliminate the for loop.
 
Sincerely,
 
Don
0 Kudos
Message 3 of 7
(2,885 Views)

No, the express VI cannot do 2D data! For the dynamic data conversion, you can specify if either rows or columns are channels and the VI will only scale each channel individually, not all channels globally. (Unless I missed something obvious, this is not well documented).

Stick with your own subVI! You can make it a bit more efficient by scaling the multiplier instead of the 2D array. Many fewer operations (see attached)!

If you want to use the express VI, you need to reshape your image into a 1D array and reshape it back to 2D later. (See attached).

Message 4 of 7
(2,877 Views)

Christian, you are everywhere (by the way did you post the nice curve fitting VIs and tutorial from NIWeek?).

The performance of the normalization routine has been quite acceptable but you are right, according to LabVIEW coding rules, your modification should increase the speed and I will use it.

You would think the express VI would give an error if you are not allowed to feed in a 2-d array.  (I just put in an error cluster indicator, ran, and did not get an error).  So I thought it was "polymorphic enough" to allow for direct usage with 2-d array.  Maybe LabVIEW R&D should consider making it so.

 

Thanks again,

Don

0 Kudos
Message 5 of 7
(2,851 Views)

Sorry, I have not posted the fitting VIs, because there is a tiny bug in LabVIEW 8.0 that breaks the feature where it automatically updates the parameter names. I need to either simplify it for 8.0 or wait for 8.20 before I can post it. I let you know when they're ready.

Yes, the express scaling VI will take 2D arrays but assumes that they are simply a series of 1D signals. There is no dynamic datatype corresponding to a single signal with 2D data! Each of the signals (rows or columns) will be normalized independently. You can actually convert the express VI (right-click...open front panel) and then look at the code to verify this behavior. The normlization is done in a loop, one 1D signal at a time. No error.

Message 6 of 7
(2,847 Views)
I would wait for 8.2.  I'm in no critical rush.
 
I see in the subscaling.vi that things are done in the loop.  Still it would seem to me to be useful to modify the Express VI for more polymorphism (any dimension array).  After all, this would increase versatility and ease of use which is what I think is certainly part of the purpose of Express VIs.  In the meantime, I am happy to stick with my (and your modded) scaling VI.
 
Sincerely,
 
Don
0 Kudos
Message 7 of 7
(2,841 Views)