Create a device to detect object state Here is what I want to do or get it done (since I am not a embedded guy)...


create a prototype with Arduino to detect open window/door of my room using camera(image processing/object state detection)? 
that prototype will take pictures of room door/window at certain interval and than using some algorithm to decide whether they are open or not and will sound an alarm if it is open.
prototype should work in dark as well
No false alarms
Form factor should be small (the final product should not be bigger than smoke detectors that we have it in our room)


My questions are..


Is it possible? :)
What all things I need to create a prototype?
Which camera should I use? Camera should be really small.
Are algorithms available to detect it?
Your answers :-)


yes, it's possible and should not be too complex
for a simple prototype, you do not need an embedded device, just a PC with a webcam
a webcam with few megapixels should be enough
try OpenCV


After your prototype is ready, you can use a small PC-like platform.
Examples: Minnowboard, Edison, BeagleBone, RaspBerry PI 2, Arduino Yun, Galileo 2

A word of warning: depending on the expectations you have, you will have to pick more powerful models. Computer Vision is computationally intensive.
The examples I gave are roughly sorted by performance and, unsurprisingly, cost. OpenCV is available for many architectures, but afaik, it is particularly optimized for x86, since it's mostly sponsored by Intel.

Disclosure: I work for Intel, so I am more informed on Intel products, but by no means I'm trying to do advertisement, this answer is simply given to the best of my knowledge.