本文整理了Java中org.javaopencvbook.GUI
类的一些代码示例,展示了GUI
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GUI
类的具体详情如下:
包路径:org.javaopencvbook.GUI
类名称:GUI
暂无
代码示例来源:origin: JavaOpenCVBook/code
private void initGUI() {
JFrame frame = createJFrame(windowName);
updateView(image);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
代码示例来源:origin: JavaOpenCVBook/code
public void init() {
setSystemLookAndFeel();
initGUI();
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupTypeRadio(frame);
setupApertureSlider(frame);
setupXOrderSlider(frame);
setupYOrderSlider(frame);
setupLowThresholdSlider(frame);
setupHighThresholdSlider(frame);
setupImage(frame);
enableDisableSliders();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
public void init() {
setSystemLookAndFeel();
initGUI();
resetImage();
}
代码示例来源:origin: JavaOpenCVBook/code
public void actionPerformed(ActionEvent event) {
operation = event.getActionCommand();
enableDisableSliders();
processOperation();
}
};
代码示例来源:origin: JavaOpenCVBook/code
public static void main(String[] args) throws Exception {
String filePath = "src/main/resources/images/SuperTucano.jpg";
Mat newImage = Imgcodecs.imread(filePath);
if(newImage.dataAddr()==0){
System.out.println("Couldn't open file " + filePath);
}else{
GUI gui = new GUI("Connected Components", newImage);
gui.init();
}
return;
}
}
代码示例来源:origin: JavaOpenCVBook/code
public void mouseDragged(MouseEvent arg0) {
updateWarpCoordinates(arg0);
processOperation();
}
代码示例来源:origin: JavaOpenCVBook/code
protected void processOperation() {
if(adaptiveMeanString.equals(thresholdMode)){
Imgproc.adaptiveThreshold(originalImage, image, maxval, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, blockSize, constantC);
}
else if(noneString.equals(thresholdMode)){
image = originalImage.clone();
}
else{
Imgproc.threshold(originalImage, image, level, maxval, modeMap.get(thresholdMode));
}
updateView(image);
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupColorRadio(frame);
setupMaskRadio(frame);
setupRangeRadio(frame);
setupConnectivityRadio(frame);
setupLowerSlider(frame);
setupUpperSlider(frame);
setupResetButton(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
public GUI(String windowName, Mat newImage) {
super();
this.windowName = windowName;
this.image = newImage;
originalImage = newImage.clone();
processOperation();
updateView();
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupTypeRadio(frame);
setupThresholdSlider(frame);
setupMaxSlider(frame);
setupBlockSlider(frame);
setupCSlider(frame);
setupImage(frame);
enableDisableSliders();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupFillRadio(frame);
setupShapeRadio(frame);
setupLowerSlider(frame);
setupUpperSlider(frame);
setupResetButton(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
Imgproc.resize(background, resizedBackground, disparityImage.size());
GUI gui = new GUI("OpenCV Kinect Depth Chroma Key", disparityImage);
gui.init();
while(true){
capture.grab();
Imgproc.threshold(disparityImage, disparityThreshold, gui.getLevel(), 255.0f, Imgproc.THRESH_BINARY);
maskedImage.setTo(new Scalar(0,0,0));
colorImage.copyTo(maskedImage,disparityThreshold);
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.PAGE_AXIS));
setupSlider(frame);
setupImage(frame);
setupButton(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupTypeRadio(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupOperationRadioButtons(frame);
setupSizeSlider(frame);
setupShapeRadioButtons(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.PAGE_AXIS));
setupSlider(frame);
setupRadio(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new GridBagLayout());
setupFilterRadio(frame);
setupButtons(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
代码示例来源:origin: JavaOpenCVBook/code
private JFrame createJFrame(String windowName) {
JFrame frame = new JFrame(windowName);
frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.PAGE_AXIS));
setupButton(frame);
setupImage(frame);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
return frame;
}
内容来源于网络,如有侵权,请联系作者删除!