cvFlip function
I found this in some code that I am adjusting for my needs:
cvFlip ( img, NULL, 1 );
I don't see any logic behind it. Am I missing something?
EDIT: NULL confused me.
I found this in some code that I am adjusting for my needs:
cvFlip ( img, NULL, 1 );
I don't see any logic behind it. Am I missing something?
EDIT: NULL confused me.
This mean that img is flipped in place around Y axis. See documentation of cvFlip.
Right, I looked at: void flip(InputArray src, OutputArray dst, int flipCode) and totally neglected void cvFlip(const CvArr* src, CvArr* dst=NULL, int flip_mode=0 ), because I am used to OpenCV2. Thanks.
The NULL was basically a way of telling to use the same array for storing the data. However, supplying two times the same name in a flip operation is not that smart, since the data that gets transformed is changed while transforming. Any operation on matrices should perform a check whether they are the same or not, but make it safe for yourself, create a temp mat then copy that mat to the original afterwards. No screwup of data will ever happen then.
@StevenPuttemans Thank you for advice. I will follow it.
Asked: 2013-08-27 01:48:05 -0600
Seen: 1,234 times
Last updated: Aug 27 '13