Ask Your Question
0

c++ similar function to numpy

asked 2019-02-04 12:29:29 -0600

ymw gravatar image

hi there, I have developed my opencv vision algorithm in python. in my algorithm I have used numpy function as follow,

roi=cv2.imread("roi.png") img=cv2.imread("image.png")
img[roi<100] = 0;

basically what I have done is, I have image (roi.png) which contain important area for generate features, so I will consider only the area in img which roi has greater values than 100, so my problem is I need to implement this code in c++, how can I do it without numpy in c++? thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-02-04 15:10:13 -0600

LBerger gravatar image

updated 2019-02-05 00:43:50 -0600

see setTo

  Mat mask=roi<100;
  img.setTo(Scalar(0),mask)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-02-04 12:29:29 -0600

Seen: 2,074 times

Last updated: Feb 05 '19