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.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid roi error

Solved!
Go to solution

Hello again,

 

I have a problem with IMAQ ROIProfile - Invalid ROI error. 

 

First I am using Image Mask function in VA to extract a certain field of the picture and then the image is processed by 190 ROI Profile functions.16 Images need to be processed in one RUNtime. When the third image is processed the error appears. After ROI Profile function is used 450 times.

 

Does anybody know what would be the problem ? I was reading the forum but there is no clear answer.

 

Regards, 

 

Marko

0 Kudos
Message 1 of 4
(3,716 Views)

Dear Marko,

I don't have a clear image about the problem yet. As I understand, you have a 16 images to process with VA.

On the pictures you select 190 different Regions (ROIs) You have 190 ROIs on each picture to analyse in a sequence.

The 1st and the 2nd image is processed well, but it stoppes with an error at the 3rd image.

If I understood good, I would like to iterate to find the source of the problem:

 

- I want to ask, what if you throw away the 3rd image, and continue the process? So we could figure out if the source of the problem is related with the 3rd picture or not.

 If it continues well with the rest 13 images, it is possible to have image-related issue. Probably the algorithm cannot find a pattern, which is used to make the ROI on the picture (for example to build a coordinate system from a pattern), or the image type/size can be also invalid, etc...

 

- If you experience always on the third image the problem, independently what is the order of the pictures, the problem is more related with the VA code, or the VA itself.

 

Can you check those things above, and send me the result?

Then we can figure out a solution.

 

Thank you!

 

Best Regards,

Tamas

0 Kudos
Message 2 of 4
(3,697 Views)
Solution
Accepted by topic author BordoSlo

Hello Tamas,

 

Well I found the problem.

 

Each picture is cut from a plate that has 16 of elements to inspect. So one picture means one element for inspection.

 

Each picture is rotating for +/- 30° and the problem on the third picture in the third VA was that the function Set coordinate system was not set to rotate. There was no need for that in picture 1 and 2. On the third picture the pattern rotates for 27° and the Set coordinate system function needed to rotate because all other Line profile functions depend on it. So all ROIs of Line profile functions depend on that coordinate system.

 

So when picture three rotated the ROIs of Line profile in VA3 were not completely on the picture or they were completely out of the picture.

 

When I notice that and repaired it the .vi is running great and the results are as expected.

 

Offtopic:

I`we notice how powerful the Vision module is while working on this project. I should tell you that this is my second project in Vision module and I am working in LabVIEW environment for about half year now and all congratulations to NI for this graphical tool.

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

Hello Marko,

 

I'm glad to hear that you're successful with your Vision development using National Instruments products 🙂

I'm also happy that you found the source of the problem as well. I agree that after rotating we have to take care, if every rotated ROI is still on the range of the picture.

Thank you to explain the process, it's a useful conclusion!

 

Best Regards,

Tamas Szekely

Applications Engineer

National Instruments

 

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