Ask Your Question
0

How to define a function using image as the input argument

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

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
0

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

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

Comments

Thank you very much

jason gravatar imagejason ( 2016-01-18 11:13:27 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 172 times

Last updated: Jan 17 '16