Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Store a single image in Vision Acquisition

Solved!
Go to solution

Hello everyone, 

 

I am using Vision acquisition, to capture the image via USB camera. I want to capture only a single image after some adjustment with USB camera, but my problem is while selecting the "Continous Acquisition with Inline processing" ,than  "Acquire Image type : Acquire Most recent Image" and "Enable Image Logging", I am capturing all the images as long as the 'While Loop' runs. (I am keeping Vision Acquisition in While loop). I also want to use the final image as 'Image In' in 'Machine vision'. I am providing VI file herewith. 

 

In other modes (i.e Finite Acuisition with Post Processing, Finite Acuisition with Inline Processing ), I capture the Finite images as soon as the camera (loop )starts and not able to adjust the camera. 

 

Thanks 🙂

0 Kudos
Message 1 of 18
(4,000 Views)

Hello nisargsolanki,

selecting "Coninous Acquisition with inline processing" tells the camera to continiously capture images. The option "Acquire Most Recent Image" just means that it is possible that you miss images because taking the pictures is faster than logging them. That means: If the camera captures 10 images between every NI Vision Acquisition Express VI call, you only log the last one of the 10 images.

If you want to just log one image you need to select "Single Acquisition with processing".

0 Kudos
Message 2 of 18
(3,956 Views)
as I understand you want to see continuous online camera image but in capturing and logging just log last one
is it true ?
if not
you have to select single image acquisition in VS setting and use inside while loop with an event loop inside it
0 Kudos
Message 3 of 18
(3,949 Views)

Hallo Wolfgang,

 

Thanks for your reply.. 🙂

 

Yes, I understand it acquires most recent image out of 10 images it captures. But what I want to do is I want to log only last image (and not the last out of every 10 images it captures) .

 

If I use 'Single Acquisition with processing', it logs the image as soon as camera turns on and I will not get time to adjust it. 

(Simple: like how we captures the photo in our smart phone is we first open the camera and set the frame according to our choice and than we press click and we get the single image, which we captured (logged), that is what I want to do, open the camera - adjust the frame- capture - get the single logged image  🙂  )

0 Kudos
Message 4 of 18
(3,949 Views)

Hi Hatef,

 

yes, I want to see continuous online camera image but capturing and logging just last image. 

 

Thanks 🙂

0 Kudos
Message 5 of 18
(3,948 Views)
ok for this thing you have to develop algorithm
I explain some of them to use
1 use a case structure inside your wile loop with latch boolean bottom
attach vision indicator outside this case to show online image
but inside your case structure use your capturing and logging part of your code
in this case you can see online image but when push the bottom get last image
2 use local variable of image vision indicator
in other parallel while loop use other while loop again with latch push bottem with your logging part and with local variable that I indicate before in this case any time you stop second while you get last image
3 use Producer/Consumer method
last method is recommended
and first method is easiest way to do
0 Kudos
Message 6 of 18
(3,945 Views)

What about using Vision Acquisition Express VI with 'continuous acquisition' (and without 'enabled image logging') in a while loop, make the adjustments and then stop the loop. After the loop is terminated, call another Vision Acquisition Express VI in single acquisition mode to log one image.

0 Kudos
Message 7 of 18
(3,942 Views)
it is not good method to do that because any camera have time out to start and in best mode this time is near 1 second so if you do this any time you lost at least one second to start see online again
0 Kudos
Message 8 of 18
(3,938 Views)

Yes, you´re right. As I see you´ve already given three better ways to accomplish the goal.

0 Kudos
Message 9 of 18
(3,937 Views)

Hi Hatef,

Thanks for your 3 suggestions, I want to use 1st method but facing a difficulty. It is saving all the images and not the last. Could you please check.

 

Thanks 🙂 

0 Kudos
Message 10 of 18
(3,920 Views)