Skip to content

This is an effort to produce a model which can help us locate the most optimal positioning of text in an image.

Notifications You must be signed in to change notification settings

trinadh724/Optimal-Positioning-of-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Optimal-Positioning-of-text

  • I have used basNET for differentiating the background from the foreground.
  • Background pixels are closer to [255,255,255] and foreground are closer to [0,0,0] using this property I converted all the pixels based on their Euler distances from these pixels.
  • Then used these pixels values completely remove the foreground image so the mean shift algorithm can be applied only on the background image.
  • I used the sklearn.cluster libraries mean shift algorithm. I got a result that looks reasonable. But the time it is taking is too much. Need to search for some better implementation.
  • Regarding searching for the maximized space, I was thinking of using DFS to calculate the number of pixels that have approximately the same pixel values.
  • Once we get values of the region for all components we can take one with maximum area.
  • One noticeable problem in this approach is that the region with the maximum area may not be in rectangular or some reasonable shape.
  • So if there is some built-in library to do this, it will be easy. I need to see if there exists one.

These are some results of the model.

Original Image

image

BasNET output:

image

Only background Image:

image

Output of mean shift algorithm

image

How to run

Use the code mentioned in Imageprocessing.ipynb to execute. Run the cells one after the other. As of now I have used the code for individal part from other resources. But we will specialize them very soon.

About

This is an effort to produce a model which can help us locate the most optimal positioning of text in an image.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •