Object detection is the first and often most crucial step in any image based analysis approach when measurements are to be extraced from objects such as individual cells in an image. Robustness and accuracy of object detection depend on many factors such as noise, variability in staining efficiency, clustering of object and background illumination variations. Automated image analysis approaches for object detecton can be optimized in many different ways, and the number of different parameters that can be tweaked is often overwhelming. During this tutorial, we will focus on algorithms and parameter settings for object detection in the free and open source CellProfiler software. We will go through thresholding and watershed segmentation, including different options for pre-processing, image enhancement and background illumination correction. We will also look at the details of separating adjacent cells based on shape and intensity. We will explain how the algorithms and settings are presented in CellProfiler, and discuss strategies for parameter optimization using a number of real examples. We will also discuss pixel classification as a pre-processing step for segmentation, and show how measuring objects is a simple task once objects are accurately detected. After participating in this tutorial, the students should be able to aproach their own image analysis challenges using CellProfiler and have a good grasp on how to optimize settings for accurate object detection. They will also know how to extract and export measurements such as size, shape, position and counts of objects to quantitatively answer questions related to variations in cell morphology as observed by microscopy or image flow cytometry.