added sobel kernel for image gradient calcualtion
This commit is contained in:
@ -1312,8 +1312,13 @@ void MsckfVio::PhotometricMeasurementJacobian(
|
||||
|
||||
// calculate derivation for anchor frame, use position for derivation calculation
|
||||
// frame derivative calculated convoluting with kernel [-1, 0, 1]
|
||||
dx = feature.PixelIrradiance(cv::Point2f(p_in_anchor.x+1, p_in_anchor.y), anchor_frame) - feature.PixelIrradiance(cv::Point2f(p_in_anchor.x-1, p_in_anchor.y), anchor_frame);
|
||||
dy = feature.PixelIrradiance(cv::Point2f(p_in_anchor.x, p_in_anchor.y+1), anchor_frame) - feature.PixelIrradiance(cv::Point2f(p_in_anchor.x, p_in_anchor.y-1), anchor_frame);
|
||||
|
||||
dx = feature.Kernel(p_in_anchor, anchor_frame, "Sobel_x");
|
||||
dy = feature.Kernel(p_in_anchor, anchor_frame, "Sobel_y");
|
||||
|
||||
// dx = feature.PixelIrradiance(cv::Point2f(p_in_anchor.x+1, p_in_anchor.y), anchor_frame) - feature.PixelIrradiance(cv::Point2f(p_in_anchor.x-1, p_in_anchor.y), anchor_frame);
|
||||
// dy = feature.PixelIrradiance(cv::Point2f(p_in_anchor.x, p_in_anchor.y+1), anchor_frame) - feature.PixelIrradiance(cv::Point2f(p_in_anchor.x, p_in_anchor.y-1), anchor_frame);
|
||||
|
||||
dI_dhj(0, 0) = dx/(pixelDistance.x);
|
||||
dI_dhj(0, 1) = dy/(pixelDistance.y);
|
||||
|
||||
|
Reference in New Issue
Block a user