def test_pre_processing_wrong_destination_im_size(self): pre_processed_image = ipp.pre_processing(self.test_image) cv_image_test = self.convert_img_to_cv(pre_processed_image) im_test_width, im_test_height, im_test_depth = cv_image_test.shape wrong_size_im = np.zeros((im_test_width*2,im_test_height*3,1), np.uint8) wrong_size_im_width, wrong_size_im_height, wrong_size_im_depth = wrong_size_im.shape self.assertEquals(im_test_width, wrong_size_im_width, "Image widths do not match. input_im_width=%s, wrong_size_im_width=%s"%(im_test_width, wrong_size_im_width)) self.assertEquals(im_test_height, wrong_size_im_height, "Image heights do not match. input_im_height=%s, wrong_size_im_height=%s"%(im_test_height, wrong_size_im_height))
def test_pre_processing_correct_im_size(self): pre_processed_image = ipp.pre_processing(self.test_image)
def test_pre_processing_of_greyscale_input(self): im_grey = ipp.pre_processing(self.test_image) pre_processed_image = ipp.pre_processing(im_grey) cv_image_test = self.convert_img_to_cv(pre_processed_image) im_control_width, im_control_height, im_control_depth = im_grey.shape
def test_pre_processing_grey_scale(self): pre_processed_image = ipp.pre_processing(self.test_image) cv_image_test = self.convert_img_to_cv(pre_processed_image) im_control_width, im_control_height, im_control_depth = self.cv_image_control.shape