Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retina broken log polar WIP #721

Open
wants to merge 10 commits into
base: retina_encoder
Choose a base branch
from
Open

Conversation

breznak
Copy link
Member

@breznak breznak commented Oct 22, 2019

WIP PR, I made some cleanups,improvements to the PR, but broke scaling/logpolar.

What I'd like to do is use Retina's useLogSampling, but imho that unfortunately

  • does not do logpolar transformation (only log scaling?)
  • does not allow to set center&diameter of fovea

Our current approach is neither ideal,

  • we have to crop to ROI

  • I'd like to re-center the image to given center (& fov. diameter)

    • then apply log polar to all of the image
    • then apply log-scale reduction as is in Retina (so parts further from fovea become blurred, encoded with lesser precision)
  • What is the difference for self.scale and self.scale_fovea ?

    • is scaling working properly, incl plots?

Follow up to #691

instead of doing it manually
replace self.output_diameter with self.retina.getOutputSize()
replace self.retina_diameter with self.retina.getInputSize()
require same dims for all images
make new_image_() a static method, used internally by compute()
TODO avoid that, work with rectangles?
This reverts commit 40dd4b30781c96f8b5bae9545f258c73e75592ce.
Copy link
Member Author

@breznak breznak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @ctrl-z-9000-times please have a look at these, and esp the issues in this PR's description, thank you.

self.resolution_factor = 3
self.retina_diameter = int(self.resolution_factor * output_diameter)
# Argument fovea_scale ... represents "zoom" aka distance from the object/image.
self.fovea_scale = 0.177
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fovea_scale vs self.scale?

self.scale = 1.0


def new_image_(image):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now static, rename to read_image?

center = self.retina_diameter / 2
M = self.retina_diameter * self.fovea_scale
center = self.retina.getInputSize()[0] / 2
M = self.retina.getInputSize()[0] * self.scale
if self.parvo_enc is not None:
parvo = cv2.logPolar(parvo,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we apply the logPolar only in the Channel encoder? Bcs that one expects its data in that form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant