making, saving and loading a mask

classic Classic list List threaded Threaded
3 messages Options
Ali Ali
Reply | Threaded
Open this post in threaded view
|

making, saving and loading a mask

Hi

However i read your help in forum, but  I couldn't import a mask! in fact I want to make a pic (jpg or tif) as a mask (for example a circle for masking a cylinder) and import it to PIVlab.
How to save and load a mask?
I want to know a complete procedure for above subject.
of course I think that's better to add a circle drawer for making circular masks.
(Thanks!)
sh sh
Reply | Threaded
Open this post in threaded view
|

Re: making, saving and loading a mask

Hi, I need the same thing basically. Import doesn't work. Does anyone have an example mask .mat file, that is actually importable in the GUI of PIV 1.41?
sh sh
Reply | Threaded
Open this post in threaded view
|

Re: making, saving and loading a mask

Just found the answer. The .mat file must contain two variables xmask and ymask (saved via MATLAB). Both are cell where a row equals the x or y coordinate of a point and the column the frame (you can just make 1 column and then apply the mask in the GUI for every frame in most cases).
Example:
xmask
134
150.234973460234
164.710635634483
175.858323913126
182.470013296967
183.829224650334
179.788666332753
170.786195533657
157.797369651854
142.229729514037
125.770270485963
110.202630348146
97.2138044663434
88.2113336672471
84.1707753496665
85.5299867030335
92.1416760868736
103.289364365517
117.765026539766
134

ymask
182
179.290862085032
171.457025469820
159.347407906121
144.274274357040
127.871032726383
111.915228767352
98.1359214187130
88.0263124396756
82.6819348298639
82.6819348298639
88.0263124396755
98.1359214187129
111.915228767352
127.871032726383
144.274274357040
159.347407906121
171.457025469820
179.290862085032
182