Git Product home page Git Product logo

Comments (8)

argman avatar argman commented on July 24, 2024 1

@LearnerInGithub , sorry for the confusion, its not a bug, p1 is [x1, x2], and p2 is [y1, y2], maybe need a fix..

from east.

LearnerInGithub avatar LearnerInGithub commented on July 24, 2024 1

@argman @zxytim I have a new question about restore_rectangle_rbox() in icdar.py,

  1. what's mean of the input params origin and geometry?
  2. what's the purpose of this line of code: p = np.array([np.zeros(d_0.shape[0]), -d_0[:, 0] - d_0[:, 2],
    d_0[:, 1] + d_0[:, 3], -d_0[:, 0] - d_0[:, 2],
    d_0[:, 1] + d_0[:, 3], np.zeros(d_0.shape[0]),
    np.zeros(d_0.shape[0]), np.zeros(d_0.shape[0]),
    d_0[:, 3], -d_0[:, 2]]) ?

Thanks very much!

from east.

LearnerInGithub avatar LearnerInGithub commented on July 24, 2024

@argman @zxytim
Another question about line_cross_point() in icdar.py, could we handle two coincident lines in? if line1 and line2 coincident, how we compute the cross point? infinite or randomly choose one?
def line_cross_point(line1, line2):
# line1 0= ax+by+c, compute the cross point of line1 and line2
if line1[0] != 0 and line1[0] == line2[0]:
print('Cross point does not exist')
return None
if line1[0] == 0 and line2[0] == 0:
print('Cross point does not exist')
return None
if line1[1] == 0:
x = -line1[2]
y = line2[0] * x + line2[2]
elif line2[1] == 0:
x = -line2[2]
y = line1[0] * x + line1[2]
else:
k1, _, b1 = line1
k2, _, b2 = line2
x = -(b1-b2)/(k1-k2)
y = k1*x + b1
return np.array([x, y], dtype=np.float32)

from east.

LearnerInGithub avatar LearnerInGithub commented on July 24, 2024

@argman @zxytim This function seems also confusing:
def line_verticle(line, point):
# get the verticle line from line across point
if line[1] == 0:
verticle = [0, -1, point[1]]
else:
if line[0] == 0:
verticle = [1, 0, -point[0]]
else:
verticle = [-1./line[0], -1, point[1] - (-1/line[0] * point[0])]
# Should be verticle = [line[1]/line[0], -1, point[1] - (line[1]/line[0])*point[0]]
return verticle

from east.

argman avatar argman commented on July 24, 2024

@LearnerInGithub , I think its the same, I fit line as kx-y+b=0 or x=c or y=c, so line[1]=-1

from east.

LearnerInGithub avatar LearnerInGithub commented on July 24, 2024

@argman, fit the line as kx-y+b=0, this assume line has slope , however, while line is kx+c=0, then its verticle line should not have -1 for y, T think this is spcial case that we should care about.

from east.

argman avatar argman commented on July 24, 2024

@LearnerInGithub so there is if-else

from east.

LearnerInGithub avatar LearnerInGithub commented on July 24, 2024

@argman Yes, this explains my question, thanks!

from east.

Related Issues (20)

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.