The Definition of Lens Chief Ray Angle and the dreaded CRA mismatch

Lens Chief Ray Angle Mismatch and Impact on Image Quality

by

The chief ray angle (CRA) of a lens and the chief ray of a sensor affect image quality in modern digital imaging. Incorrect match between a lens CRA and the image sensor’s pixel acceptance angle can result in suboptimal image quality, manifesting as radial color shading which is very difficult to 

The magnitude of CRA mismatch can be approximated using a Difference of Squares. Shading is dependent on the sensor's pixel architecture, but this is a good first order rule of thumb.

Below is an example of problematic CRA mismatch compared to proper mismatch with our CIL340 M12 Lens.

cra-mismatch-for-image-sensors-and-lenses-1674246644814.webp__PID:213bf91f-e830-492b-a364-517fdd9d51df

What is the Chief Ray Angle of an Image Sensor?

Let's first start with the architecture of a modern Complementary-Metal-Oxide-Semiconductor (CMOS) pixel.

Here is a simplified pixel architecture from Sony's website that I've marked up.In this simplified marketing drawing, you can see the different components of a pixel.

An introductory textbook for diodes that we went through back in the day at UofR is Sze and Lee "Semiconductor Devices, 3rd ed."

CMOS_image_Sensor_CRA_Starvis2_664e8532-8315-48d0-bd1c-cd31a3ef72fb.webp__PID:81196bac-96fb-4149-8742-d9e9c9012d30

What is the Chief Ray Angle of a Lens?

The chief ray of a lens is the ray that goes through the center of the aperture stop in an optical system.

If you look into a lens from object space, the chief ray is the ray that crosses the optical axis at the entrance pupil.

If you look from image space, this is the ray at the center of the exit pupil.

Hecht's Optics Fifth Edition has a great first-order optics diagram and description on page 185 for a general three element optical imaging system:

explanation-of-chief-ray-angle-and-marginal-rays-1671046746150.webp__PID:d046663a-1698-48c1-b962-d54e5cc31f8d

Chief rays exist for every illuminated point in object space. Let's see how this looks for a "Real World" lens.

When people discuss the Chief ray angle, they typically refer to the "Maximum CRA" which corresponds to the widest field of view of a lens combination.

To accurately compare the chief ray of a lens and the chief ray of a sensor, you must consider the CRA across the usable area of the image.

explanation-of-chief-ray-angle-and-marginal-rays-1671050825526.webp__PID:e3505b7f-f92d-4f21-afb6-b26f399be6aa
lens-cra-plot-1671051454530.webp__PID:62a99fe7-fc55-4b3d-a645-469c7d30db8c

What does CRA mismatch look like Physically and why CRA Mismatch more important at high CRA Angles?

Low profile lenses (short TTL) typically have very high CRA, as optical design performance does not converge if a low CRA requirement is forced on the design.

To aide cell phone manufacturers with system-level image quality, sensor manufacturers adjust the spatial design of microlenses on the sensor to compensate for lens CRA. This microlens adjustment is generally only available to high volume (>10Mpcs/yr) companies, so the rest of us must just do our best to select the right sensor variant and matching lens.

Oblique Dependence of Microlenses at 25° CRA (CIL023 2.2mm F/2.2)

chief-ray-angle-commonlands-1677721323000.webp__PID:d81a8ed3-4354-4c24-8334-905b9e460239

Oblique Dependence of Microlenses at 15° CRA (CIL039 3.9mm F/2.8)

chief-ray-angle-commonlands-1677721323000.webp__PID:d81a8ed3-4354-4c24-8334-905b9e460239

Correcting for color shading due to CRA mismatch.

CRA mismatch CAN be corrected for in post process, but ONLY in applications with well controlled static illumination such as industrial machine vision for inspection.

When the light sources change, it becomes challenging to compensate. This is due the friendly topic of metamerism. We've seen a major CRA mismatch (20° non-linear mismatch) overcome before in a regular indoor environment, so it is doable to a "good enough" extent. This requires advanced ISP tuning with a calculated pixel-level spectral energy distribution 3DMLUT approach.This in turn will slow down other performance metrics in your camera and/or require more compute, so generally not the best practice to get into this situation.

Additionally, there are only a handful of leading image quality experts with the requisite knowhow and experience to get to a "good enough" quality with a >15° nonlinear mismatch with a sensor at 33°. I estimate <50 people in the world and it is near impossible to hire them as they are in high demand at big tech companies.

So unless you are fortunate enough to be on a team with one of these experts, we highly advise against venturing down the rabbit hole of thinking you can solve >15° nonlinear CRA mismatch in software: your project will likely have a 6-12 month delay and budget overrun.

Regardless of the approach and expertise there will be more color tuning corner cases that occur with huge CRA mismatch, than when you have a well-matched lens to sensor CRA.

Importance of CRA in Optical Design

The CRA is a critical parameter in optical design and digital imaging, as it significantly impacts the quality of captured images.

Accurate CRA is required to achieve high-quality images and mitigating artifacts such as vignetting and color shading.

The CRA is related to the angular relationship between the optical axis and the chief ray of the lens, making it a key factor in determining image quality. In optical design, ensuring that the CRA is properly aligned with the image sensor’s pixel architecture is crucial. This alignment helps in capturing images with precise color reproduction and sharpness, which is especially important in applications requiring high fidelity, such as medical imaging and high-resolution photography.

The Take-Away: Match the Lens Chief Ray Angle As Closely to the sensor as possible, but don't overindex on CRA mismatch.

We generally recommend matching CRA within +/-10° if the sensor's CRA is <10°, +/-7° if the sensor's CRA is >10° and <20°, and within +/-4° if the sensor's CRA is >20°.

However, it really depends on the pixel architecture and your application.

Jon Stern from GoPro's optics team provided his opinion publicly during a talk at the Embedded Vision Summit in 2020: View Slide 22 Here.

This mismatch tolerance must hold across the entire field of view, so make sure to compare a full plot if the sensor's specification sheet says "non-linear" on it.

Incorrect CRA matching can result in radial red to green color shading from the center of an image to the corner.

This shading is dependent upon illumination conditions, so it makes Image Quality Tuning extremely difficult.

This is a common issue when trying to build a camera using a "Mobile" Sensor with an "Industrial" Lens or vis-versa. We've seen multiple startup projects run into this issue, resulting in extensive cost (>$100k) and schedule (>1yr) overruns.

Find M12 lenses by browsing below our using our M12 Lens Calculator with FoV Calculations.

No Distortion 3.2mm Lens
No Distortion 3.2mm Lens

CIL034-F2.3-M12A660

$39.00
$0.00
View Details
Low Distortion 6mm M12 Lens
Low Distortion 6mm M12 Lens

CIL059-F1.7-M12B650

$49.00
$0.00
View Details
Automotive 6mm M12 Lens
Automotive 6mm M12 Lens

CIL359-F1.6-M12A650

$39.00
$0.00
View Details
IR Corrected 12mm M12 Lens
IR Corrected 12mm M12 Lens

CIL122-F2.0-M12A650

$59.00
$0.00
View Details
Telephoto 35mm M12 Lens
Telephoto 35mm M12 Lens

CIL350-F2.4-M12A650

$59.00
$0.00
View Details
Telephoto 50mm M12 Lens
Telephoto 50mm M12 Lens

CIL051-F2.8-M12C650

$79.00
$0.00
View Details
185°@7.8mm Fisheye M12 Lens
185°@7.8mm Fisheye M12 Lens

CIL227-F2.5-M12B660

$39.00
$0.00
View Details
190°@6.4mm Fisheye Lens
190°@6.4mm Fisheye Lens

CIL281-F1.8-M12A650

$70.00
$0.00
View Details

Frequently Asked Questions

How do I properly focus my M12 lens?

Blurry images are typically caused by incorrect focus distance or improper installation. First, thread your M12 lens into the holder until you go past focus. Then, while viewing a live image, slowly rotate the lens counterclockwise (loosening) in small increments (1/8 turns) until your subject comes into sharp focus. The 0.5mm thread pitch means each full rotation moves the lens 0.5mm, so small adjustments make a big difference.

Quick troubleshooting: If you can't achieve focus, check that: (1) your subject is beyond the minimum object distance (typically 20cm for wide angle lenses) and (2) the lens holder height matches your sensor's requirements. Once focused, apply thread locker or use a lock nut to prevent the lens from rotating during use.

For a complete focusing procedure with test patterns and tips, see our step-by-step camera focusing guide.

Can I use M12 lenses on my C-mount camera with an adapter?

While M12-to-C-mount adapters exist, there is a possibility these won't work due to mechanical back focal length (MBFL) incompatibilities. The critical issue: C-mount cameras have filters built in with holder mechanics that prevent the lens from moving close enough to the sensor: the M12 lens usually can only get as close as 4-5mm away from the sensor. If your M12 lens has an MBFL less than ~4mm (common for wide-angle lenses), it physically cannot get close enough to the sensor to achieve focus - the image will be permanently blurry regardless of lens adjustment.

How to check compatibility: Look up your M12 lens's MBFL in its datasheet - this is the distance from the lens mounting surface to the sensor when focused at infinity. If the MBFL is less than 4mm, the lens won't work with most C-mount cameras, even with adapters. Additionally, many C-mount cameras have protruding IR cut filter holders or protective windows that increase the minimum distance to 6-8mm, making even more M12 lenses incompatible.

Working alternatives: (1) Choose M12 lenses specifically designed with long MBFL (>8mm) for C-mount adaptation - usually telephoto focal lengths. (2) Use a C-mount camera with a recessed sensor design or removable filter holder. (3) Machine a custom adapter that allows the M12 holder to sit inside the C-mount thread. (4) Select proper C-mount lenses instead - they're designed for this mount and will perform better. Remember that even if you achieve focus, the C-mount camera's larger sensor may exceed the M12 lens's image circle, causing severe vignetting.

How do I calculate what field of view my lens will give me?

Your actual field of view depends on both your lens focal length and sensor size. As a quick reference: with a 1/2.8" sensor (6.2mm diagonal), a 2.8mm lens gives ~90° horizontal FoV, a 3.6mm gives ~70°, a 6mm gives ~45°, and a 12mm gives ~23°. Larger sensors capture more of the image circle, resulting in wider fields of view with the same lens.

Important for wide angle lenses: Be aware that lens distortion affects your usable field of view. Standard wide angle lenses often have 5-15% barrel distortion, which curves straight lines but fits more content in the frame. Our low-distortion lenses (<1% distortion) maintain geometric accuracy but may have a slightly narrower field of view. Choose low-distortion for measurement/inspection applications, and standard distortion for general surveillance where maximum coverage matters more than geometric precision.

Use our Field of View Calculator to get exact angles for your specific lens/sensor combination - just input your focal length and sensor dimensions.

Why can't I focus on objects close to my camera?

Every lens has a Minimum Object Distance (MOD) - the closest distance at which it can focus. Standard M12 lenses can focus at any object distance if the correct height lens holder is used, however, at less than 250mm the corners may be blurry if you use an infinite conjugate M12 lens. Additionally, remember that the MOD is measured from the front of the lens, not the sensor, so account for your lens holder height.

Solutions for close-up work: If you need to focus closer, you have three options: (1) use a taller lens mount to move the lens further away from the sensor, (2) add spacer rings between the lens and holder to increase the back focal distance, or (3) select a shorter focal length lens which generally allows closer focusing. Note that at very close distances, field curvature becomes more pronounced if using an infinite conjugate optimized M12 lens - the corners may be slightly out of focus when the center is sharp. Using a smaller aperture (higher f-number) helps maintain edge-to-edge sharpness.

Contact us for lens recommendations based on your working distance requirements. Our CIL945, CIL142 and CIL121 are finite conjugate optimized.

I'm seeing color shading or dark corners - is my lens compatible with my sensor?

Dark corners (vignetting) typically mean your lens image circle is too small for your sensor. Check that your lens format (e.g., 1/2.8", 1/1.8") matches or exceeds your sensor size. Color shading toward the edges often indicates a Chief Ray Angle (CRA) mismatch between your lens and sensor. Modern CMOS sensors have microlenses that expect light to arrive at specific angles - when the lens CRA doesn't match the sensor CRA, you'll see color shifts or brightness fall-off at the image edges.

How to verify compatibility: Compare your sensor's CRA specification with the lens CRA shown in its mechanical drawing. A mismatch over 5° for linear CRA sensors typically can cause color shading issues.

Learn more about avoiding these issues in our article on lens chief ray angle and sensor matching.

Will everything in my scene be in focus, or do I need to worry about depth of field?

Whether your entire scene stays in focus depends on your depth of field (DoF), which is controlled by three factors: aperture, focal length, and distance to subject. Wide angle M12 lenses (>80°) typically keep everything from 50cm to infinity in acceptable focus. Telephoto lenses (12mm+) or larger apertures (F1.4-F2.0) create much shallower depth of field, requiring more careful consideration.

Practical guidelines: For machine vision, barcode reading, or inspection applications where everything must be sharp, choose a smaller aperture (F2.8 or higher) and ensure your working distance range falls within the calculated DoF. For surveillance or general imaging where some background blur is acceptable, you can use faster lenses. Remember that smaller apertures reduce light transmission, so you'll need better lighting or higher sensor gain.

Calculate your exact depth of field range using our Depth of Field Calculator - input your lens specs and focus distance to see the near and far limits of sharp focus.

Should I use a C-mount or M12 lens for my application?

M12 lenses (S-mount) are ideal for compact applications, board-level cameras, and sensors up to 1/1.8". They're cost-effective, lightweight (typically 2-10g), and perfect for drones, embedded vision, and high-volume products. The 12mm diameter limits optical complexity, so they work best with sensors under 12MP and in good lighting conditions.

C-mount lenses are the professional choice for machine vision and industrial applications. With a 25.4mm threaded diameter mount and 17.526mm flange distance, they accommodate larger, more optics. Choose C-mount when you need: optimized across a large working distance range, sensors larger than 1", resolution above 12MP, motorized iris/focus/zoom, or specialized optics like telecentric designs. The trade-off is size (10-50x heavier) and cost (5-20x more expensive). C-Mount lenses do not necessarily have better performance than M12 lenses due to the mechanical back focal length constraint that requires more / larger glass elements to correct for.

Quick decision guide: Use M12 for embedded/OEM applications where size and cost matter. Use C-mount for industrial/scientific applications where optical performance is critical. Note that C-mount requires a camera with C-mount threading - you cannot adapt M12 to C-mount due to the different flange focal distances.

Do I need an IR cut filter, and should it be in the lens or on the sensor?

CMOS sensors are sensitive to infrared light (700-1100nm) which humans can't see. Without an IR cut filter, daylight images appear washed out with incorrect colors - vegetation looks white/pink and black fabrics appear purple. You need an IR cut filter for accurate color reproduction in any application with visible light imaging.

Lens-integrated filters: Lens-integrated IR filters (like our M12A650 series) are convenient and protect the lens rear element, but these are glued and cannot be removed so be sure to purchase the correct variant. For outdoor/dual-use cameras, consider motorized IR cut filter switchers that automatically switch based on lighting conditions or using a Dual bandpass filter.

When to skip the IR filter: Use lenses without IR filtration (our M12ANIR series) for: night vision with IR illumination, multispectral imaging, or applications specifically detecting IR radiation. Remember that without IR filtering, you cannot achieve accurate visible color imaging even with proper ISP tuning.

How do I stop my lens from rotating and losing focus during operation?

Best M12 lens solution: Vibration, thermal cycling, and handling can cause M12 lenses to rotate and lose focus. The most reliable solution is using a UV+heat dual cure adhesive or standard UV cure adhesive. Apply a small drop to the lens threads then complete final focusing - it remains adjustable during setup. Then, cure with UV light source before moving the camera, and finally cure using heat to ensure adhesive within the shadow zones is fully cured.

Alternate M12 lens solutions: You can also use a M12 S-Mount lock nut that tightens against the lens once focused. Or, use standard plumbers tape / teflon tape wrapped around the lens threads.

For C-mount lenses: These typically use a set screw in the lens barrel. Industrial C-mount lenses often include locking mechanisms built into the focus ring. Always verify the lock is engaged before deploying the camera. However, C-Mount lenses are generally more prone to failure over vibration as a result of these internal moving parts.

How do I choose the right lens focal length for my application?

Select your focal length based on: (1) what you need to see (field of view), (2) how far away it is (working distance), and (3) your sensor size. The basic formula: Focal Length = (Working Distance × Sensor Size) / Field of View Width. For example, to image a 2-meter wide area from 3 meters away with a 1/2.8" sensor (4.8mm width): 3000mm × 4.8mm / 2000mm = 7.2mm focal length needed.

Remember that shorter focal lengths (wide angle) show more area but with less detail, while longer focal lengths (telephoto) show less area but with greater detail. If unsure, choose a varifocal C-mount lens (2.8-12mm range) to experiment before committing to a fixed focal length.

Can Commonlands help me design and assemble a complete camera module?

Yes! Commonlands offers complete camera modules and camera module focus+glue assembly services for OEM customers. We handle everything from optical design and sensor selection to final assembly and quality testing. Our services include: lens optimized for your sensor and application, sensor integration with leading image sensors from Sony, OmniVision, and OnSemi, selection of lens holders and mounting solutions, and complete module assembly including lens focusing and thread locking.

Typical project scope: We work with customers from prototype through production volumes (100 to 100,000+ units annually). Our team can optimize existing designs for cost reduction, improve optical performance, or develop entirely new camera modules to your specifications. We maintain inventory of common lenses for rapid prototypes, with production lead times of 6-12 weeks depending on customization level.

Getting started: Contact our engineering team with your target specifications: resolution, field of view, working distance, environmental requirements (IP67, operating temperature), interface type (MIPI, USB, LVDS), and target price point. We'll provide a detailed proposal including optical simulation results, mechanical drawings, and sample availability. Most customers start with our standard lens + sensor combinations for proof of concept before moving to custom designs.

Q: What is an M12 lens (S-mount lens)?

Answer: An M12 lens is a compact lens with a 12mm thread diameter, often called an S-mount lens. These lenses screws into a camera M12 lens mount and are easy to use. These lenses are used in board-level cameras for embedded vision systems. M12 lenses are smaller than C/CS-mount lenses, making them ideal for space-constrained applications like robotics​.

Q: What cameras can I use M12 lenses with?

A: There are many embedded vision cameras, image sensors, and AI cameras that are compatible with M12 lenses. As long as camera's lens holder is compatible with the mechanical dimensions of the lens, the lens should focus! Please make sure to match the image circle, FoV, and resolution.

Q: How do you focus an M12 lens?

Answer: Use focus targets, then slowly thread the lens while displaying a video. Go past focus, then come back to focus. You can read our full article on how to focus camera lenses.

Looking for recommendations, trying to figure out where to start, or want to discuss customizations? Contact our US-based Optical Engineers.