LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vision assistant subtract images

How do you subtract two images?

I have load two images in vision assistant and I can "flip" between them but I cannot figure out how two subtract them. I guess I need to use the image buffer but it seems to load the same image into the buffer as I am working on. 

0 Kudos
Message 1 of 4
(4,432 Views)

Hi Tommy,

 

It is actually not that difficult, but you need to know how to do it. Vision Assistant normally only works on one image reference, but if you want to work on multiple images at the same time i.e. for subtracting them you need to store one of them in a buffer.

 

I prefer to do the following.

 

1) Insert a Get Image step to load in an image from a file

2) Click on Image in the Top menu bar and select Image Buffer. 

3) Select Operation to store, and choose Buffer #1

4) Insert a second Get Image step to load in the second image

5) Select the Color Operators under the color menu or Operators in the grayscale menu depending on which type of image you have. The operator icon is a yellow square with an addition symbol

6) Configure the Operators function to subtract and instead of subtracting a constant select to subtract an image from the image buffer.

7) Select Buffer #1

 

Now you should be able to see the subtracted image. Hope this helps you, else feel free to let me know.

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 2 of 4
(4,418 Views)

Hi Mr Rohde,

What if I want to work with buffers from the vision aquisition?

Thank you.

0 Kudos
Message 3 of 4
(4,185 Views)

Hi sorinpetrila

 

You would get more responses if you create a new post.

 

Working with buffers in IMAQ is fairly simple. First you need to figure out if you want a sequence (single run through where you fill up the buffer), or if you want a sequence ring. Where you start to overwrite the start of you buffer after X number of images.

 

You would need to use the first option for a single acquisition where you have enought memory to store all the images you want which is normal for if you want to acquire i.e. 100 images and then process them afterwords

 

The second option you would use in 2 circuimstances

1) You have images coming in a burst. 100 pictures wait 1 second 100 pictures wait 1 second.

2) It takes you longer time to process the image than to acquire it (i.e. 5 times as long). And you would there fore need to store the last 5 images in the buffer so you can handle the longer processing time without acquisition time to go down.

 

The best way to learn these techniques is to look at the shipping examples:

 

LabVIEW --> Help --> Find Examples

Browse for task

Hardware Input and Output --> Vision Acquisition --> NI-IMAQdx

 

High LEvel Sequence.vi shows you option 1

Low Level Grab shows you option 2 as far as I remember (don't have my LV computer here)

 

National Instruments have a Machine Vision course which thoroughly walks through these principles and have exercises in both examples.

 

 

 

Best Regards

Anders Rohde, CLD, Platinum Applications Engineer

 

0 Kudos
Message 4 of 4
(4,172 Views)