Forum

Author Topic: Refine marker projection  (Read 2778 times)

paw.wiacek

  • Newbie
  • *
  • Posts: 6
    • View Profile
Refine marker projection
« on: August 28, 2018, 12:53:56 AM »
Hi,

I try to refine marker projection based on detected object and I have problem with "gray" marker.
Below is part of my code with i have problem:

Code: [Select]
print("X0: ", cx0, " Y0: ", cy0)       
                x = cx0-r+int(x0)
                y = cy0-r+int(y0)
                print(x,y)
               
                if not marker.projections[camera]:
                    marker.projection[cameras] = (x,y)
                else:
                    marker.projections[camera].pinned = False
                    marker.projections[camera].coord = (x,y)

After running the script I get this error massege:
2018-08-27 23:50:51 DSC08529.jpg 1 539.4680786132812 251.5263214111328 1
2018-08-27 23:50:58 X:  [50.48421052631579]  Y:  [50.55263157894737]
2018-08-27 23:50:58 X:  [50.48421052631579, 50.45192307692308]  Y:  [50.55263157894737, 50.5]
2018-08-27 23:50:58 X0:  50.468066801619436  Y0:  50.526315789473685
2018-08-27 23:50:58 539.4680668016194 251.5263157894737
2018-08-27 23:50:58 DSC08529.jpg 2 1048.563330581163 341.03611680963195 0
2018-08-27 23:50:59 X:  [50.39772727272727]  Y:  [50.65909090909091]
2018-08-27 23:50:59 X:  [50.39772727272727, 50.41801801801801]  Y:  [50.65909090909091, 50.71171171171171]
2018-08-27 23:50:59 X:  [50.39772727272727, 50.41801801801801, 50.457749011147065]  Y:  [50.65909090909091, 50.71171171171171, 50.808342322905425]
2018-08-27 23:50:59 X:  [50.39772727272727, 50.41801801801801, 50.457749011147065, 50.517489711934154]  Y:  [50.65909090909091, 50.71171171171171, 50.808342322905425, 50.75617283950617]
2018-08-27 23:50:59 X0:  50.43788351458254  Y0:  50.73394227560894
2018-08-27 23:50:59 1048.4378835145826 341.7339422756089
2018-08-27 23:50:59 Traceback (most recent call last):
2018-08-27 23:50:59   File "C:/Users/PaweĹ‚/Documents/Agisoft python scripts/detect_circles_blob3.py", line 75, in <module>
2018-08-27 23:50:59 TypeError: invalid item value
2018-08-27 23:50:59 Error: invalid item value

paw.wiacek

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Refine marker projection
« Reply #1 on: August 31, 2018, 04:26:47 PM »
In case anyone will have the same problem solution is:

Code: [Select]
marker.projections[camera] = PhotoScan.Marker.Projection((x,y), True)

dyoung

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Refine marker projection
« Reply #2 on: November 25, 2019, 05:20:00 AM »
Thank you; this just saved me!