LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix negative numbers in u16 images

Solved!
Go to solution

Hello,

I have a 2d array that is u16 (0-65K) and trying to subtract a "dark" from it. The problem is that it sometimes yields to negative numbers and it does a wrap around and shows the values as 65K. Is there a truncate function or something to make them zero. Sorry if this is a simple question. I have only been doing labview for a couple of weeks.

 

Thanks

0 Kudos
Message 1 of 10
(4,304 Views)
Solution
Accepted by topic author imageproblems

imageproblems,

 

Have you considered casting the U16 to I32, making your subtraction, coercing the value such that it does not fall below zero and finally casting it back to U16? 

I don't know but this might work for you...

 

Cheers, Matt 

 

 

cast and coerce.png

 

Message Edited by mtat76 on 05-17-2010 11:08 PM
Message 2 of 10
(4,289 Views)
Thank you. That works.
0 Kudos
Message 3 of 10
(4,262 Views)
Sorry, I meant to click the solution on your post and clicked it on mine. Wheres the undo button. Thanks again.
0 Kudos
Message 4 of 10
(4,257 Views)

imageproblems wrote:
Sorry, I meant to click the solution on your post and clicked it on mine. Wheres the undo button. Thanks again.

THe Options drop-down (top right) has a option to remove the solution marking.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 10
(4,252 Views)

Sorry. I dont see it. I see an options menu on each reply but that has nothing about clearing it. Looking at the screen, i see a thread option on the left but that has nothing about clearing the solution either.

 

 

0 Kudos
Message 6 of 10
(4,235 Views)
Haha...Ben's the master!  Thanks, Ben.
0 Kudos
Message 7 of 10
(4,225 Views)

imageproblems wrote:

Sorry. I dont see it. I see an options menu on each reply but that has nothing about clearing it. Looking at the screen, i see a thread option on the left but that has nothing about clearing the solution either.

 

 


 

The options menu to the upper right of the message that you incorrectly marked.
Message 8 of 10
(4,209 Views)

Got it.

Thanks sorry for the hassle.

Message 9 of 10
(4,198 Views)

Hassy wrote:

This is a fantastic website and information is also outstanding like ccnp magnificent in study affairs. I am very mindful about ccsp. results. I want help or good resources that prepare me and give best guidance for cisco certification. Have you any awareness about it?

 

__________________________________________________________________________
crm certification ll db2 certification dumps ll ence ll itil braindump


Huh????:smileyindifferent:nixweiss.gif

Message 10 of 10
(4,129 Views)