Copy cv::Mat *src to cv::Mat *des in OpenCVHow to find out what type of a Mat object is with Mat::type() in OpenCVImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionWhat's the difference between Mat::clone and Mat::copyTo?Select a subset of a Mat and copy them to create a new mat in C++/Opencvcloning an opencv Mat performanceOpenCV - copy CUDA device data into GPU MatOpenCV clone() and copyTo() methods don't produce Mat of same type as original?OpenCV Mat in function return and using copyToopencv copy data from a *Mat to a MatOpenCV IOS Resize a Mat

How to make payment on the internet without leaving a money trail?

Is "plugging out" electronic devices an American expression?

Lied on resume at previous job

What does 'script /dev/null' do?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

Copycat chess is back

Symmetry in quantum mechanics

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Why is my log file so massive? 22gb. I am running log backups

Ideas for 3rd eye abilities

Shall I use personal or official e-mail account when registering to external websites for work purpose?

aging parents with no investments

Add an angle to a sphere

Prime joint compound before latex paint?

Could a US political party gain complete control over the government by removing checks & balances?

How would photo IDs work for shapeshifters?

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Is there a name of the flying bionic bird?

Is it wise to focus on putting odd beats on left when playing double bass drums?

How could a lack of term limits lead to a "dictatorship?"

What is GPS' 19 year rollover and does it present a cybersecurity issue?

Why do UK politicians seemingly ignore opinion polls on Brexit?

How can I fix this gap between bookcases I made?



Copy cv::Mat *src to cv::Mat *des in OpenCV


How to find out what type of a Mat object is with Mat::type() in OpenCVImage Processing: Algorithm Improvement for 'Coca-Cola Can' RecognitionWhat's the difference between Mat::clone and Mat::copyTo?Select a subset of a Mat and copy them to create a new mat in C++/Opencvcloning an opencv Mat performanceOpenCV - copy CUDA device data into GPU MatOpenCV clone() and copyTo() methods don't produce Mat of same type as original?OpenCV Mat in function return and using copyToopencv copy data from a *Mat to a MatOpenCV IOS Resize a Mat






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-2















I would like copy an cv::Mat* to an other cv:Mat.. How can I do this? The functions .copyto and .clone are not work..










share|improve this question

















  • 1





    Could you post the code you tried?

    – Bahramdun Adil
    Mar 8 at 7:28











  • cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

    – HansHirse
    Mar 8 at 7:29











  • This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

    – Mr. ManPower
    Mar 8 at 7:32












  • psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

    – Kinght 金
    Mar 8 at 7:47







  • 2





    Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

    – api55
    Mar 8 at 9:42


















-2















I would like copy an cv::Mat* to an other cv:Mat.. How can I do this? The functions .copyto and .clone are not work..










share|improve this question

















  • 1





    Could you post the code you tried?

    – Bahramdun Adil
    Mar 8 at 7:28











  • cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

    – HansHirse
    Mar 8 at 7:29











  • This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

    – Mr. ManPower
    Mar 8 at 7:32












  • psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

    – Kinght 金
    Mar 8 at 7:47







  • 2





    Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

    – api55
    Mar 8 at 9:42














-2












-2








-2








I would like copy an cv::Mat* to an other cv:Mat.. How can I do this? The functions .copyto and .clone are not work..










share|improve this question














I would like copy an cv::Mat* to an other cv:Mat.. How can I do this? The functions .copyto and .clone are not work..







opencv opencv-mat






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 7:24









Mr. ManPowerMr. ManPower

6




6







  • 1





    Could you post the code you tried?

    – Bahramdun Adil
    Mar 8 at 7:28











  • cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

    – HansHirse
    Mar 8 at 7:29











  • This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

    – Mr. ManPower
    Mar 8 at 7:32












  • psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

    – Kinght 金
    Mar 8 at 7:47







  • 2





    Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

    – api55
    Mar 8 at 9:42













  • 1





    Could you post the code you tried?

    – Bahramdun Adil
    Mar 8 at 7:28











  • cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

    – HansHirse
    Mar 8 at 7:29











  • This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

    – Mr. ManPower
    Mar 8 at 7:32












  • psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

    – Kinght 金
    Mar 8 at 7:47







  • 2





    Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

    – api55
    Mar 8 at 9:42








1




1





Could you post the code you tried?

– Bahramdun Adil
Mar 8 at 7:28





Could you post the code you tried?

– Bahramdun Adil
Mar 8 at 7:28













cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

– HansHirse
Mar 8 at 7:29





cv::Mat* is a pointer to a cv::Mat object, not a cv::Mat object itself, thus the mentioned methods aren't applicable. If you're not familiar with using pointers, have a look at an introduction.

– HansHirse
Mar 8 at 7:29













This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

– Mr. ManPower
Mar 8 at 7:32






This is right.. And how can I copy an Pointer Mat?? I have cv::Mat* Image 1 and cv::Mat* Image2 and would like copy the imagedata from Image2 to Image1..

– Mr. ManPower
Mar 8 at 7:32














psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

– Kinght 金
Mar 8 at 7:47






psrc->copyTo(*pdst) ? And you shoud allocate memory for them.

– Kinght 金
Mar 8 at 7:47





2




2





Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

– api55
Mar 8 at 9:42






Are you sure you even need cv::Mat*? cv::Mat already behaves like a smart pointer... so cv::Mat a = b it is like copying a pointer to the image data of b... And only the clone and copyTo methods will do a deep copy of the data. If you use pointer, you probably miss the dereferencing part... but I don't know what are you doing. Maybe if you post your code people can give an answer that suits you better.

– api55
Mar 8 at 9:42













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058529%2fcopy-cvmat-src-to-cvmat-des-in-opencv%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058529%2fcopy-cvmat-src-to-cvmat-des-in-opencv%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved