uhlik / bpy

blender python scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue iporting XML

jackwolfwolf opened this issue · comments

Hey,
Amazing tool, thank you.
I'm having an issue importing my XML to blender.
I get the bounding box but not the cameras.

I'm pretty sure it has something to do with my export. Any ideas? Many thanks

-

-

-

-

-

<data_type>uint8</data_type>

-

1333.07451672565

-0.0032420190486278

-0.000230818411080209

-0.000131883222461288

-

f k1 p1 p2

2.4079217686041626e-02 3.2736272770283617e-06 8.3625546200488733e-07 -8.4396120818103178e-07 3.2736272770283617e-06 3.1209562525747386e-09 1.0760845648250534e-10 -4.6974546329740755e-10 8.3625546200488733e-07 1.0760845648250534e-10 5.6287273173691871e-10 -2.1025560573355576e-11 -8.4396120818103178e-07 -4.6974546329740755e-10 -2.1025560573355576e-11 6.5886569001369961e-10

-

-

1.8661895220851932e-02 -1.9836981869975234e-02 -9.9962904510476136e-01 1.2280982870342449e+01 4.7317340835998278e-01 -8.8057640902418788e-01 2.6308049928954025e-02 8.4850059253783670e+00 -8.8077162720410296e-01 -4.7348884043909401e-01 -7.0468923561713137e-03 -3.8700528144853429e+01 0 0 0 1

-

-5.8299833844070337e-02 -1.6503717451055444e-02 -9.9816269048890516e-01 1.4148378540711629e+01 4.7332680280499179e-01 -8.8078974970044521e-01 -1.3082605590314988e-02 9.0413107518914870e+00 -8.7895555468985909e-01 -4.7321986870050509e-01 5.9161547874601456e-02 -3.8789240419376505e+01 0 0 0 1

-

-8.4979980073147110e-02 -1.6683135638577984e-02 -9.9624298038783321e-01 1.4699516122250909e+01 4.7270952595543203e-01 -8.8084720356246504e-01 -2.5571625821912747e-02 9.1808704102460972e+00 -8.7711122844127243e-01 -4.7310662324834329e-01 8.2740654945387959e-02 -3.8856594179993905e+01 0 0 0 1

-

-1.1725911953725565e-01 -1.7393499749679409e-02 -9.9294902439742905e-01 1.5315864407239422e+01 4.7135798797682182e-01 -8.8102391915902001e-01 -4.0230598306798371e-02 9.3286771040824021e+00 -8.7411209009816915e-01 -4.7275185883943255e-01 1.1150665409773322e-01 -3.8910116822190808e+01 0 0 0 1

-

-1.4789698420691622e-01 -1.7443624112535000e-02 -9.8884892781471945e-01 1.5972996416364923e+01 4.6977883212176214e-01 -8.8108660298405816e-01 -5.4719712465674072e-02 9.5128446968377336e+00 -8.7030703257690201e-01 -4.7263317490399825e-01 1.3850469677001614e-01 -3.8960720044253030e+01 0 0 0 1

-

1.8427306387817977e-02 -1.9009428930511607e-02 -9.9964947656217196e-01 1.2282089297531048e+01 4.7336727094825842e-01 -8.8049686462525567e-01 2.5469553982982729e-02 8.4840685065204280e+00 -8.8067239151360233e-01 -4.7367067989989597e-01 -7.2267440028415397e-03 -3.8726926708185132e+01 0 0 0 1

-

-1.6572591448868407e-01 -1.7509808637509838e-02 -9.8601639330609903e-01 1.6596080852759563e+01 4.6883549406774638e-01 -8.8102483368780438e-01 -6.3154745883654662e-02 9.7068341443488233e+00 -8.6759910141098051e-01 -4.7274586093043114e-01 1.5421786603375109e-01 -3.8956241159876626e+01 0 0 0 1

-

-1.7464016186475506e-01 -1.7642767918756630e-02 -9.8447424882726997e-01 1.7248600540321714e+01 4.6821734865156256e-01 -8.8104896854727111e-01 -6.7269825653789750e-02 9.9442031883561075e+00 -8.6618319556867029e-01 -4.7269593584243480e-01 1.6212718449566585e-01 -3.8959069785052769e+01 0 0 0 1

-

-1.8036747098013983e-01 -1.7461486317421809e-02 -9.8344429019025537e-01 1.7891056487456009e+01 4.6805565672270522e-01 -8.8090608714739760e-01 -7.0202334979247924e-02 1.0191946965611354e+01 -8.6509622448725643e-01 -4.7296888071230220e-01 1.6705975055544209e-01 -3.8963614429641105e+01 0 0 0 1

-

-1.8500735345441144e-01 -1.7401922658261293e-02 -9.8258305107282895e-01 1.8533422479114858e+01 4.6807918095782219e-01 -8.8070453828837603e-01 -7.2535485054645465e-02 1.0500013638481338e+01 -8.6410309542417951e-01 -4.7334626789069983e-01 1.7108229350899218e-01 -3.8956126753606803e+01 0 0 0 1

-

-1.8822384392004984e-01 -1.6936999958975574e-02 -9.8198010296153670e-01 1.9182907506988109e+01 4.6805490054864629e-01 -8.8055105417856461e-01 -7.4528189682933621e-02 1.0861589210039488e+01 -8.6342133089955453e-01 -4.7364858177493585e-01 1.7366815001673225e-01 -3.8900541196769439e+01 0 0 0 1

-

-1.9079832090194460e-01 -1.3047150465032464e-02 -9.8154254752697390e-01 1.9875706584618570e+01 4.6822358791981872e-01 -8.8004277684905863e-01 -7.9318236435829081e-02 1.1237622163541742e+01 -8.6276455215573766e-01 -4.7471515962789845e-01 1.7401966774755209e-01 -3.8831979147222050e+01 0 0 0 1

-

-1.9329991389229551e-01 -4.5936396620593831e-03 -9.8112896286058415e-01 2.0588866962445604e+01 4.6795826225734805e-01 -8.7935041471648212e-01 -8.8079015225160595e-02 1.1609538679372809e+01 -8.6235155712407296e-01 -4.7615307056933520e-01 1.7212799107954457e-01 -3.8713065273240730e+01 0 0 0 1

-

-1.9555057622239103e-01 6.4352179042383439e-03 -9.8067250400407147e-01 2.1296361860845600e+01 4.6804699410148587e-01 -8.7813016176712100e-01 -9.9093038642547704e-02 1.1996915138530555e+01 -8.6179578987812089e-01 -4.7837851850326085e-01 1.6870687473535539e-01 -3.8571075949428320e+01 0 0 0 1

-

-1.9732492339794871e-01 2.0358845425756333e-02 -9.8012672242875043e-01 2.2037555255448002e+01 4.6842283724839567e-01 -8.7631157338974441e-01 -1.1250809698574421e-01 1.2397913647530737e+01 -8.6118692520854978e-01 -4.8131439180240676e-01 1.6338156595443237e-01 -3.8470429953892229e+01 0 0 0 1

-

-2.0373722695596486e-01 3.7707836748433143e-02 -9.7829916763740910e-01 2.2855023079038226e+01 4.6820834930460931e-01 -8.7382523309199356e-01 -1.3118842804598296e-01 1.2864675924904017e+01 -8.5980933002250393e-01 -4.8477580494438510e-01 1.6037560583448052e-01 -3.8358428361548306e+01 0 0 0 1

-

-2.3000403807991798e-01 5.9042256464015452e-02 -9.7139701174060067e-01 2.3739534153041031e+01 4.6579297860958269e-01 -8.6972326221525220e-01 -1.6315130474400791e-01 1.3438789435694137e+01 -8.5447939913431803e-01 -4.8999536642023123e-01 1.7253839381934261e-01 -3.8288850590686415e+01 0 0 0 1

I managed to get on XML working by calibrating the cameras. But this dosnt allway seem to work.

commented

hi, i know there are some issues with video frames, like uncalibrated sensors in xml not later used on images, etc, which breaks import, is that your case? from what you pasted i can't make anything. could you send me some example xml?
the box is created on chunk borders.

Hey, thanks for the fast response!
Thats exactly my situation. The images are video frames. I managed to get a XML with camera info early on (from same image set) I then coppied the first section of my XML into the later one wich didnt include camera calibration info. Then I could load the XML.

The Edite XML
test_001.txt

A unedited XML
AGI_UNEDITED.txt

commented

reinstall from repo, now it should be able to import unedited xml (at least the one you provided works), problem was, in calibration data some params (cx, cy) was missing and sensor was skipped and camera without sensor is not created afterwards, so now if no center x, y is found it assumes both 0.0 and continues.
on a side note, there is real specs for xml i know of, so i am fixing it on the go as people notifies me on errors, i used only photo cameras, like canon 5d ii or nikon d800 and those have calibration always with all params. and sensor center is not even used later in blender anyway, could be simulated with camera shift, but effect is minuscule, so it is skipped as well..