Package de.offis.faint.model

Examples of de.offis.faint.model.Region


   
    /* (non-Javadoc)
     * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
     */
    public void mouseClicked(MouseEvent e) {
      Region selectedRegion = getRegionUnderCursor(e);
      if (isCursorOnIcon(e, iconTraining, trainingDelta))
        mainFrame.eventDispatcher.dispatchEvent(new EventModifyTrainingData(selectedRegion, !selectedRegion.isUsedForTraining()));
      else if (isCursorOnIcon(e, iconCorner, cornerDelta))
        mainFrame.eventDispatcher.dispatchEvent(new EventRegionSelectionChanged(selectedRegion));       
      repaint();
    }
View Full Code Here


    }
   
    // Selected region changed
    else if (incomingEvent instanceof EventRegionSelectionChanged){
      EventRegionSelectionChanged event = (EventRegionSelectionChanged) incomingEvent;
      Region newRegion = event.getRegion();
     
      if (newRegion != null){
        ImageModel image = new ImageModel(newRegion.getImage());
        if (currentImage == null || !currentImage.equals(image))
        {
          dispatchEvent(new EventOpenImage(image));
         
          if (currentImage == null || !currentImage.equals(image))
View Full Code Here

    }

    HashMap<String, Integer> result = new HashMap<String, Integer>names.length);
    ArrayList<SortableContainer<Region>> bestHits = new ArrayList<SortableContainer<Region>>();
    for (String name : names) {
      Region image = null;
      Region[] regionsForName = db.getRegionsForFace(name);

      if (regionsForName != null) {
        double minDist = Double.MAX_VALUE;
       
View Full Code Here

        Region[] regions = new Region[result.size()];

        for (int i = 0; i < result.size(); i++) {
            Rectangle r = result.get(i);
            regions[i] = new Region((int) Math.round(r.getCenterX()), (int) Math.round(r.getCenterY()), r.width, r.height, 0, file);
        }

        return regions;
    }
View Full Code Here

       
        ArrayList<Region> detectedFaces = new ArrayList<Region>();
        for (int i = 0; i<betaFaces.length; i++){
         
          if (betaFaces[i].getOrigFeatures()[0].getWidth() >= minScanWindowSize && betaFaces[i].getOrigFeatures()[0].getHeight() >= minScanWindowSize)   
            detectedFaces.add(new Region(
                (int) Math.round(betaFaces[i].getOrigFeatures()[0].getX() / scaleFactor),
                (int) Math.round(betaFaces[i].getOrigFeatures()[0].getY() / scaleFactor),
                (int) Math.round(betaFaces[i].getOrigFeatures()[0].getWidth() / scaleFactor),
                (int) Math.round(betaFaces[i].getOrigFeatures()[0].getHeight() / scaleFactor),
                betaFaces[i].getOrigFeatures()[0].getAngleDegree(),
View Full Code Here

        p = imageViewBehaviour.viewToModel(p);
       
        double size = Math.max(Math.abs(newRegionA.x-newRegionB.x), Math.abs(newRegionA.y-newRegionB.y));
        size/=imageViewBehaviour.getZoomFactor();
       
        Region r = new Region((int) Math.round(p.x),
                          (int) Math.round(p.y),
                          (int) Math.round(size),
                          (int) Math.round(size),0,
                          currentImageModel.getFile().toString());
       
        r.setUsedForTraining(false);
       
        newRegionA = null;
       
        MainController.getInstance().getFaceDB().put(r,Constants.UNKNOWN_FACE);       
        mainFrame.eventDispatcher.dispatchEvent(new EventUpdateAnnotationPanel());
View Full Code Here

     * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
     */
    public void mouseClicked(MouseEvent e){
      requestFocus();
      if (currentImageModel != null){
        Region r = currentImageModel.getRegionAtPoint(imageViewBehaviour.viewToModel(e.getPoint()));
        mainFrame.eventDispatcher.dispatchEvent(new EventRegionSelectionChanged(r));
      }
      imageCursorBehaviour.updateCursor(e.getPoint());
    }
View Full Code Here

          mainFrame.eventDispatcher.dispatchEvent(new EventAddKnownPerson(aValue.toString()));
        updateAnnotations();
        int row = this.getRowForValue(aValue.toString());
        table.changeSelection(row,row,false,false);
       
            Region region = ((ClassificationTableModel)table.getModel()).getCurrentRegion();

        mainFrame.eventDispatcher.dispatchEvent(new EventClassifyRegion(region, aValue.toString()));
      }
    }
View Full Code Here

    public synchronized void mouseClicked(MouseEvent e){
      if (e.getClickCount() == 2)
          {
              int row = table.rowAtPoint(e.getPoint());
              if (row > 0){
                Region region = ((ClassificationTableModel)table.getModel()).getCurrentRegion();
                String annotation = table.getValueAt(row, ClassificationTableModel.NAME_COLUMN).toString();
                mainFrame.eventDispatcher.dispatchEvent(new EventClassifyRegion(region, annotation));
              }
          }
    }
View Full Code Here

  public AnnotationTableModel getAnnotationModel() {
    return (AnnotationTableModel) this.getModel();
  }
   
  public void setSelectedRegion(Region region){
    Region oldRegion = currentRegion;
    currentRegion = region;
    if (oldRegion != currentRegion){
    if((oldRegion == null && region != null) ||
       (oldRegion != null && !oldRegion.equals(region)))
     
      if (region == null)
        this.clearSelection();
      else{
        int column = this.getColumnIndex(region);
View Full Code Here

TOP

Related Classes of de.offis.faint.model.Region

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.