1
2
3'''
4plots image as logPolar and linearPolar
5
6Usage:
7 logpolar.py
8
9Keys:
10 ESC - exit
11'''
12
13
14from __future__ import print_function
15
16import numpy as np
17import cv2 as cv
18
20 import sys
21 try:
22 fn = sys.argv[1]
23 except IndexError:
24 fn = 'fruits.jpg'
25
27 if img is None:
28 print('Failed to load image file:', fn)
29 sys.exit(1)
30
31 img2 =
cv.logPolar(img, (img.shape[0]/2, img.shape[1]/2), 40, cv.WARP_FILL_OUTLIERS)
32 img3 =
cv.linearPolar(img, (img.shape[0]/2, img.shape[1]/2), 40, cv.WARP_FILL_OUTLIERS)
33
37
39 print('Done')
40
41
42if __name__ == '__main__':
43 print(__doc__)
cv::String findFile(const cv::String &relative_path, bool required=true, bool silentMode=false)
Try to find requested data file.
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
int waitKey(int delay=0)
Waits for a pressed key.
void destroyAllWindows()
Destroys all of the HighGUI windows.
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR_BGR)
Loads an image from a file.
int main(int argc, char *argv[])
Definition highgui_qt.cpp:3