N
N
Nyashkoshkko2013-10-16 19:21:12
Qt
Nyashkoshkko, 2013-10-16 19:21:12

How to determine in which function the file is being saved?

There is an open-source library openbr .

The procedure for determining faces from a photograph is called, everything is as in the example:

transform = br::Transform::fromAlgorithm("FaceRecognition");
br::Globals->enrollAll = true;
query = br::TemplateList::fromGallery("http://127.0.0.1:8093/1.bmp");
query >> *transform;
The code works great, faces are determined, everyone is happy.

But, on the line:
query >> *transform;
a parasitic img.jpg file is created in the current project directory.

Stepping into the openbr sources themselves (the assembly of the debug version of which, for example, under win_x64, obviously, occurs according to the corresponding instructions, only in paragraph 6.a instead of DCMAKE_BUILD_TYPE=Release you need to write DCMAKE_BUILD_TYPE=Debug) led to the DistributeTemplateTransform::project() of the openbr/plugins/ file meta.cpp
There, after executing this code
futures.waitForFinished();
the ill-fated file is created.
But saving happens explicitly on a different thread, and this function just waits for the asynchronous operation to complete.
I need to find where exactly in another thread this file is created (or maybe it is created in the opencv linked to openbr, I can only guess).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nyashkoshkko, 2013-10-17
@Nyashkoshkko

It turned out that this is not openbr at all, but a stupid QCameraImageCapture, which is also present in the program, with ::CaptureToBuffer written quite well

capturer = new QCameraImageCapture(camera); // создаем экземпляр класса, который умеет взаимодействовать с камерой и получать от нее изображения
capturer->setCaptureDestination(QCameraImageCapture::CaptureToBuffer); // говорим этому классу, что изображения нужно брать не в файл, а в буфер
anyway, every time you call
capturer->capture();
stubbornly created the img.jpg file in the program folder.
Cured like this:
capturer->capture("/dev/null");

Many thanks to everyone for the answers, for the first time in my life I use the help of the community to solve epoch-making, in general (but more on that later, in a separate article) tasks, and such interactivity and responsiveness is inspiring!

@
@ntkt, 2013-10-16
_

In general, the task of "finding out who did what" is handled by an API interceptor, such as Microsoft's Process Monitor (procmon.exe).
technet.microsoft.com/ru-ru/sysinternals/bb896645.aspx
1) Run Process Monitor
2) set the filter to the desired process/file/…
3) reproduce the problem
4) find the corresponding. event in the Process Monitor log (for example, file creation)
5) by double clicking on the event, you can find the call stack. Everything.
Otherwise, you will have to honestly catch it with a debugger, of course (in the old fashioned way, put a breakpoint on NtCreateFile).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question