adamancer / stitch2d

A Python script used to stitch a two-dimensional grid of tiles into a mosaic
MIT License
26 stars 6 forks source link

Stitching Tree Cookie Samples #9

Closed chloecurry closed 1 month ago

chloecurry commented 1 month ago

Hi!

I am attempting to use this package to stitch together tree cookie image samples generated by a HQ raspberry pi camera. For each cookie, we have ~600 images.

On a "zoomed out" sample (15 images for the entire cookie), we are able to get pretty decent results using this package, but when we tried on our full dataset, it is unable to align our images. I have tried using a variety of values in the downsizing parameter, but am not sure if there is any other parameters to tune/ways to help improve performance.

Here is a zip of a few rows of our images (didn't include them all bc the file sizes are massive!)

Any help/guidance would be very appreciated!

from stitch2d import StructuredMosaic, create_mosaic
import os

mosaic = create_mosaic(
    tile_path,
    dim=16,                  # number of tiles in primary axis
    origin="upper left",     # position of first tile
    direction="horizontal",  # primary axis (i.e., the direction to traverse first)
    pattern="raster"          # snake or raster
  )

mosaic.downsample(0.9)
mosaic.align()
mosaic.reset_tiles()
mosaic.save_params()

mosaic.smooth_seams()
mosaic.save("mosaic.jpg")
chloecurry commented 1 month ago

Update: We found that the overlap between images was not sufficient. We have yet to try on a full cookie because it takes a while to get all the photos, but on a sample of 3 rows we have very promising results!