From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with subtracting Images

Hello everyone, I am relatively new to LabView and I have an huge order on my plate. I am using a Gige Cam with a 1394 cord to acquire images and there are several things that need to be done.

 

1) Turn on camera and take 1 image (this will be referred to as Original Image)

2) Take an arbitrary amount of ROI's and record the image and coordinates.

3) Now start a continuous image acquisition and subtracting the Original Image from the "latest image" to find the difference between the two and record that to avi and a sequence of images (slideshow). I also want to subtract the specific ROI's from each other by reapplying the same ROI to the "latest image" to find the specific difference in those areas.

4)For each different ROI subtraction that I do like Roi 1 of OI- Roi 1 latest image I would like to take that new subtracted image and turn it into an array of RGB values and save them to a spreadsheet with a time stamp. The spreadsheet will need to be organized by which ROI I chose as x axis, under that the three RGB values and on the Y axis time.

 

Right now I have completed steps 1 2 and I am stuck on 3 because whether I use IMAQ subtract Images or turn them to arrays and subtract or turn them to matrices and subtract I get whacked out subtractions. The two images are going to be of the same object so the numbers should be very close to each other thus I would assume the numbers should be very close to zero, but that aint happening.

 

I will try to post VI as soon as possible and if anyone has any suggestions on refining my other steps, it would be greatly appreciated.

0 Kudos
Message 1 of 13
(3,284 Views)

This is the VI that I am working on A few things aren't being used and I am currently trying different ways of subtractions arrays, images, matricies.

0 Kudos
Message 2 of 13
(3,263 Views)

What sort of images are you getting from these subtractions? Can you post those images? That might help us figure out what is going on.

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 3 of 13
(3,242 Views)

Ok. The rainbow looking images are the result of subtractions with roi looking somewhat similar, the black green and blue images are from ROI very close to each other (had to construct them from hand with the draw rectangle VI).

0 Kudos
Message 4 of 13
(3,231 Views)

Here's the rest.

0 Kudos
Message 5 of 13
(3,229 Views)

What are the two original images that you are subtracting?

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 6 of 13
(3,212 Views)

It is esentially a sample in a reactor and I want to detect changes in color values via subtraction and then convert that to arrays and so on.

Download All
0 Kudos
Message 7 of 13
(3,203 Views)

Here's an update,

Averaging the images before the subtraction helps greatly reduce the noise that was there in my previous images. Putting the abs dif inside the for loop now prevents the image from flip flopping between two images. Here's the next problem that I'm going through now, how am I going to choose which ROI I specified and continuously apply it to the subtracted image. Applying it doesn't present a problem all I would have to do is apply the coordinates to IMAQ image to array.

P.S. Please disregard the name of the file it was agreed on by my boss for those who speak spanish.

0 Kudos
Message 8 of 13
(3,162 Views)

If you move your ROI selection outside of the loop, and feed that into the loop. That will allow you to apply the same ROI to the subtracted image.

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 9 of 13
(3,140 Views)

I hate to beat you to the punch ,but I actually have another update. The ROI selection has been solved. The VI will run ROI's 0 to n-1 and apply itself to the subtracted image also it will produce an average R  G  and B values for that ROI. It will run through all of them and becasue it is in the while loop it will run through the same ROI's again and give a slightly different average if there is change. One problem that I am experiencing now is saving this information to a spreadsheet. The order it needs to be is this..... Time        Roi0              Roi1                       Roi2 

                                                                                sec.   AVG.(R   G  B)   AVG.(R   G   B)   AVG.(R    G    B).

 

Each RGB should be its own column, But indicated by which ROI chosen. My attempts to save it to an spreadsheet or to an excel file have been unsucessful, though notepad will take it and that information can be transfered to excel though it is not properly formatted.Is there a way to just configure what the spreadsheet will look like in labview?

I will working on this issue with you guys to see if I can figure it out too. Probably should have posted that last time too.

0 Kudos
Message 10 of 13
(3,117 Views)