linan7788626 / Hoopla

MIT License
1 stars 2 forks source link

Provide image URL, pre-process images, correct registration #1

Open drphilmarshall opened 8 years ago

drphilmarshall commented 8 years ago

I think we want to be able to pass in an image URL as well as upload a file - many of our images will be on the web.

linan7788626 commented 8 years ago

Yes. Actually , the default image is loaded in via its URL, so I think this issue will be fixed in next week.

drphilmarshall commented 8 years ago

Cool! :-) This will enable Space Warps users to investigate their finds.

On Sun, Sep 11, 2016 at 8:54 PM, Nan Li notifications@github.com wrote:

Yes. Actually , the default image is loaded in via its URL, so I think this issue will be fixed in next week.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/linan7788626/LensWranglerPlusPlus/issues/1#issuecomment-246237981, or mute the thread https://github.com/notifications/unsubscribe-auth/AArY9yKBG6ZxinTCVLSCxuFaMDH4ieuZks5qpM0PgaJpZM4J5PiC .

linan7788626 commented 8 years ago

This issue has been fixed. I just added a textbox and a button to upload images via URL (please see the image below).

screen shot 2016-09-12 at 1 51 10 pm

But it leads to another problem: now I am using 400*400 images in LW++, and angular pixel size is set to be 0.0225 arcsecs. If we want to upload images via URL and model it correctly, we need to preprocess the image first.

drphilmarshall commented 8 years ago

I see something odd when loading in this image: the "Source Plane" and "Image Plane" panel images are registered differently to the "Mass Model" one, so that the caustics appear in the wrong place.

image

(BTW this image illustrates my concern about the "Source Model" panel - the only thing that we should be doing there is controlling the size, ellipticity, and orientation of each source component, and their positions relative to each other. The moving cursor in the "Source Plane" panel and the click placed in the "Image Plane" panel should determine the position of the whole source model relative to the lens. I think this means we want the "Source Model" panel to have no image background (which makes sense anyway, because the JPG image belongs in the image plane!), only source components and a central cyan cross. This cross would correspond to the click placed on the "Image Plane" panel (to mark the center of one multiple image) and to the cursor position in the "Source Plane" panel.)

linan7788626 commented 8 years ago

The odd thing is because of the issue I mentioned in my reply, the picture dimension of the uploaded image is 467_467. However, the dimension of the blocks are 400_400, so we need to preprocess an input image with arbitrary size (for example, rescale it). You can see that the pictures in the top panels are rescaled, but the pictures in the bottom panels are not rescaled, so the center of the lens is shifted. I am working on it now.

In term of the source model, we can only sample one source now, so even though you drew two ellipses, the APP will present the first source only. I am thinking about controlling the sources in a similar way as controlling the lenses. Controlling the sources separately might be a more sensible way than controlling them together, because of its flexibility. Please let me know your thoughts about the new strategy. Thanks.

Removing the background image of the source model block makes sense to me, I will try to make it, but if we would like to control sources separately, a cyan cross and caustics might be both necessary.

drphilmarshall commented 8 years ago

Agreed - more thoughts in #4. Good idea to stick wth one source for now, but I think with the image plane positioning we will need the concept of a "primary source component" to go with that of an image plane "anchor position". For sanity you may want to disable the drawing of new ellipses in the source model, and force the user to work with the one they are given. I can't remember if such an action is easy though :-)

linan7788626 commented 8 years ago

Disabling the drawing of new ellipses is a sensible option. I will try to make it. BTW, I expect that you will recall if it is easy, and instruct me how to do it. :-) Thanks.