/** * Computes the orientation and magnitude of each pixel */ private void computePixelFeatures() { for (int y = 0; y < derivX.height; y++) { int pixelIndex = y*derivX.width; int endIndex = pixelIndex+derivX.width; for (; pixelIndex < endIndex; pixelIndex++ ) { float dx = derivX.data[pixelIndex]; float dy = derivY.data[pixelIndex]; // angle from 0 to pi radians orientation.data[pixelIndex] = UtilAngle.atanSafe(dy,dx) + GrlConstants.F_PId2; // gradient magnitude magnitude.data[pixelIndex] = Math.sqrt(dx*dx + dy*dy); } } }
public void setVector( Vector3D_F64 v ) { yaw = Math.atan2( v.x , v.z ); tilt = UtilAngle.atanSafe(-v.y,Math.abs(v.z)); }
public void setVector( Vector3D_F64 v ) { yaw = Math.atan2( v.x , v.z ); tilt = UtilAngle.atanSafe(-v.y,Math.abs(v.z)); }
public void normToEqui( double nx , double ny , double nz , Point2D_F64 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); lonlatToEqui( (double) lon, (double) lat,rect); }
public void normToEqui( float nx , float ny , float nz , Point2D_F32 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); lonlatToEqui( (float) lon, (float) lat,rect); }
public void normToEquiFV( double nx , double ny , double nz , Point2D_F64 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); latlonToEquiFV((double) lat, (double) lon, rect); }
public void normToEqui( double nx , double ny , double nz , Point2D_F64 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); latlonToEqui((double) lat, (double) lon, rect); }
public void normToEqui( float nx , float ny , float nz , Point2D_F32 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); latlonToEqui((float) lat, (float) lon, rect); }
public void normToEquiFV( float nx , float ny , float nz , Point2D_F32 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); latlonToEquiFV((float) lat, (float) lon, rect); }
public void normToEquiFV( double nx , double ny , double nz , Point2D_F64 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); lonlatToEquiFV( (double) lon, (double) lat,rect); }
public void normToEquiFV( float nx , float ny , float nz , Point2D_F32 rect ) { /**/double r = /**/Math.sqrt(nx*nx + ny*ny); /**/double lon = /**/Math.atan2(ny,nx); /**/double lat = UtilAngle.atanSafe(-nz,r); lonlatToEquiFV( (float) lon, (float) lat,rect); }
float angle = UtilAngle.atanSafe(pixelDY,pixelDX) + GrlConstants.F_PId2;
@Override public boolean generate(List<Edgel> dataSet, LinePolar2D_F32 model ) { if( dataSet.size() == 2 ) { Edgel a = dataSet.get(0); Edgel b = dataSet.get(1); float dx = b.x - a.x; float dy = b.y - a.y; // the gradient's orientation is perpendicular to the line's slope double lineAngle = UtilAngle.atanSafe(-dx, dy); // see if their orientations are aligned with the line's angle if(UtilAngle.distHalf(lineAngle, a.theta) > angleTol || UtilAngle.distHalf(lineAngle, b.theta) > angleTol) return false; } // edgel extends Point2D_F32 so this should be legal FitLine_F32.polar((List)dataSet,model); return true; }
Data d = lines.get(i); LineParametric2D_F32 l = d.line; theta[i] = UtilAngle.atanSafe(l.getSlopeY(), l.getSlopeX()); segments.add( LineImageOps.convert(l, imgWidth, imgHeight));
int bestFarthest = 0; float targetAngle = UtilAngle.atanSafe(target.slopeY(),target.slopeX()); float cos = (float)Math.cos(targetAngle); float sin = (float)Math.sin(targetAngle); LineSegment2D_F32 c = candidates.get(i); float angle = UtilAngle.atanSafe(c.slopeY(),c.slopeX()); pt1 = (farthestIndex %2) == 0 ? c.a : c.b; float angleCombined = UtilAngle.atanSafe(pt1.y-pt0.y,pt1.x-pt0.x);
theta[i] = UtilAngle.atanSafe(l.getSlopeY(),l.getSlopeX()); segments.add( convert(l,imgWidth,imgHeight));
protected void detectEdgels(int index0 , int x0 , int y0 , GrayS16 derivX , GrayS16 derivY , GrayU8 binaryEdges) { edgels.reset(); for( int y = 0; y < regionSize; y++ ) { int index = index0 + y*binaryEdges.stride; for( int x = 0; x < regionSize; x++ ) { if( binaryEdges.data[index++] != 0 ) { Edgel e = edgels.grow(); int xx = x0+x; int yy = y0+y; e.set(xx,yy); int dx = derivX.unsafe_get(xx,yy); int dy = derivY.unsafe_get(xx,yy); e.theta = UtilAngle.atanSafe(dy, dx); } } } } }
protected void detectEdgels(int index0 , int x0 , int y0 , GrayF32 derivX , GrayF32 derivY , GrayU8 binaryEdges) { edgels.reset(); for( int y = 0; y < regionSize; y++ ) { int index = index0 + y*binaryEdges.stride; for( int x = 0; x < regionSize; x++ ) { if( binaryEdges.data[index++] != 0 ) { Edgel e = edgels.grow(); int xx = x0+x; int yy = y0+y; e.set(xx,yy); float dx = derivX.unsafe_get(xx,yy); float dy = derivY.unsafe_get(xx,yy); e.theta = UtilAngle.atanSafe(dy, dx); } } } } }