How to do af::replace based on col_index?

20 views
Skip to first unread message

Joe Chan

unread,
Apr 22, 2022, 2:28:04 AM4/22/22
to ArrayFire Users
Assume I have an array "a" with dim4 = h, w, c, 1
I want to assign blue color when column index is smaller than w/2
something like below

array out = af::replace(a, a.col < w/2, (255,0,0));

But how?

Umar Arshad

unread,
May 12, 2022, 2:03:28 PM5/12/22
to ArrayFire Users
Try:
Assuming RGB:

a(seq(w/2), span, 2) = 255:
Reply all
Reply to author
Forward
0 new messages