Webcam frame difference and BG subtraction

 

During the last session, we covered the beauty of using boolean and the fact that everything is possible by layering the boolean statement.

Leave the light on
  • Check1: mouse over the area? (hasLeft)
  • Check2: is light currently on? 
power of calculation and shortening

Comparing my previous code with code I have rewritten after seeing Michael’s code, I realized that it is important to plan out before when writing code.

Before

After

Look for the patterns when writing the code. 

w4 project: Time flies

Time flies shows how one feels time passing quicker than before as time goes by. (Link)

Q. Text showing month is constantly printing and accumulating. What’s the solution to print only once?

Plan

Code