Bug 407262 - Face tagging doesn't work with rotation
Summary: Face tagging doesn't work with rotation
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Engine (show other bugs)
Version: 6.1.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-06 07:16 UTC by tokumeino
Modified: 2019-05-07 21:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tokumeino 2019-05-06 07:16:36 UTC
SUMMARY

I experience issues with face tagging and I think that it is related with orientation since it seems to work better with pictures in regular landscape mode.

Samples are provided here (too large files for the bug tracker) : https://drive.google.com/open?id=1lNlVxSq_EnyDMCZdXLm-1M7WflkCygt6

STEPS TO REPRODUCE

Step 1 : Open a picture (RAW) with an EXIF tag indicating a rotation (see "14-06-21 192232 1100" .RW2 file and .XMP).
Step 2 : Draw a box arround the face and assign name "Sample" (see screenshot1.png). Sorry for the french langage but I couldn't figure out how to change it.
Step 3 : Observe the result of the bounding box in the Person view (see screenshot2.png) : the result is not what is expected.

Do you want more ?

Step 4 : Rotate the picture to the right : the picutre doens't rotate, but the box does (see screenshot3.png). I've tried with almost any combination of parameters in the Metadata>Rotation settings.
Step 5 : Rotate back to the left : the bounding box doesn't get back at its right place (see screenshot4.png).
Step 6 : Remove all faces : rotation works (see screenshot5.png).
Step 7 : Try with auto face detection... the bounding box doesn't appear at the right place (see screenshot6.png).

It seems to work better with files shot in regular portrait mode.

Step 8 : Auto detection with picture "16-07-30 090611 0910" : it works (see screenshot7.png and screenshot8.png) but as soon as youtry to rotate, the issues above rise again.


OBSERVED RESULT
Inconsistency between faces bounding boxes and faces as shown in the person view
Inability to rotate pictures while faces are defined.


SOFTWARE/OS VERSIONS
Windows: 10 Pro, build 17763

ADDITIONAL INFORMATION
4K screen set at a 200% ratio.
Comment 1 Maik Qualmann 2019-05-06 19:39:52 UTC
The basic problem is clear, also has something to do with Bug 372340. A problem is also the use of the half RAW size as a preview image. Another is that we did not get the correct original size when loading the RAW preview from this Panasonic files.

@Gilles, there are 2 different functions for determining the original size. In the properties tab, RAW files use MetaEngine::getItemDimensions(). This function actually determines the correct value. The preview loader will use the MetaEngine::getPixelSize() function to set the "OriginalSize" attribute when loading the half RAW size. This provides a false height of 200 pixels because Exiv2 internally uses the Sensor Width and Sensor Height values for this Panasonic RAW. Do you know from the story of the development, why there are 2 functions for the image size?

Maik
Comment 2 caulier.gilles 2019-05-06 19:56:26 UTC
Maik,

no idea why there is this king of difference in th code.

I don't remember to code something like this.

Gilles
Comment 3 Maik Qualmann 2019-05-07 21:03:10 UTC
Git commit 6033840ce800e591137ed26eed6529794c1c1374 by Maik Qualmann.
Committed on 07/05/2019 at 21:01.
Pushed by mqualmann into branch 'master'.

fix face rotation with half RAW size preview image
FIXED-IN: 6.2.0

M  +2    -1    NEWS
M  +6    -0    core/libs/database/coredb/coredbthumbinfoprovider.cpp
M  +2    -1    core/libs/database/coredb/coredbthumbinfoprovider.h
M  +7    -1    core/libs/threadimageio/fileio/loadsavethread.h
M  +22   -1    core/libs/threadimageio/preview/previewtask.cpp

https://invent.kde.org/kde/digikam/commit/6033840ce800e591137ed26eed6529794c1c1374