Inconsistency using ROI and roifilt2 with the function edge.

1 view (last 30 days)
I'm getting strange results using ROI based processing on images.
I'm using the functions edge and roifilt2 to process an image. I'm only interested in detecting edges in specific region of the image, so I defined a mask.
Let's call the image I and the mask M . I'm using Canny's method with two specified thresholds, t1 and t2 .
When I process the entire image using the syntax
figure=edge(I,'canny', [t1 t2])
I get one result. However, when I process only the region of interest using roifilt2 the edges in the ROI are different from those in the same region when I process the entire image.
I defined a function handle as follows
edgecanny= @(I) edge(I,'canny',[t1 t2]);
And then used it in roifilt2
figure = roifilt2(I, mask, edgecanny)
If I'm using the same exact parameters for both cases (except the size of the process area) why is it that the detected edges in the same region are different?
If necessary I can provide the images in question and the mask.
Edit:
I'm not referring to the borders of the ROI, which I expect to be different, I'm talking about the region well inside the ROI.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!