1
$\begingroup$

I am trying to extract features from images using:

def process_image(image_fp):
    image_ = imread(image_fp)
    image_ = resize(image_, (300, 200,3))
    image=equalize_hist(rgb2gray(image_))
    edges = skimage.feature.blob_dog(image)
    return edges.reshape(edges.size).tolist()

where image_fp is an image path.

I am having a problem due to the different sizes of the return. In general, the reshape guarantees the same size in the others algorithms.

Is there a way to get always the same size?

I only see a way: to truncate the lists (the stupid way).

$\endgroup$
0
$\begingroup$

Please read through the scikit documentation that is found here and I am assuming that you have gone through the method through which it calculates blobs in the images. If not the link is here. It return the 2D array of arrays with 3 values in each array, giving coordinates and std.deviation of Gaussian of the blob found. The length of the array returned is the number of blobs it has found in the image. So eliminating elements from that array by resizing it, is a wrong way of approach and may eliminate the features which you might find important.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.