Ejemplo n.º 1
0
    def test_should_capture_frame_for_section_returns_true_and_current_index_given_change_detected(self):
        encoder = Encoder(threshold=450, null_zone=50)
        should_capture, idx = encoder.should_capture_frame_for_section(self.whiteimage)

        self.assertTrue(should_capture)
        should_capture, idx = encoder.should_capture_frame_for_section(self.whiteimage)
        self.assertFalse(should_capture)
Ejemplo n.º 2
0
    def test_should_capture_frame_for_section_should_reset_to_zero_if_number_of_sections_exceeds_total_sections(self):
        encoder = Encoder(threshold=450, null_zone=50, sections=2)
        encoder.should_capture_frame_for_section(self.blackimage)
        encoder.should_capture_frame_for_section(self.whiteimage)
        retVal, rotation = encoder.should_capture_frame_for_section(self.blackimage)

        self.assertTrue(retVal)
        self.assertEqual(0, rotation)
Ejemplo n.º 3
0
    def test_should_capture_frame_for_section_should_reset_to_zero_if_number_of_sections_exceeds_total_sections(
            self):
        encoder = Encoder(threshold=450, null_zone=50, sections=2)
        encoder.should_capture_frame_for_section(self.blackimage)
        encoder.should_capture_frame_for_section(self.whiteimage)
        retVal, rotation = encoder.should_capture_frame_for_section(
            self.blackimage)

        self.assertTrue(retVal)
        self.assertEqual(0, rotation)
Ejemplo n.º 4
0
    def test_should_capture_frame_for_section_returns_true_and_current_index_given_change_detected(
            self):
        encoder = Encoder(threshold=450, null_zone=50)
        should_capture, idx = encoder.should_capture_frame_for_section(
            self.whiteimage)

        self.assertTrue(should_capture)
        should_capture, idx = encoder.should_capture_frame_for_section(
            self.whiteimage)
        self.assertFalse(should_capture)