16MP Arducam: Pattern NOT Found

Replaced LB 8MP 85W camera with Arducam 16MP 1/2.8" IMX298 mini UVC, lens calibration will not capture the pattern no matter what I do: honeycomb covered/uncovered, more/less lighting, pattern scaled up, fisheye/normal, etc. Tried everything suggested in other threads, no joy.

Maybe coincidental, what’s different in my setup from other posts is camera preview shows entire bed, lens calibration view shows entire bed, Update Overlay only show very small portion of bed. Could this be related to why pattern not found? If so, how/what do I change?

A few things to try:

  1. Take the camera off the laser and run the calibration with a completely neutral background.
  2. The patterns looks a little small. It should fill one rectangle in tic-tac-toe grid. You can just get a little closer to the pattern to account for this.
  3. Try pasting the pattern to a stiff board so that there are no wrinkles at all along the entire plane of the pattern.
  4. It’s hard to tell from the screenshot but the image looks like it might be slightly out of focus. Try to improve focus.

Your honeycomb is visible - that’s typically the biggest issue with camera lens calibration. I’ve made a new video showing the “ideal” calibration process here:

Thank you for the video, short of taking camera off the lid I’m doing exactly same thing as video: neutral background (tried with both honeycomb covered and not covered), closer to lens to fill more of frame, normal to focal axis, 6mm backer board, no air bubbles, it just will not capture anything, not even poor quality. Autofocus camera

Is Lightburn only looking for the pattern in the same area as Update Overlay? Because overlay does not have a very large view, just catching corner of pattern; if overlay view is where pattern should be found, I have what I believe a larger issue…

The overlay will only be present because you’ve previously done a camera calibration, and it’s using the data from the older camera until a new calibration is done, so that’s not going to be it.

Is this the camera? https://www.amazon.com/Arducam-Camera-Laptop-Without-Microphone/dp/B08LGQFVG7

Hello @SBrown check out my detailed exploration of the 16MP Arducam:

Oddly, I was seeing we could NOT get a score with the honeycomb covered. It had to be UNCOVERED.

With a standard 8.5"x11" printer sized card, I got good scores (<0.3), but the lens cal is only accurate at the 4 alignment points. It is notably off across much of the bed, indicating the lens calibration was not so good.

If you want a larger card, use the laser to cut the circle pattern out of white posterboard and glue on top of black foamboard. The foamboard may not be all that flat though, maybe you want to glue onto black posterboard glued onto like masonite or MDF. I did not do this in the end, I used the printer paper sized one. Like I say, good scores, but poor lens cal.

In my case running it off-machine did NOT improve the lens cal, in fact I got very poor scores. I do not know why. It should have worked.

Also note the 16MP was sold with a WAY too wide lens for this, and a lot of the resolution is wasted off-bed, AND it’s creating a ton of fisheye distortion to try to correct. However, getting an M12 lens that fits the field of view, AND fits the unusual 1/2.8" imager, AND physically fits in the mount, AND has an IR filter is still ongoing. I ordered many parts to try and will let you know. Notably, Amazon’s “Arducam” M12 lens set does NOT fit, as it was actually for an Arducam with a much smaller imager.

The most promising lens I think is going to work is this varifocal in the 2.8mm-12mm version (this “mm” measure actually sets field of view)
https://es.aliexpress.com/item/1005001349942062.html?gatewayAdapt=glo2esp&spm=a2g0o.9042311.0.0.45d463c0NFUByL
Why? Well, an M12 mount, it’s for a 1/3" imager, so 1/2.8" will fit just unused margins, and since we’re using the center of the lens this might mean less fisheye. It has an IR filter (16MP Arducam doesn’t seem to have a filter with the lens removed but not certain). The 2.8-12mm zoom encompasses my target FOV estimate. The adjustable zoom is going to drastically increase the effective resolution because we can adjust it to perfectly encompass the bed and no extra. Even a small amount of extra FOV consumes quite a lot of the pixels! I mean, if your bed occupies 2/3 of the FOV, with only 1/6th the width on either side unused, that’s STILL only able to use roughly 45% of the pixels. It could be nearly 2x the total resolution!

If you need a larger card, move it closer to the camera. :slight_smile: The card does not need to be placed on the bed of the laser (and the camera does not need to be mounted in the laser) for lens calibration.

@LightBurn Right, but in practice I couldn’t see a practical way to do this without at least two people. Even then, it seems like the capture is taken really slowly and would likely blur if the card is held in the hand. Plus the camera is fixed focus and is going to be blurry anyways if lifted to like half the bed distance.

The cost of black and white posterboard and some mason board to make a larger card is so minimal, reusable, and repeatable

BTW the other big problem I have with the camera is that the “custom” option won’t detect 16MP Arducam, while the “default” works it has no sliders for brightness/contrast etc. Prob here is when I’m using the camera, it often adjusts brightness primarily for the honeycomb, which, being well-used, is now pretty black. The targets I’m trying to see are much lighter and consequently the image is washed out.

Adjusting the light was not very effective because the camera just auto-compensates. Turn the lights down low, it turns up the brightness to get the major portion of the image- the honeycomb- in the right range, again washing out what I’m trying to use as targets.

And also the light is apparently significantly higher in front of the machine than the rear. Under some lighting conditions I could get the card to show up clearly in front by no the the rear.

I’m using white posterboard for alignment targets, now I see that colored ones will do better as they won’t wash out on the camera. But even lighter plywood like birch is just confusing the camera after it adjusts brightness for the honeycomb and making it hard to see features on the wood.

I’ll try to remember to take a screenshot of the situation

Put a few pieces of paper or cardboard on the honeycomb and that will help even out the lighting. The ‘Custom’ capture library is one I wrote, and it uses newer Windows libraries for camera access. It’s more sensitive to system updates / compatibility, and I haven’t been able to figure out why that is yet - It was based on a Microsoft example with very little code changed.

The ‘Default’ one is what’s built in to the framework we use (Qt) and unfortunately is incomplete - it doesn’t let me choose the camera resolution, so you’ll get whatever the default res of the camera is, and as you’ve noticed, it doesn’t let me access camera controls either, which is why the Custom option was written in the first place.

Yeah I may do that. BTW, you may have noticed but I found the OpenCV algorithm only worked with the honeycomb uncovered, opposite of recommendations. Strange but that’s what I got. Good scores <0.3, although the lens calibration was not that great by the end of it.

I’m going to retry this with a larger circles card soon.

BTW, I found it frustrating to try to get this focus right. The Windows “Camera” app is live video, but doesn’t allow me to zoom in on the image so I couldn’t get the focus good enough.
LB was MUCH better in that I threw a printed sheet on the honeycomb and zoomed in on the workspace and could clearly see the effects of small twists of the lens to adjust focus. There’s a big difference when you get the focus right.

Only prob is, not only does LB take more than a second to take a shot and update the background, but there’s no “live” option. I brought in a buddy to do nothing by keep clicking the mouse while I fiddled with the lens until the focus popped and I had the lens locking ring tensioned. It was the only way to make this work- so, a “live update” option would be great, and simple…

I’m not sure if LB is even using the 16MP mode though. I can see the cuts, though, when the lighting isn’t all washed out. Can send a screenshot.

There are a couple things that were odd with this camera, and highlighted some issues in my capture lib:

  • It doesn’t give a live stream when the image resolution is set too high
  • The default streaming resolution is 16:9 aspect, but the camera sensor is 4:3

I’ve made some changes to LB’s capture code so it will choose the highest streamable resolution it can (basically anything up to about 2mp) and it will figure out what the camera sensor aspect ratio is, and choose both a stream and photo resolution that matches that aspect ratio.

The photo res will be the highest available that matches (or is close to) the sensor aspect ratio, and the stream res will be the closest to that aspect ratio that’s less than my cutoff rate threshold.

With those changes, I’m getting this pretty easily:

1 Like

Interesting details behind the scenes, thanks for sharing; I enjoy the technical details.

What are the implications to users, will these changes come to near future release? Is there a way to try beta version? Anything we can do currently to work around the quirks you’ve discovered?

I’ve tried everything suggested in this thread, your included video, and other threads I’ve found yet cannot get camera lens calibration to capture the dot pattern.

AWESOME. What’s the “Honeycomb Check” button do?

The 16:9 aspect ratio agrees more with our 1600x1000mm bed, or a 32inx18in. 1.7777x

With the right lens this means much better resolution as we get to use all the pixels available

Close, likely functionally the same
https://www.amazon.com/dp/B09CGBDQNW

That’s the autofocus version. Autofocus seems unnecessary and a likely source for inaccuracy, the distance should always be the same so no need for autofocus. Just get the fixed-focus version.

I’ve added a relatively simple “are there lots of sharp edges?” check as a pre-filter for the capture, since damn near everyone mounts the camera in their machine before doing the lens calibration, and the honeycomb being visible confuses the shape finder code - it has too many edges to sort through, and most people assume it has crashed.

If the sharp edge pixel count is too large a percentage of the image, it’ll kick back a “Honeycomb visible?” message and not try to find the circles. Turning off that switch is an “I know what I’m doing” button. :slight_smile:

Got in the above dirt cheap 1/2.7 varifocal zoom lens with IR cut filter. You MUST have a locking ring, which was NOT included with this one. Otherwise, on my 1610 machine, I can’t get it into focus at all zoom levels. The lens has a long thread and should not be screwed all the way down so you need a lock ring. With it locked a little bit further out, I can zoom and focus the 16MP Arducam great!

This does 2 things:

  1. The OpenCV algorithm does not like the Arducam’s stock wide-angle lens. It did not flatten all that well. In the end, the 4 alignment points were accurate, but everywhere else was varying up to several mm. Which is odd because it’s promoted as a “flat no-distortion lens”, but I think that one tried to flatten it with an unusual lens that OpenCV does not understand. With this varifocal, I got it MUCH more accurate.
  2. The zoom allows you to adjust so you USE all that resolution. Before, like 1/3rd horizontal FOV was off the bed. So the resulting bed resolution is not what it could be.
    With this, I adjusted FOV to include the limits of the bed and little else. The resolution is now outstanding- almost enough to read text. You can definitely see the burn lines!

It is difficult to adjust the focus accurately. Both because the varifocal’s focal ring adjustment, though silky smooth, is a LOT of change in focus for a small degree of rotation, and I need a live AND zoomed in version of the camera feed to do a live adjustment. Currently all I can do is get a friend to keep clicking “Set image as background” over and over and get an update which is not only limited to about 1 frame every 2-3 sec, but lagging by close to 5 sec from the live feed. It takes some work.

Place a printed sheet of text or something with high contrast detail on the bed, zoom in on that in LB’s workspace, and go back and forth until you find the sweet spot. Do NOT put this target in the center of the bed, but about 1/3rd to the side. The ideal focal “plane” is actually a sphere with the lens in the center, and the margins of the flat bed will be a longer distance to the lens than the bed’s center and go progressively excessively out of focus (a little bit). So focus cannot be ideal for the entire bed and that becomes apparent with the higher resolution camera technically capable of imaging tiny features. By placing the focal target off center, you can get a “happy median”. The center is a little too close and the extremes a little too far, but it’s the best solution overall compared to letting the extremes get significantly out of focus.

The “custom camera system” with its custom brightness/contrast sliders doesn’t work yet (note LB has a fix coming imminently), and that’ll improve things- biggest prob I noted is that honeycomb appears black, and the default camera auto-adjusts the exposure for the MAJORITY of the FOV. A single piece of paper, being the MINORITY of the FOV, will often be overexposed and washed out. Your first instinct might be to dim the lights, but then the camera does try to increase the gain to try to image the majority dark again, and may still wash out.

At some point it may be awesome to add some code to take multiple shots at different brightness levels and fuse into an HDR image where bright stuff will be clear beside darker stuff (honeycomb).

I know that may not be the highest priority upgrade, but there’s plenty of open source software to do that and it may be pretty easy.

BTW, I disagree with the recommendation to lift the polka dot card to bring it closer to the camera. Because with the camera set to focus on the bed, that’s on the order of 1M or less. That is fine but the depth of focus is limited. Lifting the card by any amount significant enough to make it appear larger will be significant enough to affect the focus. Adjusting the lens for a card brought closer would seem to defeat the point, as it is no longer the ultimate configuration that will actually be used.

Although, polka dots do not have a sharp edge and perhaps less affected.

In the end I could see that angling the card so its normal vector (perpendicular vector off the face) points towards the camera was ESSENTIAL to getting a high score, or indeed any score at all.

Covering the honeycomb with WHITE posterboard (like $0.50 at Walmart) is essential to avoid having the camera self-adjust its overall brightness for the card. Covering with darker materials to avoid seeing the honeycomb edges is not enough, the card can appear washed out on the screen capture and get a poor score or no recognition at all. This is especially true for larger beds where an 8.5"x11" print glued to plywood is a small % of the total FOV.

If you DO want a larger card, you can laser white posterboard and glue to black foam-core board with spray adhesive. However, black foam-core is not all that flat. For that matter, neither is most plywood. I think the best option would be to use MDF or masonite as the base, or any engineered material that is going to be very flat… You can either spray adhesive the 8.5"x11" printout on it, or, spray adhesive on a sheet of BLACK posterboard, then laser the polka dot pattern out of WHITE posterboard and spray adhesive that on.

On my 1610 bed, I found that with the bed covered with 4 sheets of white posterboard, the camera biased its brightness correctly, and angling the card is essential. With those conditions met, it is not necessary to lift the card (which puts it out of focus) OR build a larger card. It will recognize and get ~0.3 scores and image flatten nicely.

Elmer’s glue or wood glue will cause printer paper to wrinkle and can degrade the recognition. Use spray adhesive, this will not wrinkle it.

The 1.0.0.10 update “Custom Camera” didn’t work for me. Well it starts, but after about 30 sec the live camera feed crashes and displays a fixed junk noise pattern until LB is rebooted. Default Camera system still works.

I realized the problem when looking for test burn lines on wood right next to the white posterboard- the burn lines on darker plywood weren’t any blacker, but far, far more visible. Just don’t use white posterboard, use any color but white or black. It is extremely hard to see burn lines on the white color specifically with the camera, while this sounds like higher contrast in theory, in practice the adjacent bright white pixels bleed over and washes out the camera making the burn line very hard to see.

With white, I couldn’t see anything at all of the test burns until we killed the room lights and got the camera in a case where it was gain-limited and dark overall, then they were visible but poor contrast.

I had high hopes for 1.1.0 (and 1.1.01) but alas don’t appear to resolve my issue… got a couple of mediocre captures (0.71 on bed center) but then no more. Autofocus is likely part of the issue, for some reason it does not focus in preview, focuses fine using Camera app in Windows. So I’ll write this camera off as a loss :frowning:

What higher resolution cameras (=>16MP preferably) have others had success with?? Specific models, and where you got it, would be helpful.

Off to print the replacement base for the prior 8MP camera… that 3M tape is strong.