The formula from the Toby is right, I just add some kinds of stuff that can be used to detect the pixel belongs to an object or not.
I found the below formula from this link.
We can ideally take $alpha=1$ and $beta=0$ but practically it lies between [0,1] interval
Abstract view of the object detection process
The first step we need to do is identifying the pixels which belong to the background and which belong to the foreground. Why we do this. when we identify the background and remove the background from an image it is very easier to identify the desire object pixels in the foreground.
The second thing is Labelling pixels/ regions as foreground and background.
Basically, this detection process depends on two important factors and they are similarities and discontinuities of pixels.
What I mean by similarities is all the pixels or most of the pixels will have some similarity with them like the same colour range (yellow) or intensity. Some common techniques that are used to identify the similarity are thresholding, Region growing and region splitting.
What I mean by discontinuities is when we move from the pixels of the object to pixels of the background then we can see some sudden differences like edges. Some techniques are used like edge contour tracking where all edges are tracked, local analysis and edge linking and hough transform.
Why normal Edge detection fails to detect objects
We can use discontinuities to achieve segmentation if that so, normal edge detection is enough but we could not do object detection with normal edge detection like canny edge detection why? Since most of the edge detection techniques include canny edge detection returns thick, noisy and discontinued edges.
so basically the $object$ $boundary$ must be completed one and thickness is ideally 1 pixel.
That's why we could not do segmentation with edge detection only. so we need to do some analysis/ further processing to detect boundaries.
Basic techniques are contour tracking, local analysis and global analysis with hough transform.
The most crucial part of object detection is how you are labelling and it depends on your problem domain.