I'm trying to modifiy the following OpenCV code to Java.
std::vector<cv::Vec4i> lines;
cv::HoughLinesP(bw,lines,1,CV_PI/180,70,30,10);
for (unsigned int i = 0;i<lines.size();i++)
{
cv::Vec4i v = lines[i];
lines[i][0] = 0;
lines[i][1] = ((float)v[1] - v[3])/(v[0] - v[2])* -v[0] + v[1];
lines[i][2] = src.cols;
lines[i][3] = ((float)v[1] - v[3])/(v[0] - v[2])*(src.cols - v[2]) + v[3];
}
std::vector<cv::Point2f> corners;
for (unsigned int i = 0;i<lines.size();i++)
{
for (unsigned int j=i+1;j<lines.size();j++)
{
cv::Point2f pt = computeIntersect(lines[i],lines[j]);
if (pt.x >= 0 && pt.y >=0)
{
corners.push_back(pt);
}
}
}