Pyvips | Best way to create large histology image of size 5000000X5000000 pixels.
See original GitHub issueHello, @jcupitt!
I am new to pyvips, I want to create a large image. Following steps, I have to take:
- Finding coordinates as the stage is not precise. Using NCC based matching.
- Making a large background image to overlay each image using their global coordinate.
- Saving it in dzi format (is it possible to view real-time stitching). I have tried all the three steps. I am stuck in last two part.
Issues:
- When I am overlaying next image the previous image vanishes. I have tried all this method from this post . Can you also explain what is the various mode of an argument? Attached example code
import sys
import random
from PIL import Image
import numpy as np
import pyvips
output_size = 2000
bg = pyvips.Image.black(output_size, output_size, bands=3)
tile1 = pyvips.Image.new_from_file('1805_corrected.jpg', access="sequential")
tile2 = pyvips.Image.new_from_file('1806_corrected.jpg', access="sequential")
vips_image1 = tile1.embed(0, 0, output_size, output_size)
vips_image2 = tile2.embed(1000,1000, output_size, output_size)
vips_image=vips_image1.composite(vips_image2,["over"])
vips_image.write_to_file('vi_1.tiff')
- My data size would be very large, what would be the best way to mosaic this images?
- In the past, I have used Image.join function to create mosaic but the problem was when I exceed certain limit .dzsave takes lots of time and sometimes segmentation fault occurs.
- Is there any method in pyvips to match images two find coordinates for matching?
Issue Analytics
- State:
- Created 5 years ago
- Comments:41 (21 by maintainers)
Top Results From Across the Web
Image — pyvips 2.2.1 documentation - GitHub Pages
If the input object is an array-like object, a new image is created from the object's data ... Place an image within a...
Read more >Competition: TissueNet: Detect Lesions in Cervical Biopsies
We found that reading the pyramidal TIFs using PyVips was a reliable way to work with the images in our machine learning pipelines....
Read more >(Live) viewing of large images using pyvips - Stack Overflow
I first determine the total width and height of the full image and initialize a black image of the correct size and subsequently...
Read more >Data Science - Resources and Tools - IBM Developer
It can be used to make predictions and decisions using analytics and machine learning. Select. Trending ...
Read more >5 Ways to Make Histopathology Image Models More Robust to ...
When the domain shift is too large, a model trained on one type of data will fail on another, often in unpredictable ways....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello again, could you make a new issue? It’s best to have one question per issue or other people will have trouble finding answers.
Include a complete runnable program and notes on how to make input data.
Hello @shivamchaubey,
Wow, that’s a big image. If you want to paste many small images together at arbitrary positions, use
insert
. You will find there is a limit of about 2,000 images, set by the C stack size. You will probably have to assemble your image in sections.If you can place the images in a grid, use
arrayjoin
. It can join at least 30,000 images at once.composite
is useful if your images have transparency. If you use it for images without an alpha channel, each image will just overwrite the previous one.Yes, libvips has stuff for NCC-style matching, both 0 and 1st order. You make a series of pairwise joins along edges. It may not work for you, you’d need to give more information.