I am working on a video processing project which needs some flipping of frame. I tried using cvFlip but doesnt seem to flip along y axis (x axis working...) and results in segmentation fault. Is there any other option??
cv::Mat dst=src; //src= source image from cam
cv::flip(dst, dst, 1); //segmentation fault shown
imshow("flipped",dst);
Tap the Tools option at the bottom of the screen, then select Rotate from the menu that appears. At the bottom of the display you'll see an icon the has two arrows pointing at each other, with a dotted vertical line between them. Tap this and you should see your image flip back to a normal orientation.
cv::Mat src=imload("bla.png");
cv::Mat dst; // dst must be a different Mat
cv::flip(src, dst, 1); // because you can't flip in-place (leads to segfault)
Use cv::flip
and pass 1
as flipcode
.
Looking at your edit with the sample code, you cannot flip in place. You need a separate destination cv::Mat
:
cv::Mat dst;
cv::flip(src, dst, 1);
imshow("flipped",dst);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With