Year 2 sem 2 – Interactive 2 – Exercise 1, Mirror Mirror on the.. screen.

This is the first exercise of max and we are all new to this program(we were kind of used to the script coding and this is really new! YAY TO NO MORE SCRIPT WRITING!! hopefully)

“your face is so ugly where the mirror got blackout if you are too near”

Principals behind this project:
1 – turn camera on
2 – detect face using the camera
3 – know how big(near) the face is in correlation to the image
4 – dim the image the bigger(nearer) the face is in correlation to the image
5 – when there are no face, set to normal value i.e. 1
6 – in the event of rapid transition between jumping numbers(face and no face) gradually dim or brighten the image.

I personally think max is relative easy to pick up but hard to master as it is a logic base(atleast i think it is for now) and the biggest problem of max is that 1- the documentation is hard to find comparing to other coding language. 2 – you have to know the syntax of the object before you can do anything and *read number 1 again*

there are a few difference between max and processing, i love that max is a multi thread processor which means it can do many different task at a single moment which is visually making sense (like things happening at the same time can be put side by side)

some really useful stuffs I’ve learnt in this exercise:

  • jit. – a useful library
  • cv.jit. – a library that need to download
  • unpack – take a package of many sets of number and split them into different number
  • Split – to be honest, i dont really know how this came about in my patch, i copied from somewhere and put it in which works(shall find out next time)
  • scale – to map the input and scale it to the range of output
  • line – to “smoothen” the transition of one number to anotherBelow is the system i used, the patch”p unpack&split” is math which i used to calculate where the face is and the best and smoothest transition between face.
    2017-02-06-19-15-34 2017-02-06-19-15-54 2017-02-06-19-16-07 2017-02-06-19-16-38