X
X
xecoder2017-08-10 12:30:08
Programming
xecoder, 2017-08-10 12:30:08

How to imwrite an image to a subfolder without giving the full path in OpenCV?

Unable to write image to subfolder.
Wrote in different ways, zero sense.

imwrite("../../pat/Gray_Image.jpg", image_source);

imwrite("../pat/Gray_Image.jpg", image_source);

imwrite("/pat/Gray_Image.jpg", image_source);

imwrite("\\pat\\Gray_Image.jpg", image_source);

imwrite("//pat//Gray_Image.jpg", image_source);

imwrite("\pat\Gray_Image.jpg", image_source);

!!!!!!!SOLUTION FOUND!!!!!!!
OpenCV only works with full paths.
We get the path to the working folder and add the necessary folder and file name with the extension to it.
That's how it works.
!!!!!!!SOLUTION FOUND!!!!!!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Derevyanko Alexander, 2017-08-10
@dio4

It's not my business, of course, but is it possible to take on such a complex software package without knowing how to write to folders? And you have a slash here and a backslash ... what system is worth? Windows or open source what? Is the record obtained with the full path or not? Do it with full first.
Have you read here?
What have you been able to do so far? How was the library installed? Version?
Yes - you specified the section "....MICROSOFT VISUAL C ++" - it means Windows. What about slash then? In Windows, reverse separates directories.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question