Пример #1
0
void CDog::setResponse(const float sigma, vector<vector<float>>& res)
{
	vector<float> gauss;
	setGaussI(sigma, gauss);
  
	vector<vector<cv::Vec3f> > vvftmp;
	vvftmp.resize((int)m_image.size());
	for (int y = 0; y < (int)m_image.size(); ++y)
		vvftmp[y].resize((int)m_image[y].size());

	//求一阶导
	vector<vector<cv::Vec3f> > restmp = m_image;
	convolveX(restmp, m_mask, gauss, vvftmp);
	convolveY(restmp, m_mask, gauss, vvftmp);

	res.resize((int)m_image.size());
	for (int y = 0; y < (int)m_image.size(); ++y) 
	{
		res[y].resize((int)m_image[y].size());
		for (int x = 0; x < (int)m_image[y].size(); ++x)
			res[y][x] = norm(restmp[y][x]); //对应点的一阶导(向量)的模
	}
}
Пример #2
0
	bool Kernel<T, U>::Convolve1D_X(const Image<T>& iImage, Image<U>& oImage) const
	{
		return convolveX(iImage, oImage);
	}