ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Seemingly Random Bug in Code while post processing images

Hello, 

I am having an unsual issue that I have been unable to solve. I have created a VI that performs several functions to either a folder of images or an AVI. Specifically, I am having an issue with my overlay ECU information method which applies a BCG LUT and overlays information from a text file on the images. I give the user the option of saving the images as either 8-bit images or 16-bit images. Sometimes, the images save as I want, but sometimes all the output images are all black. Without changing anything within the VI this bug occurs. I am at a loss for what is causing this. My one inclination is that sometimes after the BCG LUT table is applied and when the image is turned into an 8-bit image the pixels are not within range and they are turned into all black within the array. This prediction doesn't explain why it also occurs when outputting 16-bit images. In addition, I have tried the same BCG values running the VI different times and sometimes I get black images and sometimes I get the expected images. I have attached my VI(UI_EditedBlockDia.vi) and an example input folder of images and ECU info.

0 Kudos
Message 1 of 6
(4,146 Views)

Hello,

 

I think the problem may be that the Image Indicator on your front panel will only output either a 16 Bit or 8 bit image. You may need to change the settings for the indicator depending on the bitness of the image that you choose.

Matt G.
Product Manager
National Instruments
0 Kudos
Message 2 of 6
(4,044 Views)

I don't see where I need to specify 8-bit or 16-bit, and I am not sure how this is going to change how many images are saved to a folder outside of labview.

0 Kudos
Message 3 of 6
(4,033 Views)

I'm sorry, I think I misunderstood the problem: Some of your images are saved as all black but it doesn't matter if they are 8 bit or 16 bit? Correct? And then based on your recent reply: is every image still saved, or some of them are not if the number of images vary? 

Matt G.
Product Manager
National Instruments
0 Kudos
Message 4 of 6
(4,020 Views)

Correct, the bug happens with both 8-bit and 16-bit images, and yes all of the images save. The bug usually happens when i first open the VI, but after I run the VI with different inputs and then use the same inputs that created the bug to run the VI again, the issue usually resolves but not all the time. I have been unable to recreated the error reliably. For example, the error doesn't always happen when I first open the VI.

Thanks

0 Kudos
Message 5 of 6
(4,018 Views)

I tried running your code to be able to replicate the issue but I'm missing the controls (Control 3.ctl). Can you include either a project with all of the files or a smaller reproducing case so we can try to replicate the behavior that you're seeing?

 

Matt G.
Product Manager
National Instruments
0 Kudos
Message 6 of 6
(3,984 Views)