How to merge two images one over another?

2 ビュー (過去 30 日間)
JAI PRAKASH
JAI PRAKASH 2018 年 7 月 3 日
コメント済み: OCDER 2018 年 7 月 3 日
Note
1 both are RGB's
2 black area iscompletely black i.e., RGB value is 0
Right now I am doing this:
But I am not satisfied with performance, in terms of time it is taking.
Can there be more efficient way?
  2 件のコメント
Adam
Adam 2018 年 7 月 3 日
im_blank > 0
is going to produce a 3-element vector on an RGB image.
JAI PRAKASH
JAI PRAKASH 2018 年 7 月 3 日
Yes, you are right.
My approach is accurate, but consumes more time.

サインインしてコメントする。

採用された回答

OCDER
OCDER 2018 年 7 月 3 日
I don't think you can go any faster at this point, unless zoom_image is a double. If so, then you can do
zoom_image = zoom_image.*(~mask) + imblank.*mask; % ~17% faster
When you reached the end of the code-based optimization, try parallel or GPU computing, or MEX/C++ to achieve faster speeds. I'm guessing GPU computing is the way to go since GPU is designed for image processing.
  2 件のコメント
JAI PRAKASH
JAI PRAKASH 2018 年 7 月 3 日
Hey OCDER
Thanx
Can u guide me how to speed up using me c++. Not exactly on above problem but generally how to use mex c++ to speed up calculation.
OCDER
OCDER 2018 年 7 月 3 日
Ah, that took me a while to get used to and I'm still learning tricks. The general idea is to make a "gateway" function that links matlab to C++. I started with this tutorial and looked at the example codes that matlab has.
It's a good investment as some of my codes have been sped up > 10 times, and GPU uses C language. When you get stuck on mex, ask us at the forum. The mvp's have more experience with mex coding.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by