From 7574377159340ef9563ba5d44a856b3ea283993a Mon Sep 17 00:00:00 2001 From: aselalmazidis Date: Wed, 13 Apr 2016 05:50:31 +0000 Subject: [PATCH] Break up code at Rotation --- share/goodie/cheat_sheets/json/opencv-python.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/opencv-python.json b/share/goodie/cheat_sheets/json/opencv-python.json index b5d53690c..1a6a3c597 100644 --- a/share/goodie/cheat_sheets/json/opencv-python.json +++ b/share/goodie/cheat_sheets/json/opencv-python.json @@ -74,8 +74,16 @@ ], "Rotation": [ { - "key": "degrees = 45\n\n# calculate the center of the image\n(h, w) = img.shape\\[:2\\]\n(cX, cY) = (w / 2, h / 2)\n\nM = cv2.getRotationMatrix2D((cX, cY), degrees, 1.0)\nrotated = cv2.warpAffine(image, M, (w, h))", - "val":"Rotate Image by 45 Degrees" + "key": "(h, w) = img.shape\\[:2\\]\n(cX, cY) = (w / 2, h / 2)", + "val":"Calculate the Center of the Image" + }, + { + "key":"degrees = 45\nM = cv2.getRotationMatrix2D((cX, cY), degrees, 1.0)", + "val":"Calculate an Affine Matrix of 2D Rotation" + }, + { + "key":"rotated = cv2.warpAffine(image, M, (w, h))", + "val":"Apply an Affine Transformation to the Image. In this Case, Rotate Image by 45 Degrees" } ] }