Arrows direction is opposite to the flow direction
Closed this issue · 9 comments
@royekorolik please take a look closer on the arrows - they all look into different direction from the flow that you can observe by particle shift between the images. I think you can see the solution here:
https://github.com/OpenPIV/openpiv-python/blob/fe05da3da3429f2e71aa7c3fb473ff0b7f4e7340/openpiv/tools.py#L37
the problem relates to the fact that images origin is top left, while PIV counts rows, cols differently.
@royekorolik the arrows look right in most cases, but not in all:
@royekorolik it's flipped again for the full image
@royekorolik arrows are the main issue now. please fix it for both the full image and for ROI
is there still a problem?
is there still a problem?
of course - don't you see yourself?
I have now error messages trying to get PIV of a full image from the test1 and also if I choose ROI I get opposite direction
File "/Users/alex/Documents/OpenPIV/openpiv_gui/package/piv_plot.py", line 288, in run
self.y += int(self.piv.xy_zoom[1][0])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
/Users/alex/miniconda3/envs/openpiv_gui/lib/python3.6/site-packages/matplotlib/quiver.py:650: RuntimeWarning: Mean of empty slice.
amean = a.mean()
for the test2 i get
and it's obviously upside down picture of arrows - the arrows from the top part should be at the bottom and the arrows from the bottom should be at the top - it's like we present data flipped top/bottom.
also their direction at the top is from left to right but at the bottom the flow is from the right to left
maybe you come to the university and we do it together? you probably can fix things quickly but somehow you don't see what's going on.
or we can do it on skype while you try to show me the code and explain what gives what.
we need to take care that
a) files are read in the right order
b) when we finish the analysis we understand that the image is shown in matplotlib with the origin (0,0) at the top left corner, but numpy matrices of x,y,u,v are typically presented with 0,0 at the bottom left corner. this creates a problem. The solution is known - look inside openpiv.tools there is a way to present arrows on images and it's correct there. you just need to implement it on the full image right way and then think how to make it for the ROI (i understand it's more difficult but here's the fun challenge to solve)