|
|
|
| Honey, will you tether your soul to mine? |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Opencv Imwrite and Copy
Does anyone know how to save a Mat image as a .jpg file in C++? We have tried imwrite but cannot get Eclipse to recognize the function.
Also is there a way to copy one Mat image to another? Thanks |
|
#2
|
||||
|
||||
|
Re: Opencv Imwrite and Copy
Sometimes eclipse gives you fake errors in C++. Try putting in an imwrite (make sure to #include the opencv header) and actually build it, ignoring eclipse's instant feedback. Does g++ give you errors?
|
|
#3
|
|||
|
|||
|
Re: Opencv Imwrite and Copy
We use imwrite() with no problem. As previously stated, it is likely just an Eclipse issue, or a problem with your #includes.
For copying, try clone(): Code:
cv::Mat source; //...GrabFrame(source) or whatever... cv::Mat dst = source.clone(); |
|
#4
|
|||
|
|||
|
Re: Opencv Imwrite and Copy
Okay the clone is compiling okay and cv::imwrite("test.jpg", out_image) is also compiling. It looks like the third parameter for imwrite is not needed.
Thanks for your help. I will try this tonight. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|