LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Image subtract

Solved!
Go to solution

I have two images and I apply IMAQ subtract among these two. Image 1 is much brighter in intensity with respect to Image 2. But, I see a complete black image after the IMAQ subtraction. How can this happen.

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 1 of 13
(4,957 Views)

What are you subtracting from what? Maybe you get negative numbers, coerced to zero?

 

(sorry, I don't have IMAQ)

0 Kudos
Message 2 of 13
(4,942 Views)

Image 2 subtracted from Image 1. No it is not zero. I removed the write IMAQ 2.vi and checked the images in the VI front panel. I can see the images. But when I write it to a file (bmp, jpeg, tiff or png) I see only black image.

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 3 of 13
(4,940 Views)

Better Convert both the image into pixel array then subtract it. Later convert this to image.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 13
(4,915 Views)

@Ranjeet_Singh wrote:

Better Convert both the image into pixel array then subtract it. Later convert this to image.


What is a pixel array?

0 Kudos
Message 5 of 13
(4,912 Views)

Its a equivalent 2D array of pixel that represent one image. Can be represented in U8, U16,I16 and Float. 

 

As you said you dont have IMAQ so attching image for that

 

Here it is of array is 640X480 becasue of image of same size. 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 13
(4,907 Views)

@Ranjeet_Singh wrote:

Its a equivalent 2D array of pixel that represent one image. Can be represented in U8, U16,I16 and Float. 


I am just saying that you should be more specific when using strange and unusual nomenclature. If you google "pixel array", you mostly get results about image sensors, which does not seem appropriate here.


Ranjeet_Singh wrote:

As you said you dont have IMAQ so attching image for that

 

Here it is of array is 640X480 becasue of image of same size. 


I don't need a solution because I don't have a problem and you don't have to attach any images for me, derailing the thread in the process. The OP does have IMAQ. If you have an IMAQ solution to the subtraction problem, contribute, otherwise simply don't post.

0 Kudos
Message 7 of 13
(4,903 Views)

Yes its a image pixels. I will be more careful next time

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 13
(4,901 Views)

abikutn can also refer the image.

 

abikutn refer the attached VI for calculation of image to image pixel. Simlarly calculate for other and later use IMAQ array to image to convert the subtracted image pixel to image 

 

In my attachment I am first converting image to image pixel and later image pixel to image. In your case input to IMAQ array to image will be subtracted image pixel array

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 13
(4,895 Views)

I see that you are disposing of the images at the end of the code, which is good, but are you writing the image before that. Have you also checked what the values are in the bitmap, They may appear black but be between 0 and 10 for example. Use the colour picker tool in your drawing package of choice on your bitmap and see what the values are and if they change.

On your actual program are you acquiring 12 bit images that the camera is capable of. If so you will be acquiring 16 bit images and the dynamic display of the IMAQ indicator will come into play. You will also only be able to save correctly in PNG or TIFF.

 

Mike

0 Kudos
Message 10 of 13
(4,885 Views)