Code Monkey home page Code Monkey logo

lir's People

Contributors

amir-hossein-zarei avatar lukasalexanderweber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lir's Issues

largest interior square

Would it be feasible to modify the algorithm to find the largest square instead of the largest unconstrained rectangle? More broadly, it would be great to be able to find the largest rectangle with a given aspect ratio and then specify 1:1 for squares.

Return the n biggest rectangles

First of all, many thanks for your project which help me a lot in my work. And I have a question that, is there any way to find the largest horizon rectangle inside a shape? I need a horizon rectangle to put some words in it.

Thanks,
Mi

Non-numba version

Hi @lukasalexanderweber ,

thanks for this fantastic project! It was very useful for my current project. However, I'm facing some problems due to numba. It's nothing wrong with your code, but with my project when I want to dockerize it. I don't know why, if I add the library numba @ git+https://github.com/numba/[email protected] to my requirements to be installed, my docker is getting ages to be build (I need to use that version because I need to use numpy 1.24 and that branch is the first to be compatible with numpy 1.24).

May I ask you, if is it possible to have a non-numba version? or simply, if you don't wanna have it here, how can I remove numba? just removing the @nb. above function definitions? what about nb.pranges? is just moving them to np.arange?

versions >=3.7,<3.11 are supported

while installing through pip, it is throwing error as:
RuntimeError: Cannot install on Python version 3.11.1; only versions >=3.7,<3.11 are supported.
can anyone suggest how to use this package on Python version 3.11.1

Using lir with an imported image

The documentation doesn't discuss how to create the grid from an image. It took me a few tries to work this out

mask = np.full(img.shape, 0, dtype=np.uint8)
cv.drawContours(mask,[contour],contourIdx=-1, color=(255,255,255),thickness=-1)
grid = np.array(mask[:,:,1]) > 0
rect = lir.lir(grid)

This takes my original image, makes a copy that is all black, and fills it with the contour in white. We now convert the first dimension from uint8 to bool. This is needed because lir expects array(bool, 2d, C), not array(uint8, 3d, C). There may be other ways to do this, but this may help anyone stuck with:
TypeError: No matching definition for argument type(s) array(uint8, 3d, C)

What is the Big O notation for the used algorithm?

Hi @lukasalexanderweber ,

I would like to clarify on algorithmic complexity of 'lir'. To be honest I've read both blog and original article, and could not find any detailed on what is O(...) for the algorithm we execute.

My goal is to execute 'lir' on a large grid - let it be 15000 x 18000.
The reason why I have such a large grid - first thing I translate original float number like '149.75' to be '14975'. Hopefully this will get more precise results. And the nature of this translation - an algorithm executes over integers.

Will appreciate any comments on this.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.