Ask Your Question

EvilMegaDroid's profile - activity

2020-10-24 03:30:15 -0600 received badge  Student (source)
2020-02-08 10:32:16 -0600 received badge  Enthusiast
2020-02-05 09:50:07 -0600 commented question Template matching, false negative on close image's

Yes my bad

2020-02-05 09:36:00 -0600 commented question Template matching, false negative on close image's

@LBerger Isn't it possible to match by edges? I mean the script wouldn't work if the color changes. And colormatchtempla

2020-02-05 08:41:45 -0600 edited question Template matching, false negative on close image's

Template matching, false negative on close image's I'm having this issue that for some reason, opencv template matching

2020-02-05 08:34:06 -0600 asked a question Template matching, false negative on close image's

Template matching, false negative on close image's I'm having this issue that for some reason, opencv template matching

2020-02-01 14:25:02 -0600 commented answer Png transparent, text problems with glow

Thanks it works, I found a solution with PILL too but its great that you made it work with cv2 (since I had to use cv2 f

2020-02-01 14:24:23 -0600 received badge  Scholar (source)
2020-02-01 13:53:01 -0600 marked best answer Png transparent, text problems with glow

I'm trying to place a logo into a background. The logo has text with glow.

When I put it on the background it only outputs the white part (and removes the black glow)

Here's the code:

import cv2
import numpy as np

# importing the main image
image = cv2.imread("flower.jpg")
# importing the logo image
watermark = cv2.imread("asdasd.png", -1)
(wH, wW) = watermark.shape[:2]


(B, G, R, A) = cv2.split(watermark)
B = cv2.bitwise_and(B, B, mask=A)
G = cv2.bitwise_and(G, G, mask=A)
R = cv2.bitwise_and(R, R, mask=A)
watermark = cv2.merge([B, G, R, A])


(h, w) = image.shape[:2]
image = np.dstack([image, np.ones((h, w), dtype="uint8") * 255])

# construct an overlay that is the same size as the input
# image, (using an extra dimension for the alpha transparency),
# then add the watermark to the overlay in the bottom-right
# corner
overlay = np.zeros((h, w, 4), dtype="uint8")
overlay[h - wH - 10 : h - 10, w - wW - 10 : w - 10] = watermark

# blend the two images together using transparent overlays
output = image.copy()
cv2.addWeighted(overlay, 1, output, 1, 0, output)
cv2.imshow("output", output)
cv2.waitKey(0)
cv2.waitKey(0)

Watermark
watermark

Image
watermark

Good Output
I'm looking to get something like this (this was done with ps, should be possible with programming though) image description

2020-02-01 12:31:07 -0600 edited question Png transparent, text problems with glow

Png transparent, text problems with glow I'm trying to place a logo into a background. The logo has text with glow. Whe

2020-02-01 12:29:19 -0600 commented answer Png transparent, text problems with glow

I updated my post to show an example of what I'm looking to get.

2020-02-01 12:28:41 -0600 edited question Png transparent, text problems with glow

Png transparent, text problems with glow I'm trying to place a logo into a background. The logo has text with glow. Whe

2020-02-01 12:18:27 -0600 commented answer Png transparent, text problems with glow

I can already get this. The problem is getting the shadows from the text. If you see the watermark it has black shadow a

2020-02-01 11:44:39 -0600 commented question Png transparent, text problems with glow

@LBerger I'm using addWeighted and I can get transparency just that I can't get it the way I wanted. I will add a resu

2020-02-01 10:55:01 -0600 asked a question Png transparent, text problems with glow

Png transparent, text problems with glow I'm trying to place a logo into a background. The logo has text with glow. Whe