tjlane / pypad

Intuitive, high-level interface to the CSPAD
Other
2 stars 1 forks source link

optgeom can't find center if it's too far off initially, add rough center algorithm #30

Closed sellberg closed 11 years ago

sellberg commented 11 years ago

When center is way off initially, as for the AgBe below, the optimization algorithm gets stuck in local minima. Can be solved by adding a rough center algorithm. The easiest way is to include right-clicking on the 2D panel again in prepgeom, a more fancy alternative is to have a button or pre-optimization step where one calculates the center form the hough transform.

BEFORE OPTIMIZATION 8281232a-e418-11e2-8b4d-94020a8d4f12

AFTER OPTIMIZATION screen shot 2013-07-03 at 16 23 18

sellberg commented 11 years ago

@tjlane the center moving works nice in prepgeom, but I don't think optgeom knows about the center shift since it's not saved as a parameter in filter_params.yaml nor is a pypad.CSPad object written to disc that can be loaded to optgeom. when I tried it on AgBe, it seems the center hasn't really moved much from how it was before. Could you double check this please?

screen shot 2013-07-04 at 13 25 06

tjlane commented 11 years ago

@sellberg yep my bad. Just pushed a fix for this so try it again!

sellberg commented 11 years ago

prepgeom still doesn't save the center to filter_params.yaml properly, this is what i find in filter_params.yaml

center_shift:

Also, I don't know if you're aware of this already, but when I run prepgeom and shift the center several times, it records the relative changes, so we would have to keep track on the accumulated center shift separately so we can save it to disk.

tjlane commented 11 years ago

@sellberg I think the behavior would have functioned fine, but agree that is nasty output. Pushed (another) fix.

Try again. The centering should work even w/many updates. It keeps track of the all moves. I added a circle to the quad sketch in optgeom so you can verify.