NHMDenmark / Pinned-Insects-workstation

Work on the Pinned Insects workstation and workflow for mass digitisation in Denmark (DaSSCo)
0 stars 0 forks source link

Take images for assessing evenness of illumination and lens distortion on NHMD simplified pinned insect workstations #61

Closed chelseagraham closed 10 months ago

chelseagraham commented 10 months ago

Take image of a white piece of paper for assessing evenness of illumination and of a checkerboard pattern for assessing lens distortion on NHMD simplified pinned insect workstations - set up for Pyralidae (7.5 cm x 10.6 cm) and Dung Beetle (5.6 cm x 7.4 cm) FOVs

chelseagraham commented 10 months ago

On 10 January, Chelsea generated targets @ 1 mm and 1 cm, measured prints to confirm fidelity, took images to allow for assessment of evenness of illumination and distortion (flat fields and checkerboard pattern) for Pyralidae FOV on simplified workstation 1.

Saved images and targets to N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0001_PyralidFOV

Screenshot of RGB of flat field target:

Image

On 11 January, Chelsea generated targets @ 1 mm and 1 cm, measured prints to confirm fidelity of scale, took images to check for evenness of illumination and distortion (flat fields and checkerboard pattern) for Dung Beetle FOV on simplified workstation 2.

Save images and targets to N:/Groupdir/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0002_DungBeetleFOV

Screenshot of RGB of flat field target:

Image

chelseagraham commented 7 months ago

Given the samples taken across the flat fields target, both workstations satisfy the requirements for being evenly illuminated. The first workstation, WORKPIOF0001, has a greatest variation of average of RGB values as 5,34 units. The second workstation, WORKPIOF0002, has a greatest variation of the average of RGB values as 8,66 units. These are both within 13 units and therefore qualify as evenly illuminated.

chelseagraham commented 6 months ago

Conversation with Kim about yellow dots in some of the images:

From: Kim Steenstrup Pedersen [kimstp@di.ku.dk](mailto:kimstp@di.ku.dk) Date: Tuesday, 7 May 2024 at 09.51 To: Chelsea Alene Graham [chelsea.graham@snm.ku.dk](mailto:chelsea.graham@snm.ku.dk) Subject: Re: Target for checking the lens distortion - pinned insects

Hi Chelsea

If you followed the same procedure with measuring the evenness of the illumination as with the herbarium setup, then this should good enough. At a glance is also looks even.

Is it correctly understood that the white paper and checker targets fill up the complete field of view, i.e. you removed the angle? I will run the checkers through a camera calibration program and see which checker size works best.

On the Pyralid images there are some weird yellow dots when zooming in. Check for instance Pyralidae_24_6116.CR3 and zoom in. It is also visible in the white checkers in Pyralidae_24_6115.CR3. The pattern looks very systematic and it is not there in the other setup, so is it a failure in the Pyralid camera?

Mvh,

Kim <<

On 7 May 2024, at 12.03, Chelsea Alene Graham [chelsea.graham@snm.ku.dk](mailto:chelsea.graham@snm.ku.dk) wrote:

Hi Kim,

I believe that the paper and the checkerboard targets were taken filling the field of view at the focal plane (on foam at the height of the angle).

I see what you mean about the yellow dots. My best guess is that it is related to the printer, either ink on the mechanism that moves the paper through the printer or a print head error. I’ve overlapped the images for each workstation and saved them as the following .psd files.

1/ Pyralidae_overlay.psd (WORKPIOF0001) containing files Pyralidae_24_6118.CR3 (angle) Pyralidae_24_6116.CR3 (white sheet) Pyralidae_24_6115.CR3 (large checkerboard) Pyralidae_24_6114.CR3 (small checkerboard) Saved at N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0001_PyralidFOV/Pyralidae_overlay.psd Here I can see the yellow dots in the following images Pyralidae_24_6118.CR3 (angle) – in the free space of the SNM and DaSSCo logos (printed in-house via KU_Mobility Print). I do not see it in the color checker or scale bar (from external sources). It is hard to tell if some small dots on the background are related or due to the nature of the gray card. Pyralidae_24_6116.CR3 (white sheet) – across the white sheet Pyralidae_24_6115.CR3 (large checkerboard) – in the white squares

2/ Scarabaeidae_overlay.psd (WORKPIOF0002) containing files PI2_Scarabaeidae_3_0317.CR3 (angle) PI2_Scarabaeidae_3_0316.CR3 (white sheet) PI2_Scarabaeidae_3_0314.CR3 (large checkerboard) PI2_Scarabaeidae_3_0313.CR3 (small checkerboard) Saved at N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0002_DungBeetleFOV/Scarabaeidae_overlay.psd Here I can see the yellow dots in the following images PI2_Scarabaeidae_3_0314.CR3 (large checkerboard) – in the white squares PI2_Scarabaeidae_3_0313.CR3 (small checkerboard) – in the white squares

In the images where we find the yellow dots from the same workstation, the dots do not have the same placement, which makes me think it is not related to a consistent defect with the camera or lens. Is there some kind of software that could be run to easily find a correlation between the dots? The yellow dots do seem to correlate with the printer paper however. It is possible that the white sheet used in WORKPIOF0001 (imaged as Pyralidae_24_6116.CR3) was cut from the bottom of one of the checkerboard pattern sheets, which could explain the presence of dots on this sheet but not the white sheet used at WORKPIOF0002 (imaged as PI2_Scarabaeidae_3_0316.CR3). We can even often see yellow dots present in the black font of the SNM logo and around on the DaSSCo logo.

I examined some recent images to check for the dots from WORKPIOF0001 N:/SCI-SNM-DigitalCollections/DaSSCo/MASTER_IMAGE_STORE/Main_image_store/WORKPIOF0001/2024-4-11/7e8-4-08-0a-1f-27-0-002-02-000-0212fa-00000.tif and from WORKPIOF0002 N:/SCI-SNM-DigitalCollections/DaSSCo/MASTER_IMAGE_STORE/Main_image_store/WORKPIOF0002/2024-4-29/7e8-4-1d-0a-31-0b-0-002-03-000-013f2a-00000.tif I do not see any evidence of the yellow dots on these images.

What do you think? If you think this needs further investigation, what do you suggest?

Kind Regards, Chelsea <<

From: Kim Steenstrup Pedersen kimstp@di.ku.dk Date: Tuesday, 7 May 2024 at 13.08 To: Chelsea Alene Graham chelsea.graham@snm.ku.dk Subject: Re: Target for checking the lens distortion - pinned insects

Hi Chelsea

I think you are right that it has to do with the printer / paper. On the WORKPIOF0001 images of actual specimen, there is a bit of yellow dots in the SNM logo and it looks like at least one of them is cut at the edge of the logo paper. I do not see evidence of this in the white cells of the color target and elsewhere, e.g. on the labels).

Could we take a picture of a clean white piece of paper (that has not been through a printer) and take a photo in WORKPIOF0001 to verify that the yellow dots are gone?

What is your protocol for checking these setups in the future and when we have to change field of view?

In general the specimen images looks nice - so you and Matilde did a good job on design this setup.

Mvh,

Kim <<

From: Kim Steenstrup Pedersen kimstp@di.ku.dk Date: Tuesday, 7 May 2024 at 14.03 To: Chelsea Alene Graham chelsea.graham@snm.ku.dk Subject: Re: Target for checking the lens distortion - pinned insects

Hi Chelsea

I now also checked if we can use the checkerpatterns and I can make a calibration procedure work with the 10mm pattern. What it does is it first detects internal corner points and then it attempts to estimate the lens distortion from this. The distortion I get is very small as expected, so we probably do not want to correct for this. I am attaching a text file in YAML format that contains the estimated values for the WORKPIOF0001 setup; it is the distortion_coefficient part that is our concern. The details of what it means can be found here https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html and here https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html

So I would suggest in the future to use a 10mm checker pattern. I think it is a good idea to check for this when we change to field of view / lens. This should probably be done less frequently than checking for evenness of illumination - the lens should not change unless someone accidentally manipulate it.

We need to agree what is a small enough distortion that we can ignore. We also need a program that performs the estimation and check.

Mvh,

Kim <<

chelseagraham commented 6 months ago

@nms419
Would you please take a few pictures for calibration of the Macro Moth FOV on WORKPIOF0001 on Friday? You can look to N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0001_PyralidFOV and N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0002_DungBeetleFOV for reference of the content required.

Please • get a clean, blank sheet of paper (that has not been through the printer) • print the checkerboard calibration from N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0001_MacroMothFOV/110x160_10mm.pdf (The target should fit the FOV. It was made here https://markhedleyjones.com/projects/calibration-checkerboard-collection Please use this resource if you need any alteration to the size.) • take the following pictures at the focal plane (height of the angle, you might want to support the paper with foam to reach the correct height) o clean, blank sheet of paper o 10 mm checkerboard pattern • take a picture of the angle on the stage • save these three files to N:/SCI-SNM-DigitalCollections/DaSSCo/Pilot Data/Pinned Insects Working Data/20240110_FlatField&Checkerboard/WORKPIOF0001_MacroMothFOV (No specific naming conventions are necessary) • update this GitHub ticket when this is complete

nms419 commented 6 months ago

Pictures taken and placed at N:\SCI-SNM-DigitalCollections\DaSSCo\Pilot Data\Pinned Insects Working Data\20240110_FlatField&Checkerboard\WORKPIOF0001_MacroMothFOV

chelseagraham commented 6 months ago

Screenshot of RGB of flat field target for MacroMoth FOV on WORKPIOF0001: Screenshot 2024-05-13 at 12 30 22

Right hand corner pts 2,6,7 (RGB) and in one case, mid pt 9 (B) have values outside of the tolerance zone.

The yellow dots are not present in pictures of the geometric target, flat fields target, nor the stage (aside from the insitutional label).

chelseagraham commented 6 months ago

I have created a calibration protocol to be adopted at the simplified workstations at SNM https://github.com/NHMDenmark/Pinned-Insects-workstation/issues/83