Image processing systems have been widely used in monitoring livestock for many applications. The primary goal of this work was to implement an image processing system for use in an Environmental Animal Preference Chamber to detect hen navigation between four compartments of the chamber. One camera was installed above each compartment to produce top-view images of the whole compartment. An ellipse-fitting model was applied to captured images to detect whether the hen was present in a compartment. During a choice-test study, mean ± SD success detection rates of 95.9 ± 2.6% were achieved when considering total duration of compartment occupancy. The above technique was used to monitor ammonia aversion in the chamber. As a preliminary pilot study, different levels of ammonia (0, 10, 20 or 40 parts per million) were applied to different compartments while hens were allowed to navigate between compartments. Using the automated monitor tool to assess occupancy, a negative trend of compartment occupancy with ammonia level was revealed, though further examination is needed.