def test_getData(self):
     self.assertTrue(BBB.getData())
 def test_sendData(self):
     self.assertTrue(BBB.sendData())
     self.assertFalse(BBB.sendData())
 def test_humidity(self):
     self.assertGreaterEqual(BBB.read_humidity(), 0)
 def test_pressure(self):
     self.assertGreaterEqual(BBB.read_pressure(), 0)
 def test_lux(self):
     self.assertGreaterEqual(BBB.read_lux(), 0)
 def test_temp1(self):
     self.assertGreater(BBB.read_temp1(), BBB.MIN_TEMP)
 def test_getData(self):
     self.assertTrue(BBB.getData())
 def test_sendData(self):
     self.assertTrue(BBB.sendData())
     self.assertFalse(BBB.sendData())
 def test_pressure(self):
     self.assertGreaterEqual(BBB.read_pressure(), 0)
 def test_humidity(self):
     self.assertGreaterEqual(BBB.read_humidity(), 0)
 def test_temp1(self):
     self.assertGreater(BBB.read_temp1(), BBB.MIN_TEMP)
 def test_lux(self):
     self.assertGreaterEqual(BBB.read_lux(), 0)
示例#13
0
listOf3couples = []
listOf3 = []

for i in range(0, 3, 1):
    listOf3couples.append(generate_BB(Img))

    # set the point from left to right
    if listOf3couples[i][0][0] > listOf3couples[i][1][0]:
        x = listOf3couples[i][0][0]
        y = listOf3couples[i][0][1]
        x1 = listOf3couples[i][1][0]
        y1 = listOf3couples[i][1][1]
        listOf3couples[i][0] = [x1, y]
        listOf3couples[i][1] = [x, y1]

    # convert from 2points representation to point+W+H
    tmp = [
        listOf3couples[i][0][0], listOf3couples[i][0][1],
        listOf3couples[i][1][0] - listOf3couples[i][0][0],
        listOf3couples[i][1][1] - listOf3couples[i][0][1]
    ]

    listOf3.append(tmp)
    tmpList = []
    Img = clone.copy()
    print listOf3

bestBB = [BBB.selectBest(listOf3, imgpath)]

displayAll(bestBB, listOf3)