27 #ifndef improc_circleOuterpix_hpp
28 #define improc_circleOuterpix_hpp
55 template<
typename realT>
67 circ.resize(masked.rows(), masked.cols());
72 for(
size_t i=0; i< masked.rows(); ++i)
80 for(
size_t j=0; j<masked.cols(); ++j)
97 if(nj != -1) circ(i,nj) = 1;
98 if(pj != -1) circ(i,pj) = 1;
101 for(
size_t j=0; j< masked.cols(); ++j)
109 for(
size_t i=0; i<masked.rows(); ++i)
126 if(ni != -1) circ(ni,j) = 1;
127 if(
pi != -1) circ(
pi,j) = 1;
134 for(
size_t i = 0; i < masked.rows(); ++i)
136 for(
size_t j = 0; j < (size_t) masked.cols(); ++j)
152 for(
size_t i = 0; i < (size_t) circ.rows(); ++i)
154 for(
size_t j = 0; j < (size_t) circ.cols(); ++j)
158 avgr += sqrt( pow(i-avgx,2) + pow(j-avgy,2));
159 avgr0 += sqrt( pow(i-x0,2) + pow(j-y0,2));
Tools for using the eigen library for image processing.
Eigen::Array< scalarT, -1, -1 > eigenImage
Definition of the eigenImage type, which is an alias for Eigen::Array.
constexpr T pi()
Get the value of pi.
int circleOuterpix(realT &x0, realT &y0, realT &avgr0, realT &avgx, realT &avgy, realT &avgr, eigenImage< realT > &circ, const eigenImage< realT > &masked)
Find the center and the outermost pixels of a circular mask, giving an estimate of the radius.
int imageCenterOfLight(typename imageT::Scalar &x, typename imageT::Scalar &y, const imageT &im)
Calculate the center of light of an image.
Header for the image processing utilities.