Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving a rectangle ROI in a txt and it restores me an oval, why?

Hi !

 

First all, thanks for reading me.

 

I've got a problem with LabView Vision.

 

I needed to find the center of a circle area, so I started using the oval function to draw and wanted to extract the center of it, but I was not able to get the coordinates of the ROI, because I didn't find something like "ROI To Oval" but I was able to save the "Oval" drawed in a txt and file and get it restored after I wanted to do it again.

 

Then, I changed it to an Annulus, and was able to extract the center of it, but I was not anymore able to restore it from the txt in which coordinates are saved.

 

Later on, I changed it to a Rectangle, I was also able to extract the center, but the saved ROI from the txt file is working but drawing me an OVAL and not a RECTANGLE. The coordinates are corrects, but I really wonder what I missed.

 

I tried a lot of solutions, but none worked atm, that's why I'm posting here.

 

A part of my code is attached.

Can anyone help me?

 

Thank you very much,

Sébastien

Message 1 of 6
(4,332 Views)

You can delete this, I solved my problem.

Ty !

0 Kudos
Message 2 of 6
(4,308 Views)

Or not !

 

I find an other solution to "solve" my problem, but I'm still interested to know HOW to restore a rectangle and not an Oval from the 4 coordonates I have.

I've setted those 4 coordonates to my "ROI Descriptor IN", Rectangle is set as you can see on the capture but it restores me an Oval which has the good coordonates of the rectangle.

It's probably a stupid change, but I don't get it, and it's annoying me.

 

Thank you,

 

Sébastien.

0 Kudos
Message 3 of 6
(4,285 Views)

Hi Zapii

Attach your program.

---
Silver_Shaper | CLD
0 Kudos
Message 4 of 6
(4,272 Views)

Hi,

 

Sorry for my late reply.

 

I can't join the whole VI for professionals reasons, but I created two which contain my problem.

 

You need the 2 following VI, and start SaveROItoTXTasRectangle.vi

 

1) Select a video in the path system (.avi would be better I think)

2) Draw a rectangle

3) Save it as default area when it's asked.

4) Lauch again the program

5) The default area will have the same coordinates but it will suggest an Oval and not a rectangle as I wished

 

I don't know what I have to change, even if I have an idea that problem is that I don't define the type to "Rectangle - Rotated", but no idea how to set it differently.

 

Thank you,

 

Regards,

Sébastien.

Download All
0 Kudos
Message 5 of 6
(4,233 Views)

Hi,

 

I finally solved the problem by saving it to an XML and not to a TXT.

 

It may help someone, so here is my VI.

 

Cheers,

Zepiii

 

PS : You can close the subjet.

0 Kudos
Message 6 of 6
(4,225 Views)