Comments (6)
Yes, global balance will work on merged images too.
You might need to run it in sections, so balance 10x10 blocks of tiles, then balance again after final assembly.
from pyvips.
Can you give please an example to integrate this with merge function?
My code looks like.
1. def stitch(coor):
2. global onlyfiles,mypath,row,column
3. onlyfiles=np.array(onlyfiles)
4. files=onlyfiles.reshape(row,column)
5. blend=False
6. for r in tqdm(range(files.shape[0])):
7. c=0
8. if r==0:
9. tile = pyvips.Image.black(coor[r,c][0],coor[r,c][1])
10. else:
11. tile = pyvips.Image.black(coor[r,c][0],coor[r,c][1]-coor[r-1,c][1])
12. for c in tqdm(range(files.shape[1])):
13. tile1 = pyvips.Image.new_from_file(join(mypath,files[r][c]), access="sequential")
14. if r==0:
15. x,y=coor[r,c]
16. else:
17. x,y=coor[r,c][0],coor[r,c][1]-coor[r-1,0][1]
18. tile = tile.merge(tile1, 'horizontal', -x, -y, mblend =blend)
19. if r>0:
20. y=coor[r-1,0][1]
21. stitch_img = stitch_img.merge(tile, 'vertical', 0, -y, mblend =blend)
22. else :
23. stitch_img=tile
24. print (stitch_img.width,stitch_img.height,"width","height")
25. stitch_img.dzsave('test_80X80')
I have tried inserting tile=tile.globalbalance()
at line number 19 for adjacent contrast adjustment , and also stitch_img=stitch_img.globalbalance()
at line number 22 for contrast adjustment between each row. It's not working and I am getting an error.
Error:
raise Error('unable to call {0}'.format(operation_name))
pyvips.error.Error: unable to call globalbalance
im_global_balance: unable to open "temp-0"
Please provide an example for this function.
from pyvips.
Don't use black, it'll get confused.
You need to start from a set of images on disc, merge them together, then call globalbalance
.
from pyvips.
How those black pixels can be ignored. I have added 255 value to those pixels but it's not working with global balance. I can't remove those black pixel area, however, I can modify them to work for global balance. What kind of modification is needed for global balance?
from pyvips.
You don't need black to assemble a mosaic, do you? Build it without using black and globalbalance should work.
from pyvips.
Whenever I am using merge function, I will have some black pixels because my image is shifting in vertical direction also. So, an extra region is padded with a black pixel. I was using a black image for the first merging operation to make coordinates easy otherwise I have to make dynamic coordinates for merging operation, which is related to the input frame of reference.
from pyvips.
Related Issues (20)
- Does Pyvips have uniformly sampled noise? HOT 2
- Select interpretation when initializing the image HOT 1
- VipsOperation: class "pdfload" not found HOT 2
- SVG rendering failed HOT 1
- JPEG compression resulted in color error. HOT 1
- How to generate patches from coordinate list by a multiprocessing way? HOT 1
- Dtype auto conversion while running script HOT 6
- new release when & ship with libvips? HOT 14
- ICC Profile Application on SVS and tiffsave hangs randomly
- High RAM usage with fetch when reading multiple WSI tiles HOT 2
- Slower first run, even without cache HOT 2
- using resource.setrlimit makes pyvips / liborc spit the dummy HOT 2
- Memory leaking with pdf HOT 21
- dzsave_target returns NoneType not list[] as in docs HOT 1
- Pyvips fetch returns bad image on .svs files HOT 4
- Reading in image a second time breaks on qptiff file HOT 6
- Documentation link to conda package HOT 1
- Create svs file with image pyramid, label and macro in pyvips? HOT 4
- Image merge stitch HOT 2
- `addalpha` has different behaviour compared to C HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvips.