I have some digital camera images (Nikon D100 with 28 mm lens) that have some
lens distortion which I would like to correct for (see link below for two examples). Visible in the images are vertical (mostly) lines spaced at 5cm intervals, could these lines be used in a correction macro? http://www.geog.ubc.ca/~dsluzi/ImageJ/ thanks, dave |
We use Photoshop to correct images before measuring them. Lens distortion
implies barrel or pincushion distortion (for which Photoshop has correction tools at Filters/Lens Correction) whereas Dave's pictures seem to have some rectilinear distortion caused by the camera not being normal to the surface being photographed. A perspective crop in Photoshop should correct that if there are enough reference points to establish rectilinearity. The corrected image can then be measured in ImageJ. __________________________________ Tom Gore | Advanced Imaging Laboratory Department of Biology | University of Victoria Box 3020 Station CSC Victoria BC V8W 3N5 Canada voice 250 721 7134 fax 250 721 7120 website http://web.uvic.ca/ail/ -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Dave Luzi Sent: November 16, 2010 12:35 PM To: [hidden email] Subject: Image distortion correction I have some digital camera images (Nikon D100 with 28 mm lens) that have some lens distortion which I would like to correct for (see link below for two examples). Visible in the images are vertical (mostly) lines spaced at 5cm intervals, could these lines be used in a correction macro? http://www.geog.ubc.ca/~dsluzi/ImageJ/ thanks, dave |
In reply to this post by lutzo
2010/11/16 Dave Luzi <[hidden email]>:
> I have some digital camera images (Nikon D100 with 28 mm lens) that have some > lens distortion which I would like to correct for (see link below for two > examples). Visible in the images are vertical (mostly) lines spaced at 5cm > intervals, could these lines be used in a correction macro? If you take from 5 to 9 heavily overlapping images, and them compute the lens correction for that magnification of your camera, then you'll always be able to correct the distortion for any further images: http://pacific.mpi-cbg.de/wiki/index.php/Distortion_correction See in particular the PDF manual in the URL. Albert -- http://albert.rierol.net |
In reply to this post by Tom Gore
2010/11/16 Tom Gore <[hidden email]>:
> We use Photoshop to correct images before measuring them. Lens distortion > implies barrel or pincushion distortion (for which Photoshop has correction > tools at Filters/Lens Correction) whereas Dave's pictures seem to have some > rectilinear distortion caused by the camera not being normal to the surface > being photographed. A perspective crop in Photoshop should correct that if > there are enough reference points to establish rectilinearity. The > corrected image can then be measured in ImageJ. If it's perspective you'd like to correct, there's the "Plugins - Transform - Interactive Perspective", where the perspective of an image can be interactively altered. http://pacific.mpi-cbg.de/wiki/index.php/Interactive_Perspective To automate the correction of perspective, you'd need a reference image, then "Extract SIFT correspondences", then use "Landmark correspondences" to compute an affine transformation model. Albert -- http://albert.rierol.net |
In reply to this post by Albert Cardona-2
Hi Albert and Dave,
> If you take from 5 to 9 heavily overlapping images, and them compute > the lens correction for that magnification of your camera, then you'll > always be able to correct the distortion for any further images: > > http://pacific.mpi-cbg.de/wiki/index.php/Distortion_correction > > See in particular the PDF manual in the URL. > This is not appropriate in the given setting because the model for camera movement in the Distortion correction Plugin is shift in the image plane and roll (rotation around the camera axis) whereas, in the given images, the camera tilts and pans (at least) and thus introduces perspective transformation. To my knowledge, there is no appropriate user interface and algorithm implemented for ImageJ/Fiji yet that would handle this situation properly. Have a look at the PanoTools and Hugin for that, it might give you the required toolkit. A similar question was discussed in 2009 where you can find the respective Links and a nice tutorial: http://imagej.588099.n2.nabble.com/Image-distortion-td2664325.html Best, Stephan |
In reply to this post by lutzo
Hi Albert, Dave and Stephan,
a while ago I built a plugin writing and reading to the zhang calibration tool. This tool will give you back the intrinsic camera parameters. Maybe of interest for you. So take a look at http://www.stierlen2.homepage.t-online.de/modellbau/3dscanner/scanner-eng.html http://www.stierlen2.homepage.t-online.de/modellbau/3dscanner/optic_calib.htm The tools work fine for my purpose. The only thing I am still working on is a IAI linear axle (ebay snip) which I plan to control with an arduino Uno. First tests with a JControl were not a 100% success. Best regards Peter |
I am interested in measuring the quantity of a specific stain in tissue
sections on microscope slides.I m considering using histograms of pixel gray levels, and equations relating to Beers law to estimate the relative amount of stain in different samples.Are there established procedures for doing this with ImageJ?Does anyone have an opinion on the accuracy of this procedure, or whether there are better ways to compare the amounts of stain?Using thresholding to measure areas at a specific level of staining may not be appropriate for this study. Ralph Common |
On Wednesday 17 November 2010 01:04:55 Ralph Common wrote:
> I am interested in measuring the quantity of a specific stain in tissue > sections on microscope slides.I m considering using histograms of pixel > gray levels, and equations relating to Beers law to estimate the > relative amount of stain in different samples. Unless the staining is stoichiometric (and virtually all of them are not) and one controls the section thickness very accurately, this will not be robust at all. Feulgen stain is stoichiometric, but most of the routine histology and immunostains are not. Regards Gabriel |
In reply to this post by lutzo
Thanks, Tom, Albert, Stephan and Peter for your time and advice. Tom, I do not have PS, but maybe can find a copy at school.
Peter, should have looked at your site earlier. The first part of my experiment was producing 3d images from 5 lasers mounted on a cart. I ended up using labview to convert pixel to real world values, but the distortion (perspective distortion?) algorithm was not very robust. I have examples of the calibration images as well as the laser one at the link below. Any thoughts would be appreciated. You can also email directly if you have additional questions http://www.geog.ubc.ca/~dsluzi/ImageJ/LaserScan/ |
In reply to this post by lutzo
Hello all,
I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack to RGB feature. When I have a 2D image (one z plane) output is fine, but when I have multiple z-planes the output is scrambled. Whichever slice is displayed when I choose "Image5D Stack to RGB" is the first in the resulting z-stack, and parts of some stacks are mixed with others, so the top half of the image will change, but not the bottom. This bug was reported in Oct 2009, but I didn't see a clear solution posted other than the Image5D 1.2.1 build released by Joachim Walter. I tried this, and it fixed the extra, non-functional z-scroll bar, but not the scrambled RGB Z-stack output. Systems: ImageJ 1.44i or Fiji with Windows XP 32-bit or Windows 7 32-bit or 64-bit -- all using either Image5D or the new Image5D 1.2.1. What am I doing wrong? I would be happy to send a sample stack if that would be helpful. Thanks! Christine |
Hi Christine,
Really sorry for the long delay in my reply. I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack > to RGB feature. When I have a 2D image (one z plane) output is fine, but > when I have multiple z-planes the output is scrambled. Whichever slice is > displayed when I choose "Image5D Stack to RGB" is the first in the resulting > z-stack, and parts of some stacks are mixed with others, so the top half of > the image will change, but not the bottom. > Unfortunately, in my brief testing I was unable to duplicate the issue (ImageJ 1.44j, OS X 10.6.5, Image5D 1.2.1). First I opened a sample RGB Z-series using File > Open Samples > Fly Brain. Then I converted it to Image5D using Plugins > Image5D > RGB to Image5D, accepting the default values, which were correct. The resultant Image5D window displayed the data correctly. I was then able to create a new RGB image stack using Plugins > Image5D > Image5D Stack to RGB, which looked identical to the image planes displayed in the Image5D window. What am I doing wrong? I would be happy to send a sample stack if that > would be helpful. Thanks! > Are you able to duplicate the error with any of the sample datasets available from the Open Samples menu? If so, can you describe the steps that produce the problem? If the problem is only with one of your datasets, let me know and I can provide you with a server for uploading the data. Thanks, Curtis On Thu, Nov 18, 2010 at 12:32 PM, Christine Labno <[hidden email] > wrote: > Hello all, > > I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack > to RGB feature. When I have a 2D image (one z plane) output is fine, but > when I have multiple z-planes the output is scrambled. Whichever slice is > displayed when I choose "Image5D Stack to RGB" is the first in the resulting > z-stack, and parts of some stacks are mixed with others, so the top half of > the image will change, but not the bottom. > > This bug was reported in Oct 2009, but I didn't see a clear solution posted > other than the Image5D 1.2.1 build released by Joachim Walter. I tried > this, and it fixed the extra, non-functional z-scroll bar, but not the > scrambled RGB Z-stack output. > > Systems: ImageJ 1.44i or Fiji with Windows XP 32-bit or Windows 7 32-bit or > 64-bit -- all using either Image5D or the new Image5D 1.2.1. > > What am I doing wrong? I would be happy to send a sample stack if that > would be helpful. Thanks! > > Christine > |
Hi Curtis,
No worries about the delay, we can get the results we need with either hyperstack functions or image calculator. I only get the error with stacks of >3 color channels. The fly brain red/green RGB stack or the neurons 5 channel / 2D image both work just fine for me too. The only sample image I can use to reproduce the error is the Organ of Corti sample converted from hyperstack to stack. Unfortunately there isn't much change over the volume so it doesn't make for a very dramatic example. If you pull through the result quickly all looks OK, but compare the three spheres in the upper righthand corner of the object frame by frame. For added fun, before you run Image5D Stack to RGB, set the Image5D display to the last channel (or any channel other than 1). This frame will always be the first frame of the resulting RGB stack. The next frame should be frame 1, or half of frame 15 and half frame 1. Again this only happens with stacks of >4 color channels. I can get the fly brain sample to produce the error, but only if I do something really contrived: Open it, split the color channels so you have three stacks (blue is empty). Duplicate all z-planes of both the red and the green stacks. Concatenate green, red, green-1 and red-1 to make, in essence, a 4 color channel z-stack with 3rd dim = z (57) and 4th dim = c (4). There is more change over z here, so the effect of the bug is more dramatic. If you email me your FTP off list, I'll upload one of our test .tiff stacks and/or the Slidebook files they were exported from. With those there is no doubt something is not right. ---- Original message ---- >Date: Fri, 3 Dec 2010 14:36:25 -0600 >From: ImageJ Interest Group <[hidden email]> (on behalf of Curtis Rueden <[hidden email]>) >Subject: Re: Image5D Stack to RGB (old z-stack bug?) >To: <[hidden email]> > >Hi Christine, > >Really sorry for the long delay in my reply. > >I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack >> to RGB feature. When I have a 2D image (one z plane) output is fine, but >> when I have multiple z-planes the output is scrambled. Whichever slice is >> displayed when I choose "Image5D Stack to RGB" is the first in the resulting >> z-stack, and parts of some stacks are mixed with others, so the top half of >> the image will change, but not the bottom. >> > >Unfortunately, in my brief testing I was unable to duplicate the issue >(ImageJ 1.44j, OS X 10.6.5, Image5D 1.2.1). > >First I opened a sample RGB Z-series using File > Open Samples > Fly Brain. >Then I converted it to Image5D using Plugins > Image5D > RGB to Image5D, >accepting the default values, which were correct. The resultant Image5D >window displayed the data correctly. I was then able to create a new RGB >image stack using Plugins > Image5D > Image5D Stack to RGB, which looked >identical to the image planes displayed in the Image5D window. > >What am I doing wrong? I would be happy to send a sample stack if that >> would be helpful. Thanks! >> > >Are you able to duplicate the error with any of the sample datasets >available from the Open Samples menu? If so, can you describe the steps that >produce the problem? If the problem is only with one of your datasets, let >me know and I can provide you with a server for uploading the data. > >Thanks, >Curtis > >On Thu, Nov 18, 2010 at 12:32 PM, Christine Labno <[hidden email] >> wrote: > >> Hello all, >> >> I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack >> to RGB feature. When I have a 2D image (one z plane) output is fine, but >> when I have multiple z-planes the output is scrambled. Whichever slice is >> displayed when I choose "Image5D Stack to RGB" is the first in the resulting >> z-stack, and parts of some stacks are mixed with others, so the top half of >> the image will change, but not the bottom. >> >> This bug was reported in Oct 2009, but I didn't see a clear solution posted >> other than the Image5D 1.2.1 build released by Joachim Walter. I tried >> this, and it fixed the extra, non-functional z-scroll bar, but not the >> scrambled RGB Z-stack output. >> >> Systems: ImageJ 1.44i or Fiji with Windows XP 32-bit or Windows 7 32-bit or >> 64-bit -- all using either Image5D or the new Image5D 1.2.1. >> >> What am I doing wrong? I would be happy to send a sample stack if that >> would be helpful. Thanks! >> >> Christine >> |
Hi Christine,
Image5D 1.2.2, released today, fixes a bug in the "Image5D Stack to RGB" command where each image plane was not fully repainted before converting to RGB—hence the strange behavior such as image tearing and incorrect planar data. You can download the new release from: http://imagejdev.org/plugins/image5d Please let me know how it works for you. -Curtis On Fri, Dec 3, 2010 at 6:30 PM, Christine Labno <[hidden email]>wrote: > Hi Curtis, > > No worries about the delay, we can get the results we need with either > hyperstack functions or image calculator. > > I only get the error with stacks of >3 color channels. The fly brain > red/green RGB stack or the neurons 5 channel / 2D image both work just fine > for me too. > > The only sample image I can use to reproduce the error is the Organ of > Corti sample converted from hyperstack to stack. Unfortunately there isn't > much change over the volume so it doesn't make for a very dramatic example. > > If you pull through the result quickly all looks OK, but compare the three > spheres in the upper righthand corner of the object frame by frame. > > For added fun, before you run Image5D Stack to RGB, set the Image5D display > to the last channel (or any channel other than 1). This frame will always > be the first frame of the resulting RGB stack. The next frame should be > frame 1, or half of frame 15 and half frame 1. Again this only happens with > stacks of >4 color channels. > > I can get the fly brain sample to produce the error, but only if I do > something really contrived: Open it, split the color channels so you have > three stacks (blue is empty). Duplicate all z-planes of both the red and > the green stacks. Concatenate green, red, green-1 and red-1 to make, in > essence, a 4 color channel z-stack with 3rd dim = z (57) and 4th dim = c > (4). There is more change over z here, so the effect of the bug is more > dramatic. > > If you email me your FTP off list, I'll upload one of our test .tiff stacks > and/or the Slidebook files they were exported from. With those there is no > doubt something is not right. > > ---- Original message ---- > >Date: Fri, 3 Dec 2010 14:36:25 -0600 > >From: ImageJ Interest Group <[hidden email]> (on behalf of Curtis > Rueden <[hidden email]>) > >Subject: Re: Image5D Stack to RGB (old z-stack bug?) > >To: <[hidden email]> > > > >Hi Christine, > > > >Really sorry for the long delay in my reply. > > > >I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack > >> to RGB feature. When I have a 2D image (one z plane) output is fine, > but > >> when I have multiple z-planes the output is scrambled. Whichever slice > is > >> displayed when I choose "Image5D Stack to RGB" is the first in the > resulting > >> z-stack, and parts of some stacks are mixed with others, so the top half > of > >> the image will change, but not the bottom. > >> > > > >Unfortunately, in my brief testing I was unable to duplicate the issue > >(ImageJ 1.44j, OS X 10.6.5, Image5D 1.2.1). > > > >First I opened a sample RGB Z-series using File > Open Samples > Fly > Brain. > >Then I converted it to Image5D using Plugins > Image5D > RGB to Image5D, > >accepting the default values, which were correct. The resultant Image5D > >window displayed the data correctly. I was then able to create a new RGB > >image stack using Plugins > Image5D > Image5D Stack to RGB, which looked > >identical to the image planes displayed in the Image5D window. > > > >What am I doing wrong? I would be happy to send a sample stack if that > >> would be helpful. Thanks! > >> > > > >Are you able to duplicate the error with any of the sample datasets > >available from the Open Samples menu? If so, can you describe the steps > that > >produce the problem? If the problem is only with one of your datasets, let > >me know and I can provide you with a server for uploading the data. > > > >Thanks, > >Curtis > > > >On Thu, Nov 18, 2010 at 12:32 PM, Christine Labno < > [hidden email] > >> wrote: > > > >> Hello all, > >> > >> I'm trying to create 4 color z-stacks with Image5D using the Image5D > Stack > >> to RGB feature. When I have a 2D image (one z plane) output is fine, > but > >> when I have multiple z-planes the output is scrambled. Whichever slice > is > >> displayed when I choose "Image5D Stack to RGB" is the first in the > resulting > >> z-stack, and parts of some stacks are mixed with others, so the top half > of > >> the image will change, but not the bottom. > >> > >> This bug was reported in Oct 2009, but I didn't see a clear solution > posted > >> other than the Image5D 1.2.1 build released by Joachim Walter. I tried > >> this, and it fixed the extra, non-functional z-scroll bar, but not the > >> scrambled RGB Z-stack output. > >> > >> Systems: ImageJ 1.44i or Fiji with Windows XP 32-bit or Windows 7 32-bit > or > >> 64-bit -- all using either Image5D or the new Image5D 1.2.1. > >> > >> What am I doing wrong? I would be happy to send a sample stack if that > >> would be helpful. Thanks! > >> > >> Christine > >> > |
Hi Curtis,
Image5D 1.2.2 fixes my problem! The Organ of Corti example and my samples of >3 colors convert from Image5D to RGB without the choppy, half created frames. Flybrain and neurons sample images still work too. Thanks for getting to this so quickly! Christine ---- Original message ---- >Date: Wed, 8 Dec 2010 13:44:29 -0600 >From: ImageJ Interest Group <[hidden email]> (on behalf of Curtis Rueden <[hidden email]>) >Subject: Re: Image5D Stack to RGB (old z-stack bug?) >To: <[hidden email]> > >Hi Christine, > >Image5D 1.2.2, released today, fixes a bug in the "Image5D Stack to RGB" >command where each image plane was not fully repainted before converting to >RGB—hence the strange behavior such as image tearing and incorrect planar >data. > >You can download the new release from: > http://imagejdev.org/plugins/image5d > >Please let me know how it works for you. > >-Curtis > >On Fri, Dec 3, 2010 at 6:30 PM, Christine Labno ><[hidden email]>wrote: > >> Hi Curtis, >> >> No worries about the delay, we can get the results we need with either >> hyperstack functions or image calculator. >> >> I only get the error with stacks of >3 color channels. The fly brain >> red/green RGB stack or the neurons 5 channel / 2D image both work just fine >> for me too. >> >> The only sample image I can use to reproduce the error is the Organ of >> Corti sample converted from hyperstack to stack. Unfortunately there isn't >> much change over the volume so it doesn't make for a very dramatic example. >> >> If you pull through the result quickly all looks OK, but compare the three >> spheres in the upper righthand corner of the object frame by frame. >> >> For added fun, before you run Image5D Stack to RGB, set the Image5D display >> to the last channel (or any channel other than 1). This frame will always >> be the first frame of the resulting RGB stack. The next frame should be >> frame 1, or half of frame 15 and half frame 1. Again this only happens with >> stacks of >4 color channels. >> >> I can get the fly brain sample to produce the error, but only if I do >> something really contrived: Open it, split the color channels so you have >> three stacks (blue is empty). Duplicate all z-planes of both the red and >> the green stacks. Concatenate green, red, green-1 and red-1 to make, in >> essence, a 4 color channel z-stack with 3rd dim = z (57) and 4th dim = c >> (4). There is more change over z here, so the effect of the bug is more >> dramatic. >> >> If you email me your FTP off list, I'll upload one of our test .tiff stacks >> and/or the Slidebook files they were exported from. With those there is no >> doubt something is not right. >> >> ---- Original message ---- >> >Date: Fri, 3 Dec 2010 14:36:25 -0600 >> >From: ImageJ Interest Group <[hidden email]> (on behalf of Curtis >> Rueden <[hidden email]>) >> >Subject: Re: Image5D Stack to RGB (old z-stack bug?) >> >To: <[hidden email]> >> > >> >Hi Christine, >> > >> >Really sorry for the long delay in my reply. >> > >> >I'm trying to create 4 color z-stacks with Image5D using the Image5D Stack >> >> to RGB feature. When I have a 2D image (one z plane) output is fine, >> but >> >> when I have multiple z-planes the output is scrambled. Whichever slice >> is >> >> displayed when I choose "Image5D Stack to RGB" is the first in the >> resulting >> >> z-stack, and parts of some stacks are mixed with others, so the top half >> of >> >> the image will change, but not the bottom. >> >> >> > >> >Unfortunately, in my brief testing I was unable to duplicate the issue >> >(ImageJ 1.44j, OS X 10.6.5, Image5D 1.2.1). >> > >> >First I opened a sample RGB Z-series using File > Open Samples > Fly >> Brain. >> >Then I converted it to Image5D using Plugins > Image5D > RGB to Image5D, >> >accepting the default values, which were correct. The resultant Image5D >> >window displayed the data correctly. I was then able to create a new RGB >> >image stack using Plugins > Image5D > Image5D Stack to RGB, which looked >> >identical to the image planes displayed in the Image5D window. >> > >> >What am I doing wrong? I would be happy to send a sample stack if that >> >> would be helpful. Thanks! >> >> >> > >> >Are you able to duplicate the error with any of the sample datasets >> >available from the Open Samples menu? If so, can you describe the steps >> that >> >produce the problem? If the problem is only with one of your datasets, let >> >me know and I can provide you with a server for uploading the data. >> > >> >Thanks, >> >Curtis >> > >> >On Thu, Nov 18, 2010 at 12:32 PM, Christine Labno < >> [hidden email] >> >> wrote: >> > >> >> Hello all, >> >> >> >> I'm trying to create 4 color z-stacks with Image5D using the Image5D >> Stack >> >> to RGB feature. When I have a 2D image (one z plane) output is fine, >> but >> >> when I have multiple z-planes the output is scrambled. Whichever slice >> is >> >> displayed when I choose "Image5D Stack to RGB" is the first in the >> resulting >> >> z-stack, and parts of some stacks are mixed with others, so the top half >> of >> >> the image will change, but not the bottom. >> >> >> >> This bug was reported in Oct 2009, but I didn't see a clear solution >> posted >> >> other than the Image5D 1.2.1 build released by Joachim Walter. I tried >> >> this, and it fixed the extra, non-functional z-scroll bar, but not the >> >> scrambled RGB Z-stack output. >> >> >> >> Systems: ImageJ 1.44i or Fiji with Windows XP 32-bit or Windows 7 32-bit >> or >> >> 64-bit -- all using either Image5D or the new Image5D 1.2.1. >> >> >> >> What am I doing wrong? I would be happy to send a sample stack if that >> >> would be helpful. Thanks! >> >> >> >> Christine >> >> >> |
Free forum by Nabble | Edit this page |