-1

I am trying to create an algorithm that, given a set of elements that are in a site, would return the one that is more likely to be the "one" describing a product.

This is not a 100% accurate algorithm of course, and will need of people-based selection afterwards, but I am trying to get at least a list of the 3 most probable images. Here is what I do so far:

1 - Get rid of which square size is smaller than 50x50px
2 - Calculate average square size of all in the page
3 - Give a score to each , depending on the difference with the average square size (the bigger square size, the more score)
4 - If width of is > than (height * 5), score = score * 0.5 (I do this because this is likely to be a banner in the page).

Here is what I would like to change, but I fail to see what would be a good way to do so. In step 3, what I am doing right now is giving the following score:

score_of_image = average_square_size - square_size_image

I would like to have a particular amount of points that would be shared out to all the depending on their size. The share out should reflect the size of one picture related to the others. What would be a good algorithm in order to share out these points?

4

1 回答 1

1

我认为您需要确定某些方面相对于其他方面的重要性,但您可以简单地计算图像的大小(宽度 x 高度)并将其用作分数的第一部分。我的得分方式是记录页面上最大图像的区域并计算出其他图像的百分比。我不认为平均图像大小真的在这里增加了任何东西,因为我认为最大的图像很可能是产品图像。

然后计算一个单独的方形分数,做这样的事情: -

if (height > width) {
    result = (width/height) * max_points_for_squareness;
} else {
    result = (height/width) * max_points_for_squareness;
}

因此,在这两个方面之间,您可以获得两个百分比,可用于根据您的意愿分配总分(如果您愿意,您可以为方形度分配更多的分数,或者为图像大小分配更多的分数。

于 2013-10-15T14:58:42.817 回答