Comments (2)
This should be possible by adding certain level of gradient in the edges of the outline, but in actual use case, i think we need to get some templates of those seals? Otherwise it might not be easy to create those seals from scratch.
from augraphy.
We have a draft set of stamps that could be integrated for use with this proposed augmentation, but that will need to be packaged for download separately, possibly on zonodo. Nevertheless, a user will need to reference a set of images within a folder, or possibly an existing set that we may offer via URL to download via zonodo or figshare, etc.
Filters and Post-Processing
Below are possible filters that may be useful to create a debossed or embossed representation of the stamp that could then be colorized and blended into the ink layer.
The use of course-grained noise would help make the impression look more natural when blended with the page. We may also want to borrow some of the letterpress functionality to blend ink-based stamps as well.
Note that colorized stamps would represent ink-pressed stamps while a semi-transparent white(?) stamp would represent an impression pressed into the paper to raise/low the paper instead of being combined with ink. Both stamps and seal can have the embossed or debossed impression effect. So a color and alpha transparency level associated with color could be passed in as a parameter or randomized (see markup
augmentation and overlaybuilder
utility for reference implementations).
Both scipy or opencv are dependencies that offer the convolutions. We may want to compare speeds, but if it's a toss-up then we should stick with opencv for consistency with the majority of our existing code:
opencv:
debossed_image = cv2.filter2D(img, -1, kernel_deboss, borderType=cv2.BORDER_REFLECT)
scipi:
embossed_image = convolve2d(image, kernel_emboss, mode='same', boundary='symm')
Deboss filters
# Deboss filter kernel variation 1
kernel_deboss_1 = np.array([[-1, -1, -1],
[-1, 9, -1],
[-1, -1, -1]])
# Deboss filter kernel variation 2
kernel_deboss_2 = np.array([[0, -2, -2],
[2, 0, -2],
[2, 2, 0]])
# Deboss filter kernel variation 3
kernel_deboss_3 = np.array([[-1, -2, -1],
[-2, 12, -2],
[-1, -2, -1]])
Emboss filters
# Emboss filter kernel variation 1
kernel_emboss_1 = np.array([[-1, -1, 0],
[-1, 0, 1],
[0, 1, 1]])
# Emboss filter kernel variation 2
kernel_emboss_2 = np.array([[0, 1, 0],
[1, -4, 1],
[0, 1, 0]])
# Emboss filter kernel variation 3
kernel_emboss_3 = np.array([[-2, -1, 0],
[-1, 0, 1],
[0, 1, 2]])
from augraphy.
Related Issues (20)
- Create Baseline Performance Benchmark; Apply Initial Optimizations Using Numba HOT 2
- Create Example Using Dataloader for PyTorch and TensorFlow HOT 1
- Add Python 3.11 Support, Drop Python 3.7 HOT 2
- Images Broken in PyPI Listing HOT 2
- Reflected Light from Camera Flash or other Bright Sources HOT 1
- Add Color Shifting / 3D Blur Effect HOT 4
- Improve PageBorder effect HOT 1
- Add support for bounding box, keypoints and mask. HOT 1
- Add `InkColorSwap` to Replace the Color Used for Lettering in a Document HOT 1
- Add `InkMottling` Augmentation to Ensure Ink is Non-Uniform HOT 1
- Add support for image with alpha layer. HOT 1
- Color range in InkBleed is not working HOT 1
- Update to Paper Factory HOT 1
- Confusion on `Geometric` Augmentation HOT 2
- Memory leak in AugmentationSequence HOT 4
- Training becomes very slow with these transforms. HOT 10
- ColorPaper cant generate different color in the cycle running HOT 2
- DirtyScreen doesnt work and crashes jupyterlabs HOT 2
- stucked when I process image in the cycle HOT 5
- Default pipeline generates many "unreadable" documents HOT 3
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 augraphy.