LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Image subtract

Solved!
Go to solution

My question is very simple. If I run the program with the test images I have provided and do Image1-Image2. I do see it is not all ZERO'S , but when I want to save it to a file, I get a complete black image, why ?

 

 

Without saving to a file - Gives correct result.

a.png

 

 

With saving to a file - Gives INCORRECT result.

2013-10-24 13_06_11-Subtract_Images-DEV-2-(for SUB).png

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
Download All
0 Kudos
Message 11 of 13
(862 Views)
Solution
Accepted by topic author abikutn

I tend to ignore code that over-uses stacked sequences and sequence locals, but if what you are describing is correct, something is not right the way you write to the PNG. Do you have the same problem when writing to another image format?

 

(Also, can you explain the reason for the inner while loop that seems to do file reading and the subtraction twice in a row. Once is probably sufficient. 🐵

0 Kudos
Message 12 of 13
(850 Views)

Yes this happens to any image format I choose. The while was reading it in and subtracting twice, removing the while fixed the issue. Thank you.

 

I too don't use stacked swquence codes, I usually go for event driven or producer/consumer architecture. This is for testing purpose only. 

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 13 of 13
(842 Views)