PDA

View Full Version : SET ROI function in LabView



ATTILA.B
October 21, 2010, 00:13:02
HI,

how can I use the SET ROI function under LabView 7.1 ?
I would like to cut a smaller area from the full image.
I get a message about the camera doesn't support the flipping.

Camera: USB DFK 72AUC02
Please see the attachements.
Thanks in advance !

attila

Stefan Geissler
October 25, 2010, 08:48:26
Hello,

If the error occurs in "OpenDevice.vi", I suggest to remove the "SetROI" vi first and check again. Then I suggest to debug into the "OpenDevice.VI" and check, where the error occurs. It must be one of the parameters, that is wrong for the camera.

ATTILA.B
October 28, 2010, 00:41:51
Hello Stefan,

I have created a little program, and the SET ROI function is working well in normal case.

If one of the ROI parameter is incorect (bigger than the image size) the function is working but the failure message appeared at next time when the OpenDevice.vi is running (at settings the color format).

If I ignore the message the program running without problem until the next opening function. It seems something is stucked in the active-x control, the program wants to set the flip parameters that is not exist at this camera.

It is needed to re-insert (or delete and insert) the Active-x control to clear this problem.

The pre-checking the ROI parameters could be a solution but, how can I clear or reset the Active-x control with program ?

Thanks for Your support in advance !
Attila

Stefan Geissler
October 28, 2010, 08:28:12
Hello,

the problem is LabVIEW not reinitializing the IC Imaging Control ActiveX if a new debug session is started. That means, the ROI filter is not removed and, much worse a new one is added to the filter chain. This makes your program slower each time you start debugging and also cause the error message you encounter. Thus, I created the "IC_Clear.vi" that stops a possibly running live video stream and removes all filters that may are in use. This "IC_Clear.vi" should be the first after IC Imaging Control and the last VI in your diagram.

ATTILA.B
November 1, 2010, 22:20:58
Hello,
thanks for Your support, I will use your IC_clear.vi as you advise. The demo program is working now, I have started the program coding.
The topic could be closed.

Regards:
Attila

sitejasshah
November 27, 2012, 09:01:04
I saw similar behaviour when I first tried the SET ROI vi. It would work the first time that I run the labview vi.
But it would give me " error -2146959355 server execution failed " at the IICImagingControl.MemoryCurrentGrabberColorformat in IC_OpenDevice > IC_RestoreState when I tried running it the next time. It would freeze labview and I would have to kill it from task manager before I can run it in labview again.
Like someone mentioned in the previous post, I can delete and re-insert the ICImagingControl from the vi to get it working. But that is tedious.
I simply used the IICImagingControl.LoadDeviceStateFromFile method instead of the IC_RestoreState vi to load the settings from my setup file.
Now the SetROI vi works well without any errors.
Thank you for other posts on similar topic. They helped in arriving at this solution.

zoleid
November 7, 2013, 12:08:48
Hello,

I have a similar problem. I tried to initialize the camera for my measurements. I set the exposure time, gain, size of window, etc. However, when I set the ROI, I got the

'Error -2147352567 occurred at Property Node (arg 1) in ...'

message. This occurred either when I tried to use many of the vi's right after setting the ROI (IC_OpenDevice, IC_SetPropertyValue, IC_SetROI). I tried the IC_Clear.vi, but it did not help. The only thing I could do was to remove the ICImagingControl and re-insert it. I did not get this error message when I did not try to set the ROI. However, it would be essential for us. Is there anyting I missed? What should I do to make the IC_SetROI.vi fine?

Thank you for the help in advance.

Best regards,
Daniel

1636

Stefan Geissler
November 7, 2013, 14:11:41
Hi

Which camera model do you use?

zoleid
November 8, 2013, 12:02:26
Hi

Which camera model do you use?

Hi,

I am using the DMK23G445 camera.

Greetings, Daniel

Stefan Geissler
November 11, 2013, 10:27:37
I would like to know, why do you have two VIs, you pass the 0/0/800/800 roi to?

(I have no LabVIEW installed currently, therefore, I do not know, what the icons mean / which VIs are used, so please let me know)

zoleid
November 12, 2013, 11:19:21
I would like to know, why do you have two VIs, you pass the 0/0/800/800 roi to?

(I have no LabVIEW installed currently, therefore, I do not know, what the icons mean / which VIs are used, so please let me know)

As I understood, the first one resizes the live video area on the screen, while the second applies the ROI filter (IC_ResizeLiveVideo and IC_SetROI, respectively, I attached their block diagrams). However, the first did not do anything, and the second prohibited any further actions.

Best regards, Daniel

Stefan Geissler
November 12, 2013, 15:42:19
ok, that is helpful.

I suggest to create a new, small vi, that opens a camera, sets a video format, bigger than you 800x800, and selects an ROI. See, what happens. This is, what I would do to narrow down the problem.

BTW: Which LabVIEW version do you use?

zoleid
November 14, 2013, 11:26:50
Dear Stefan,

When the ROI filter is set, does the DMK23G445 camera transfer only the relevant part of the captured image, or does the driver cut the relevant part after the whole image had been transferred?

Greetings, Daniel


ok, that is helpful.

I suggest to create a new, small vi, that opens a camera, sets a video format, bigger than you 800x800, and selects an ROI. See, what happens. This is, what I would do to narrow down the problem.

BTW: Which LabVIEW version do you use?

Stefan Geissler
November 14, 2013, 16:56:24
When the ROI filter is set, does the DMK23G445 camera transfer only the relevant part of the captured image, or does the driver cut the relevant part after the whole image had been transferred?

The camera transfers the whole sensor content, not a part of it. The ROI is clipped by IC Imaging Control.
That means, the transport trough Network and color space transformation (if necessary) is done on the complete image. You will not achieve a higher frame rate using the ROI filter.

zoleid
November 20, 2013, 10:32:58
The camera transfers the whole sensor content, not a part of it. The ROI is clipped by IC Imaging Control.
That means, the transport trough Network and color space transformation (if necessary) is done on the complete image. You will not achieve a higher frame rate using the ROI filter.

Dear Stefan,

Thank you for your answer and your help. If the camera transfers the whole image anyway, then it will be much simpler if I cut the relevant part within our software, as our software uses the images as 2D arrays.

Best regards, Dani

eldiegoefe
November 30, 2013, 08:31:27
Hello Stefan. I have some problems with setting the RoI from LabView, so I ask in this thread that is related.

What I found is that the smaller the video size you choose, the higher the FPS achievable. Inside LabView we are able to choose a video size of 96x96 (Y800) and a Frame Rate [FR] of 800. Actually, that FR is not the real Frames per Second [FPS] because the exposure time needs to be considered in order to calculate the "real" FPS. Using external triggers to record AVI files, I'm pretty sure that we achieve 400 real FPS at 96x96 (Y800) and at FR=800. Why do you say that "You will not achieve a higher frame rate using the ROI filter". Isn't the 96x96 region a ROI?

Now my problem: I see that the RestoreDevice VI can be used to set up all the parameters of the camera, including the FR and ROI. Anyway, it's cumbersome because is not clear from the video format customization dialog where is the ROI, since the red frame appears always centered although in the partial scan tab you can choose X Offset and Y Offset. Is there a way to have the live image on screen and select a ROI over it?

I tried to select the ROI using the IC_SetROI (and I find the IC_FlipFilter to do the same) but it crashes LabView every second time I run it. I attach a picture to show the simplest program that have this behaviour. I think that I'm starting and stopping the camera at the right places.

1655

My last question: is there a way to reset the ICImagingControl after selecting a ROI so you can start selecting a new ROI?

Stefan Geissler
December 2, 2013, 09:25:27
Hello


Why do you say that "You will not achieve a higher frame rate using the ROI filter". Isn't the 96x96 region a ROI
Because the ROI filter will clip the ROI from the complete image provided by the video capture device. It will not change the video format of the video capture device.
The ROI you want to set is not using the ROI Filter. You set a video format, so the ROI Filter is not necessary.

There are devices, such as our CCD cameras, that do not support hardware ROI. For these devices, you use the ROI Filter to reduce the amount of data to be handled and specify the region you are interested in.


Is there a way to have the live image on screen and select a ROI over it?
The region position should be restore correctly, if the "AutoCenter" Flag is off. The device dialog has a "Property" button. Clicking the button, the properties dialog is shown, in that you can disable the AutoCenter. If this does not help, the offsets must be set by the VI after the device has been restored.


I tried to select the ROI using the IC_SetROI (and I find the IC_FlipFilter to do the same) but it crashes LabView every second time I run it.
My last question: is there a way to reset the ICImagingControl after selecting a ROI so you can start selecting a new ROI?
This is, because LabVIEW does not reset the ActiveX. Instead, it keeps the ActiveX of IC Imaging Control running all the time, even if you are in edit modus. Usually, the IC Clear should fix this issue. However, as soon as you remove the ROI Filter, the problem is away.
(IC Clear : Maybe it, is because the VI runs things in parallel, so it is tried to remove the frame filters (framefilters.clear), before LiveStop is called. I should have built in a "Flat Sequence".

Danedison
March 29, 2014, 14:00:57
Hello guys......

I have a similar problem. I tried to initialize the camera for my measurements. I set the exposure time, gain, size of window, etc.

Stefan Geissler
March 31, 2014, 09:15:06
I have a similar problem. I tried to initialize the camera for my measurements. I set the exposure time, gain, size of window, etc.
Please let me know, where exactly the problem is.