Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq dispose for previous frames

Hi everybody, i'm trying to develop a system which can compute how the images are shifted among them.

 

Initially i started working in frequency domain, it works very well but it take a lot of time to have the pixel shift amount. Since i need a real time application i choose to work in time domain and doing a simple correlation between portion of the images.

 

I've written the code in OpenCV and with a DLL i execute this code through labview. The problem is that in order to feed the  DLL with the previous frame i need to generate new images. I tried to free the memory calling the image with the same name using Imaq create and then link it to Imaq Dispose but it doesn't work. 

 

I need to free the memory after the DLL compute everything and i cannot use sequence structure because i've noticed that with that structure i'm not able anymore to have the previous frame with the shift registers.

 

Can anybody help me?? I attached the .vi and the source code .cpp and the .dll

 

Thank you!

Download All
0 Kudos
Message 1 of 6
(5,432 Views)

Hi xFile,

 

I don't understand what do you mean with "to free memory". What kind of problem are you experiencing? What kind of memory allocation do you have?

 

Did you try to build a state machine instead of using flat sequence? You can create an ending case in which you deallocate preallocated memory, by clearing every open image references.

 

Hoping this will help you,

 

best regards.

 

Cla_CUP 

0 Kudos
Message 2 of 6
(5,349 Views)

I'm experiencing this: if you run the .vi for more than 10 minutes it crashes because if you check from task manager the application, it is occupying all the memory.

 

What kind of blocks allows me to build a state machine?

 

Thank you.

0 Kudos
Message 3 of 6
(5,345 Views)

No blocks,

 

you need to build a software architecture.

 

You can look @ this community example. In addition to this you can refer to LabVIEW template project, looking for Simple State Machine template project.

 

Best Regards.

 

Cla_CUP

0 Kudos
Message 4 of 6
(5,343 Views)

I finished to realize the software with state machine but nothing changes. Actually i'm thinking that disposing the image by name reference doesn't work at all.

 

I attach the .vi.

 

thank you for the help.

0 Kudos
Message 5 of 6
(5,336 Views)

Is there somebody who can solve this problem? I can't figure out what is the solution..

0 Kudos
Message 6 of 6
(5,196 Views)