-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9490936
Showing
76 changed files
with
5,111 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import cv2\n", | ||
"import os\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"#for plotting image\n", | ||
"def mplot(img,img2=None):\n", | ||
" \n", | ||
" cv2.namedWindow('img',cv2.WINDOW_NORMAL)\n", | ||
" cv2.imshow('img',img)\n", | ||
" if img2 is not None:\n", | ||
" cv2.namedWindow('img2',cv2.WINDOW_NORMAL)\n", | ||
" cv2.imshow('img2',img2)\n", | ||
" cv2.waitKey(0)\n", | ||
" cv2.destroyAllWindows()\n", | ||
" \n", | ||
"#returns a list of output classes along with labels, character images and their class\n", | ||
"def getClassImagesWithLabels():\n", | ||
" path='/home/jabir/Project/MHCR/DATASET'\n", | ||
" file='/MD0.jpg'\n", | ||
" ls=[]\n", | ||
" for dir in os.listdir(path):\n", | ||
" print(dir.split(\"R\")[1])\n", | ||
" im=cv2.imread(os.path.join(path,dir+file),0)\n", | ||
" ls.append([int(dir.split(\"R\")[1]),im])\n", | ||
" print(len(ls))\n", | ||
" ls.sort()\n", | ||
" cls_label=[]\n", | ||
" for class_img in ls:\n", | ||
" m=class_img[1]\n", | ||
" cv2.putText(m,str(class_img[0]),(10,10),0,0.3,(0,0,0))\n", | ||
" cls_label.append(m)\n", | ||
" #mplot(m)\n", | ||
" return cls_label\n", | ||
"#returns a numpy array of unicode of all output classes\n", | ||
"def getMalForClasses():\n", | ||
" mal=np.array([3333, 3334, 3335, 3337, 3339, 3342, 3343, 3346, 3349, 3350, 3351,\n", | ||
" 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362,\n", | ||
" 3363, 3364, 3365, 3366, 3367, 3368, 3370, 3371, 3372, 3373, 3374,\n", | ||
" 3375, 3376, 3378, 3381, 3382, 3383, 3384, 3385, 3380, 3379, 3377])\n", | ||
" return mal\n", | ||
" \n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
import argparse | ||
import os | ||
import cv2 | ||
parser = argparse.argumentparser() | ||
#parser.add_argument("square", help="display a square of a given number", | ||
# type=int) | ||
parser.add_argument("file",help="just echoing") | ||
args = parser.parse_args() | ||
#print(args.square**2) | ||
#print(args.echo) | ||
def mplot(img,img2=none): | ||
|
||
cv2.namedwindow('img',cv2.window_normal) | ||
cv2.movewindow('img', 600,300) | ||
cv2.imshow('img',img) | ||
if img2 is not none: | ||
cv2.namedwindow('img2',cv2.window_normal) | ||
cv2.movewindow('img', 600,600) | ||
cv2.imshow('img2',img2) | ||
cv2.waitkey(0) | ||
cv2.destroyallwindows() | ||
img=cv2.imread(args.file) | ||
mplot(img) |
Oops, something went wrong.