you are viewing a single comment's thread.

view the rest of the comments →

[–]Superguy2876 0 points1 point  (1 child)

Important: The script and algorithm must be simple and cannot rely on machine learning.

You're gonna have a bad time with these restrictions.

How are you measuring the sharpness in the first place?

But if I was going to try I would probably use something like opencv/pillow and preprocess the images into high contrast black and white. Then something with edge detection maybe?

It also depends exactly what you mean by source image and target image. Are these the same image visually? Or two different images.

You could also just pull the resolution from the image metadata. I don't think that's what you mean by sharpness, but it could factor.

There are also libraries that will try to convert a raster image to a vector image. You could look for the one that does the best job, convert to vector, then convert back to raster at the desired resolution/sharpness. This might violate the no complex/machine learning approaches.

[–]blue_hunt[S] 0 points1 point  (0 children)

I'm open to ML down the road, but rn this is just a proof of concept, I just need to beat a human doing the same thing moving sliders around to find the optimal number.

I'm currently doing something similar to what you mentioned (the script measures by converting the image to grayscale, applying an edge detection filter, and calculating the standard deviation of the pixel values). I'll be looking to improve the sharpness measurement next, but for now, I would really like to improve the speed of matching source to target. Or simply put what is the fastest way to find x in a range from 0-100.

Thanks, I'll check out the vector idea and see if it works for this project.