[Gambas-user] Magnify 0.0.8

richard terry rterry at ...1946...
Thu Apr 21 00:11:02 CEST 2011


On Thursday 21 April 2011 04:20:35 Matti wrote:
> Hi Shane and Richard (and whoever, didn't follow the conversation),
> 
> this is a nice idea!
> 
> After trying it just once with a few images, a question: The lens
>  magnifies, but definitely doesn't show the original size of the image. My
>  test images are about 3200x2400, and your lens shows about 2/3 of the
>  original size.
> Is this a planned behaviour?

The problem is that (with my lack of logic) there's been no proper 
implementation of the magnification.  Its much harder than you think.
I think the current version 0.0.8 problem is that it is only magnifiying the 
image from the scaled image once loaded, and not the original, hence the 
detail blurs as you magnify.

I sat down last night and tried a version which keep the original image in 
memory as an image, and then tried to calculate the start point of the zoom 
onn the original image, but got into a hell of a mess, it nearly did my head 
in!.

After going to sleep on it I realised that to once you have the magnifier in 
action, that to start say with mag=1, you have to take into account the ratio 
of the  scaled image to the original real image - for example if the scaled 
down image was 4 units in area and the original 8 units in area, then to put 
into the circle on the screen the same info as already there from the 
original, the sampling size on the orginal would have to be twice as big.  As 
you magnify, the sample size on the original then gets smaller and smaller, 
but the information is then displayed in the same size circle on the scaled 
image, hence it is magnified.

I sort of tried this last night and got really high definition magnification in 
the circle  (for example I could read the number plate on a car which was 
reasonably small in the original picture), whearas on 0.0.8, the whole thing 
was a blurr.

So, me - not a mathematitian but that's my take on it, and Yes, I'd be happy 
to collaborate.

It may be of interest to you, and this does work well, though I'm not sure how 
I would disentangle it from my medical records project, but I've got a great 
combination of the image editor + webcam form  with lots of enhancements I 
need, - I use it to take pictures of patients (for ID for their file) and to 
take macro pictures of skin lesions, which I then just shove into their 
progress notes, plus use it to insert line diagrams of for eg head, face, 
nose, abdo, draw on them to indicat e the site of a skin lesion to excise etc, 
then insert it into their progress notes. I tracked down a cute little macro-
webcam - IPEVO2 I think it was - after finding even an expensive logitech 
wouldn't do the job. This webcam is a bit finickyi because the auto-focus hunts 
a bit under my fluro lights if the subject moves, but with an additional light 
source it works fine. I can even hold it up next to the Xray box and take 
really quite good shots of  a section of an Xray!!!!

I'll take a look at your project over easter and we can all keep in touch.

Regards

Richard



> 
> Another question:
> I'm working on an image viewer example for Gambas3.
> What do you think about joining the projects, putting your magnifying glass
> somewhere (Zoom menu probably) into the viewer as a menu item?
> I didn't read your code and don't know if it could be integrated easily,
>  but why not.
> I just like the idea of having this option in the viewer, instead of having
>  two different examples.
> 
> So, have a look at my project and tell me what you think.
> Don't complain about bugs! There have been some big changes, and a lot of
>  the code isn't fixed yet.
> 
> Regards
> Matti
> 




More information about the User mailing list