Ask Your Question

How to define a function using image as the input argument

asked 2016-01-17 18:27:24 -0500

jason gravatar image

Hello, I am new to opencv so I ask a simple question. I want to define a function using the image as the input argument. How should I define it? Likevoid compute(int a , char b). If the image is named Im1, could I define it like void compute(cv:Mat Im1, int a )? Thanks for your help

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-17 20:09:15 -0500

Tetragramm gravatar image

Exactly that. Be warned that this makes a shallow copy. Any changes you make to the image inside the function will be there when the function finishes. You will need to use .clone() to make a deep copy if that is what you need.

edit flag offensive delete link more


Thank you very much

jason gravatar imagejason ( 2016-01-18 11:13:27 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-01-17 18:27:24 -0500

Seen: 75 times

Last updated: Jan 17 '16