Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw lines with transparency x( serveral lines with difference transparency on a color image (not using addWeighted that is slow I have 500 lines) on Color image #14182

Open
lucasjinreal opened this issue Mar 29, 2019 · 2 comments

Comments

@lucasjinreal
Copy link

I know there is a addWeighted method. But what I need is draw many lines, every line with different transparency.

Which means, can not using N mask to draw then addWeighted, that too slow speed.

To draw a line on BGR format image:

line(img_a, p1, p2, c, 2, CV_AA);

It does not add alpha even c is Scalar with alphas.

I convert image from BGR to BGRA with 4 channels, but the line still full with color rather than with transparency.

Any body could help me out with simply what I need?

serveral lines with difference transparency on a color image (not using addWeighted that is slow I have 500 lines).

@kallaballa
Copy link
Contributor

@lucasjinreal check this out: #20780 (comment)

@SmileLars
Copy link

SmileLars commented May 5, 2024

@lucasjinreal check this out: #20780 (comment)

Hi :)
Can you please explain/show how to efficiently draw a line with alpha onto a mat image?
I have tried many things, like creating a bounding box around line than blending whats inside box. But it is still too slow. Compared to other drawing metodes outside opencv. Even do it 3x the speed, blending 1000 lines takes a while. Something that should have taken just some seconds.

I didn't understand how to implement what you linked to. :/ I had appreciated if you could show/explain to me how it is done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants