UTokyo-FieldPhenomics-Lab / EasyIDP

A handy tool for dealing with region of interest (ROI) on the image reconstruction (Metashape & Pix4D) outputs, mainly in agriculture applications
https://easyidp.readthedocs.io/en/latest/
MIT License
46 stars 6 forks source link

handle Metashape duplicate the same sensor label with different sensor attributes #86

Closed HowcanoeWang closed 1 year ago

HowcanoeWang commented 1 year ago
    Probably I figured out the reason for this bird dataset.

For this metashape project, the doc.xml in Hidden_Little_03_24_2022.files\0\chunk.zip has the following record:

<sensors next_id="2">
    <sensor id="0" label="FC6540, DJI DL   35mm F2.8 LS ASPH (35mm)" type="frame">
      <resolution width="6016" height="4008"/>
      ...
    </sensor>
    <sensor id="1" label="FC6540, DJI DL   35mm F2.8 LS ASPH (35mm)" type="frame">
      ...
    </sensor>

The metashape mistakely duplicated the same sensor to two. And the easyidp assume the each sensor has different sensor label, so use it as the key. So in this case, the sensor 1 rewrite the sensor 0, for sensor object.

There should be a logic bug in idp.Container class which produces sensors object, I will take a look at it on this weekend.

Originally posted by @HowcanoeWang in https://github.com/UTokyo-FieldPhenomics-Lab/EasyIDP/discussions/44#discussioncomment-5471582

HowcanoeWang commented 1 year ago

Passed on the ForestBrids dataset:

In [3]: fb = idp.data.ForestBirds()

In [4]: ms = idp.Metashape(fb.metashape.project, chunk_id=0)

In [6]: ms.sensors
Out[6]:
<easyidp.Container> with 2 items
[0]     FC6540, DJI DL   35mm F2.8 LS ASPH (35mm)
<easyidp.reconstruct.Sensor object at 0x00000216FF2D15B0>
[1]     FC6540, DJI DL   35mm F2.8 LS ASPH (35mm) [1]
<easyidp.reconstruct.Sensor object at 0x00000216FF2D84C0>

@bw4sz