本文整理匯總了Java中ij.process.ImageProcessor.drawLine方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageProcessor.drawLine方法的具體用法?Java ImageProcessor.drawLine怎麽用?Java ImageProcessor.drawLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ij.process.ImageProcessor
的用法示例。
在下文中一共展示了ImageProcessor.drawLine方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawOneKey
import ij.process.ImageProcessor; //導入方法依賴的package包/類
void drawOneKey(SiftKeypoint key, ImageProcessor ip) {
double x = (int) Math.rint(key.x);
double y = (int) Math.rint(key.y);
int u0 = (int) x;
int v0 = (int) y;
double phi = key.orientation;
double scale = key.scale;
double dx = magnification * scale * Math.cos(phi);
double dy = magnification * scale * Math.sin(phi); // NOTE: angle runs reversed
int u1 = (int) Math.rint(x + dx);
int v1 = (int) Math.rint(y + dy);
ip.setColor(boxColor);
ip.drawRect(u0-1, v0-1, 3, 3);
ip.setColor(lineColor);
ip.drawLine(u0,v0,u1,v1);
}
示例2: drawLine
import ij.process.ImageProcessor; //導入方法依賴的package包/類
private void drawLine(ImageProcessor ip, double[] p1, double[] p2) {
int u1 = (int) Math.round(p1[0]);
int v1 = (int) Math.round(p1[1]);
int u2 = (int) Math.round(p2[0]);
int v2 = (int) Math.round(p2[1]);
ip.drawLine(u1, v1, u2, v2);
}