Webcams aren’t (yet) found in Cracker Jack boxes, but they are very inexpensive. And they seem to perform ok for Zoom meetings or rendering a decent image of an office interior. So why not just use a webcam as the front end for a machine vision application?
Before we dig in to analysis and rationale, let’s motivate with the following side-by-side images of the same printed circuit board (PCB):
Side-by-side images
In the image pair above, the left image was generated with a 20MP machine vision camera and a high resolution lens. The right image used a webcam with a consumer sensor and optics.
Both were used under identical lighting, and optimally positioned within their specified operating conditions, etc. In other words we tried to give the webcam a fair chance.
Even in the above image, the left image looks crisp with good contrast, while the right image has poor contrast – that’s clear even at a wide field of view (FOV). But let’s zoom in:
Which image would you prefer to pass to your machine vision software for processing? Exactly.
Why is there such a big difference in performance
We’re all so used to smartphones that take (seemingly) good images, and webcams that support our Zoom and Teams meetings, that we may have developed a bias towards thinking cameras have become both inexpensive and really good. It’s true that all cameras continue to trend less expensive over time, per megapixel delivered – just as with Moore’s law in computing power.
As for the seemingly-good perception, if the images above haven’t convinced you, it’s important to note that:
- Most webcam and smartphone images are wide angle large field of view (FOV)
- Firmware algorithms may smooth values among adjacent pixels to render “pleasing” images or speed up performance
Most machine vision applications, on the other hand, demand precise details – so firmware-smoothed regions may look nice on a Zoom call but could totally miss the defect-discovery which might be the goal of your application!
Software
Finally, software (or the lack thereof) is at least as important as image quality due to lens and sensor considerations. With a webcam, one just gets an image burped out, but nothing more.
Conversely, with a machine vision camera, not only is the camera image better, but one gets a software development kit (SDK). With the SDK, one can:
- Configure the camera’s parameters relative to bandwidth and choice of image format, to manage performance requirements
- Choose between streaming vs. triggering exposures (via hardware or software trigger) – trigger allows synchronizing to real world events or mechanisms such as conveyor belt movement, for example
- Access to machine vision library functions such as edge detection, blob analysis, occlusion detection, and other sophisticated image analysis software
Proprietary SDKs vs. 3rd party SDKs
Speaking of SDKs, the camera manufacturers’ are often very powerful and user friendly. Just to name a few, Teledyne Dalsa offer Sapera, Allied Vision provides Vimba, and IDS Imaging supports both IDS Lighthouse and IDS Peak.
Compare to Apple or Microsoft in the computing sector – they provide bundled software like Safari and Edge, respectively. They work hard on interoperability of their laptops, tablets, and smartphones, to make it attractive for users to see benefits from staying within a specific manufacturer’s product families. Machine vision camera companies do the same thing – and many users like those benefits.
Some users prefer 3rd party SDKs that help maintain independence to choose cameras best-suited to a given task. Thanks to machine vision industry standards like GigE Vision, USB3 Vision, Camera Link, GenICam, etc., 3rd party SDKs like MATLAB, OpenCV, Halcon, Labview, and CVB provide powerful functionality that are vendor-neutral relative to the camera manufacturer.
For a deeper dive into machine vision cameras vs. webcams, including the benefits of lens selection, exposure controls, and design-in availability over time, see our article: “Why shouldn’t I buy a $69 webcam for my machine vision application?” Or just call us at 978-474-0044.
In summary, yes a webcam is a camera. For a sufficiently “coarse” area scan application, such as presence/absence detection at low resolution – a webcam might be good enough. Otherwise note that machine vision cameras – like most electronics – are declining in price over time for a given resolution, and the performance benefits – including software controls – are very compelling.
1st Vision’s sales engineers have over 100 years of combined experience to assist in your camera and components selection. With a large portfolio of lenses, cables, NIC cards and industrial computers, we can provide a full vision solution!