# Path: src/bin/tools.py
# def CheckDir(directory):
# 	'''
# 	 @brief Create directory
# 
# 	 @param directory Name of directory.
# 	'''
# 	if not(os.path.isdir(directory)):
# 		try:
# 			os.makedirs(directory)
# 		except Exception, err:
# 			warnings.simplefilter('always')
# 			warnings.warn(str(err), Warning)
# 			warnings.simplefilter('default')


from src.bin.tools import CheckDir
import cv2, math, os, sys, warnings
import numpy as np
import matplotlib
		import matplotlib.pyplot as plt
		import matplotlib.pyplot as plt
	 @param plt (pyplot object from matplotlib (default=None))
	 @param savefig_folder (Folder path for saving figures when display isn't available.)
	 @param default_n_cols (default number of columns (default=2))
	 @param save_fig (Save figure (default=False))
	 @param save_fig_only (Save figure, and do not show plot (default=False))
	 @param inlude_main_title_in_plot (Include main title in plot. Also used as a filename for saving.)
	'''
	if plt == None:
	n_frames = len(touple_frames)
	cols = default_n_cols
	if n_frames == 0:
		return
	elif n_frames < cols:
		cols = n_frames
	rows = int(math.ceil(float(n_frames)/cols))
	fig = plt.figure(fig_number)
	i = 1
	for img_name, frame in touple_frames:
		ax = fig.add_subplot(rows, cols, i)
		if len(frame.shape) == 2:
			plt.imshow(frame, cmap='gray')
		else:
			plt.imshow(frame)
		ax.set_title(img_name)
		i += 1
	if inlude_main_title_in_plot:
		fig.suptitle(main_title)
	fig.tight_layout()
	
	if not(CheckDisplayAvailable()) or save_fig or save_fig_only:

# Path: src/bin/tools.py
# def CheckDir(directory):
# 	'''
# 	 @brief Create directory
# 
# 	 @param directory Name of directory.
# 	'''
# 	if not(os.path.isdir(directory)):
# 		try:
# 			os.makedirs(directory)
# 		except Exception, err:
# 			warnings.simplefilter('always')
# 			warnings.warn(str(err), Warning)
# 			warnings.simplefilter('default')


# Path: src/DroneVision/DroneVision_src/hardware/imageTools.py
from src.bin.tools import CheckDir
import cv2, math, os, sys, warnings
import numpy as np
import matplotlib
		import matplotlib.pyplot as plt
		import matplotlib.pyplot as plt

	 @param plt (pyplot object from matplotlib (default=None))
	 @param savefig_folder (Folder path for saving figures when display isn't available.)
	 @param default_n_cols (default number of columns (default=2))
	 @param save_fig (Save figure (default=False))
	 @param save_fig_only (Save figure, and do not show plot (default=False))
	 @param inlude_main_title_in_plot (Include main title in plot. Also used as a filename for saving.)
	'''
	if plt == None:
	n_frames = len(touple_frames)
	cols = default_n_cols
	if n_frames == 0:
		return
	elif n_frames < cols:
		cols = n_frames
	rows = int(math.ceil(float(n_frames)/cols))
	fig = plt.figure(fig_number)
	i = 1
	for img_name, frame in touple_frames:
		ax = fig.add_subplot(rows, cols, i)
		if len(frame.shape) == 2:
			plt.imshow(frame, cmap='gray')
		else:
			plt.imshow(frame)
		ax.set_title(img_name)
		i += 1
	if inlude_main_title_in_plot:
		fig.suptitle(main_title)
	fig.tight_layout()
	
	if not(CheckDisplayAvailable()) or save_fig or save_fig_only:

		CheckDir(savefig_folder)