Ellipse Detection/Localization

In this article I’ll discuss multiple ways to localize an ellipse in an image.

“DUAL CONIC” method

This method is from Hebert09. I think it’s akin to the “opencv” checker localization algorithm in that it’s a linear algorithm that operates on the image gradients.

Anyway, to understand this method, you need to understand what a conic section is. A conic section is a curve obtained as the intersection of the surface of a cone with a plane. The possible conic sections are a hyperbola, parabola, and ellipse. It turns out that a conic can be represented as a matrix:

 [Aq]=  \begin{bmatrix} A & B/2 & D/2 \\ B/2 & C & E/2 \\ D/2 & E/2 & F \end{bmatrix}

and points, represented in homogeneous coordinates as \vec{x} = [x\  y\  z]^T , lie on the conic if:

\vec{x}^T [Aq]\vec{x} = 0

Continue reading “Ellipse Detection/Localization”

Checker Detection/Localization

In this article I’ll discuss multiple ways to localize a checker in an image.

“opencv” method

The opencv method is the defacto standard for checker localization. It’s fast, robust, accurate and is the checker localization algorithm used in Bouguet’s camera calibration toolbox. It is based on the observation that a vector with its tail at the center of a checker and the tip in a region around a checker should always have a zero dot product with the intensity gradient located at the tip of the vector:

Note that the example figures in this section are for a corner, but the same holds for a checker. Anyway:

  • in “flat” regions: <\nabla I(\vec{p}),\vec{p}-\vec{q}> = 0
  • in edge regions: <\nabla I(\vec{p}),\vec{p}-\vec{q}> = 0

Continue reading “Checker Detection/Localization”

b0 to T1 atlas coregistration with FSL and ANTS

In this post, I’ll demonstrate how to coregister a b0 (non diffusion weighted EPI image) to a T1 weighted atlas.

Tools and files used in this article:

b0_atlas_coreg_inputs.zip contains a T1 and b0 from the same subject, as well as a T1 weighted MNI atlas, all in the nifti format.

Continue reading “b0 to T1 atlas coregistration with FSL and ANTS”

T1 intensity normalization with FreeSurfer

In this post, I’ll demonstrate how to perform a minimal FreeSurfer based T1 intensity normalization pipeline. It’s very simple, but can be daunting if you’ve never used FreeSurfer before.

Tools and files used in this article:

T1.nii.gz is an HCP T1 weighted image and the version of FreeSurfer used is freesurfer-x86_64-unknown-linux-gnu-stable6-20170118.

Continue reading “T1 intensity normalization with FreeSurfer”