how to use Mat img on all function without any calling function
ı want to use Mat img=imread("Nature.jpg"); to all func. such volatile int temp; is there any way for this?
ı want to use Mat img=imread("Nature.jpg"); to all func. such volatile int temp; is there any way for this?
Hi,I think your problem can be solved by defining a global variable.
something like this:
void main void()
{
Mat img=imread("Nature.jpg");
for(;;) //for loop #1
{
//use img here
}
for(;;) //for loop #2
{
//use img here
}
and so on...
return 0;
}
Asked: 2015-10-10 05:12:53 -0600
Seen: 222 times
Last updated: Oct 10 '15
What is the most effective way to access cv::Mat elements in a loop?
Is there penalty for reference counting in Mat?
Saving an image with unset pixels
android: how to put a column into Mat
Find pixel color out of cv::Mat on specific position
How to update Mat with multiple channels?
what ?????
ı meant that if you state volatile variable in C, you can use it on any loop as variable. it's not necassary to introduce one more times in loop which uses volatile variable. ı want to do like this for an image that ı loaded
please edit your question , and try to make your situation much more clear.
are you afraid, the compiler tries to optimize the imread call away ?