I am detecting edges in images for quality estimation and I found that after resizing (double the original image), we get more efficient result than original size.
The reason can be that with edge detectors (I mean canny style, not only gradient computation) a blurring algorithm is usually connected. If you use some of blurring mask in preprocessing, it is possible that you can obtain similar behavior by its modification (decreasing, or increasing power of blurring) as in the case of image resize.
I'm expecting that for the image resize you use some interpolation algorithm. I.e., bilinear makes the resized output "blurred". This can be the explanation
Edge detection should be worse in upsampled images. If the detected edges are better, then you did not choose the optimal parameters for edge detection in your original image. It is almost never a good idea to upsample images.
By "more efficient", do you mean fewer false alarms? That is what I would expect, because you have applied a low-pass filtering operation (interpolation) prior to the high-pass filtering operation (edge detection). So it will be less sensitive.
But from a computational perspective, this is not an efficient way of doing things because you have many more pixels to process. You could probably get the same result, at a lower computational cost, if you made your edge detector less 'severe', i.e. convolve your (high-pass) edge detector with a moderate (low-pass) blur filter. Then apply that new filter to your original image.
As already written, your upsampling algorithm seems to have some low-pass/smoothing properties. This tends to remove some high-frequency content, thus makeing the edge-detection more "friendly to the eye".
You can have the same effect, if you either pre-process the original image with a low-pass corresponding to the original image or combine low-pass and edge detection in a single step (where algorithmically applicable).
Upsampling is not a good idea. Instead use the algorithm given in paper "Image Smoothing via L0 Gradient Minimization" as preprocessing. You can download executable and Matlab code from authors web page:
Well, I am going to go against the flow here and say that for me 'up sampling' has improved the detection of edges in some cases. As mentioned above the 'smoothing' effect of up sampling can help with some aspects of edges and boundary detection. As you know there are various ways to up sample (digital duplication / nearest neighbor, bi-linear, cubic convolution, etc). I think that a 'small' amount of smoothing can help connect linear features that are difficult to see in the original image data.
My suggestion is try different up sampling methods and apply some spatial filtering and 1st derivative algorithms and take a look as to what works best for your data set.
have a good day. depend on edge detection you use as you know have many kinds of edge detection and everyone give a different result.and after resizing different shpae.
If you apply smoothing(Up sizing = Smoothing) before edge detection, that will improve the edge result since downsizing removes noise from the image. In my case, to get strong edges I was downsizing the images before edge detection. Downsizing brings the pixels in image closer and edges become stronger and sharper.
Upsampling is to be avoided. The only exception I can think of, is for displaying purposes when the image is very very small. In such a case I would use Catmull-Rom or a cubic spline so that the smoothing effect is small.
@Pat: When in this case the upsampling has a positive effect on the edges, because the bilinear interpolation has a low-pass filtering effect, using a better smoothing filter surely will improve the edges even more. I mean, bilinear interpolation is not the most suitable smoothing filter. Do you agree?
Lambert, yes I DO NOT use bilinear interpolation for either up sampling or low pass filtering. Perhaps what would be good is to have Piyush make a sample image of his data available so we can process and post the results to be 'visually' analyzed by those interested on this thread.
Yes very small images can be improved by up sampling but so can large array images if the amount of zoom-in (scale) is large. No matter what the size of the image is in pixels they can be zoomed in enough that the individual pixels can be seen and the edges will appear blocky. It really depends on the application as to when up sampling is a good thing to do and when it will not help.