void otb::Wrapper::ObjectsRadiometricStatistics::DoInit()
{
	SetName("ObjectsRadiometricStatistics");
	SetDescription("Compute features attributes of a vector dataset over an image.");

	SetDocName("ObjectsRadiometricStatistics");
	SetDocLongDescription("This application computes radiometric and shapes attributes on a vector dataset, using an image. The results are stored in the attribute table. Shape attributes are : number of pixels, flatness, roundness, elongation, perimeter. Radiometric attributes are for each band of the input image : mean, standard-deviation, median, variance, kurtosis, skewness.");
	SetDocLimitations("None");
	SetDocAuthors("Arnaud Durand");
	SetDocSeeAlso("For now, support of input dataset with multiple layers having different projection reference system is limited.");

	AddParameter(ParameterType_InputFilename,  "in",   "Input vector dataset");
	SetParameterDescription( "in", "Input vector dataset providing segmentation.");

	AddParameter(ParameterType_InputImage,  "im",   "Input reference image");
	SetParameterDescription( "im", "Input image used to compute radiometric attributes.");

	AddParameter(ParameterType_String,"field","ID field");
	SetParameterDescription("field","Name of the field containing object IDs.");
	SetParameterString("field","label");

	AddParameter(ParameterType_Int,"background", "Background value");
	SetParameterDescription("background","Background value. Needs to be different of any object ID.");
	SetDefaultParameterInt("background",0);

	SetDocExampleParameterValue("in","segmentation.shp");
	SetDocExampleParameterValue("im","image_XS.tif");
	SetDocExampleParameterValue("field","label");
	SetDocExampleParameterValue("background","0");
	
	AddParameter(ParameterType_InputFilename, "out", "Output vector dataset");
	SetParameterDescription("out", "Output vector dataset containing features attributes.");
}
void otb::Wrapper::Aggregate::DoInit()
{
    SetName("Aggregate");
    SetDescription("This application assign a class on each object of a segmentation by majority voting on a pixel-based classification.");

    SetDocName("Aggregate");
    SetDocLongDescription("The aim of this application is to merge the result of a segmentation with a pixel-based image classification in order to produce an object-oriented image classification. The input segmentation is a labeled image, typically the result provided by the OTB application LSMSSegmentation. The output is a vector dataset containing objects and the corresponding class in the attribute table. Connected regions belonging to the same class are merged. This application could be used at the last step of the LSMS pipeline in replacement of the application LSMSVectorization.");
    SetDocLimitations("Input classification and labeled image should have identical resolution and footprint");
    SetDocAuthors("Lucie Bouillot");
    SetDocSeeAlso("MeanShiftSmoothing, LSMSSegmentation, LSMSSmallRegionsMerging, TrainImagesClassifier, ImagesClassification");
    AddDocTag(Tags::Segmentation);
    AddDocTag(Tags::Learning);

    AddParameter(ParameterType_InputImage, "in", "Input classification");
    SetParameterDescription( "in", "Pixel-based image classification." );

    AddParameter(ParameterType_InputImage,  "inseg",    "Labeled image");
    SetParameterDescription( "inseg", "Labeled image representing a segmentation of an image.");

    AddParameter(ParameterType_OutputImage, "outim", "Output raster");
    SetParameterDescription( "outim", "Output raster, object-oriented image classification.");

    AddParameter(ParameterType_OutputFilename, "out", "Output vector dataset");
    SetParameterDescription( "out", "Output vector dataset, object-oriented image classification. The class 0 is considered as background.");

    SetDocExampleParameterValue("in","classification.tif");
    SetDocExampleParameterValue("inseg","labeled_image.tif");
    SetDocExampleParameterValue("outim","image_classification.tif");
    SetDocExampleParameterValue("out","vector_classification.shp");
}
Beispiel #3
0
void SetPPDStoreOption(cngplpData *data, cups_dest_t *curr_printer)
{
	int i;
	PPDOptions *ppd_opt = data->ppd_opt;
	cups_option_t *opt;
	UIItemsList *items_list;
	int jobmode = 0;
	int cnt = 0;
	char *slot = NULL;
	char *media = NULL;
	int usr_select = 0;
	int inputselect = 0;
#ifndef __APPLE__
  	int tmp_env = 0;
  	char *p_tmp = NULL;
	tmp_env = get_comma_chg_env();
	char *value = NULL;
#endif


	opt = curr_printer->options;
	for(i = 0; i < curr_printer->num_options; i++){
		items_list = ppd_opt->items_list;
#ifndef __APPLE__
      if( is_comma_chg_opt_name(opt->name) == 1 )
      {
        if( tmp_env == 1 && (p_tmp = strchr(opt->value, '.') ) != NULL)
        {
          *p_tmp = ',';
        }
		else if( tmp_env == 2 && (p_tmp = strchr(opt->value, ',') ) != NULL)
        {
          *p_tmp = '.';
        }
      }
#endif
		while(1){
			if(strcmp(opt->name, items_list->name) == 0){
				if(strcmp(items_list->name, "InputSlot") == 0){
					if(ppd_opt->selectby != SELECTBY_NONE){
						slot = strdup(opt->value);
						usr_select = SELECTBY_INPUTSLOT;
					}
				}else if(strcmp(items_list->name, "MediaType") == 0){
					if(ppd_opt->selectby != SELECTBY_NONE){
						media = strdup(opt->value);
						usr_select = SELECTBY_MEDIATYPE;
					}
				}else if(strcmp(items_list->name, "CNJobExecMode") == 0){
					if(strcmp(opt->value, "store") == 0)
						jobmode = 1;
					else if(strcmp(opt->value, "secured") == 0)
						jobmode = 2;
					else if(strcasecmp(opt->value, "Hold") == 0)
						jobmode = 3;
				}

				if(strcmp(items_list->name, "PageSize") == 0){
					if(strstr(opt->value, "Custom") != NULL){
						char *tmp_value = strdup(opt->value);
						SetCustomSize(data, tmp_value);
						items_list->new_option = strdup(tmp_value);
						free(tmp_value);
					}else{
						items_list->new_option = strdup(opt->value);
					}
				}else{
					items_list->new_option = strdup(opt->value);
				}

				if(items_list->current_option != NULL){
					ResetUIConst(data, items_list->name, items_list->current_option->name);
					MarkDisable(data, items_list->name, items_list->current_option->name, -1, 0);
					cnt++;
				}
				UpdateCurrOption(items_list);
			}
			if(items_list->next == NULL)
				break;
			items_list = items_list->next;
		}
		if(strcmp(opt->name, "CNBindEdgeShift") == 0){
			ppd_opt->gutter_value = atoi(opt->value);
			ppd_opt->gutter_value_d = atof(opt->value);
		}else if(strcmp(opt->name, "CNStartingNumber") == 0){
			ppd_opt->startnum_value = atoi(opt->value);
		}else if(strcmp(opt->name, "CNUsrName") == 0){
			strncpy(ppd_opt->special->usr_name, opt->value, 127);
		}else if(strcmp(opt->name, "CNDocName") == 0){
#ifndef __APPLE__
			value = strdup(opt->value);
#else
			if(jobmode == 1)
				strncpy(ppd_opt->special->enter_name, opt->value, 127);
			else if(jobmode == 2)
				strncpy(ppd_opt->special->doc_name, opt->value, 127);
			else if(jobmode == 3)
				strncpy(ppd_opt->special->hold_name, opt->value, 127);
#endif
		}else if(strcmp(opt->name, "CNSecuredPrint") == 0){
			strncpy(ppd_opt->special->passwd_array, opt->value, 7);
		}else if(strcmp(opt->name, "CNMailBox") == 0){
#ifndef __APPLE__
			ppd_opt->special->box_num = atoi(opt->value);
#else
			strncpy(ppd_opt->special->box_num, opt->value,511);
#endif
		}else if(strcmp(opt->name, "CNDisableJobAccountingBW") == 0){
			int job_account_bw;
			job_account_bw = (strcmp(opt->value, "True") == 0) ? 1 : 0;
			ppd_opt->special->disable_job_account_bw = job_account_bw;
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftUpwards) == 0){
			ppd_opt->shift_upwards = atoi(opt->value);
			ppd_opt->detail_shift_upwards = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftRight) == 0){
			ppd_opt->shift_right = atoi(opt->value);
			ppd_opt->detail_shift_right = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftFrLongEdge) == 0){
			ppd_opt->shift_front_long = atoi(opt->value);
			ppd_opt->detail_shift_front_long = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftFrShortEdge) == 0){
			ppd_opt->shift_front_short = atoi(opt->value);
			ppd_opt->detail_shift_front_short = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftBkLongEdge) == 0){
			ppd_opt->shift_back_long = atoi(opt->value);
			ppd_opt->detail_shift_back_long = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNShiftBkShortEdge) == 0){
			ppd_opt->shift_back_short = atoi(opt->value);
			ppd_opt->detail_shift_back_short = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNJobNote) == 0){
			if(ppd_opt->job_note != NULL)
				strncpy(ppd_opt->job_note->note, opt->value, sizeof(ppd_opt->job_note->note));
		}else if(strcmp(opt->name, kPPD_Items_Device_CNJobDetails) == 0){
			if(ppd_opt->job_note != NULL)
				strncpy(ppd_opt->job_note->details, opt->value, sizeof(ppd_opt->job_note->details));
		}else if(strcmp(opt->name, kPPD_Items_Device_CNOffsetNum) == 0){
			ppd_opt->offset_num = atoi(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNInputSelect) == 0){
			if(strcmp(opt->value, kPPD_Items_InputSlot) == 0)
				inputselect = SELECTBY_INPUTSLOT;
			else if(strcmp(opt->value, kPPD_Items_MediaType) == 0)
				inputselect = SELECTBY_MEDIATYPE;
		}else if(strcmp(opt->name, kPPD_Items_CNGutterShiftNum) == 0){
			double max_value;
			char *maxptr;

			ppd_opt->guttershiftnum_value_d = atof(opt->value);

			maxptr = cngplpGetData(data,ID_MAX_GUTTER_SHIFT_NUM);
			if(maxptr != NULL){
				max_value = atof(maxptr);

				if(max_value < ppd_opt->guttershiftnum_value_d){
					ppd_opt->guttershiftnum_value_d = max_value;
				}
				free(maxptr);
			}
		}else if(strcmp(opt->name, kPPD_Items_Device_CNTabShift) == 0){
			ppd_opt->tab_shift = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNInsertTabShift) == 0){
			ppd_opt->ins_tab_shift = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNFormHandle) == 0){
				strncpy(ppd_opt->special->form_handle, opt->value, 127);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNOverlayFileName) == 0){
				strncpy(ppd_opt->special->form_name, opt->value, 127);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNAdjustTrimNum) == 0){
			ppd_opt->adjust_trim_num = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNAdjustForeTrimNum) == 0){
			ppd_opt->adjust_frtrim_num = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNAdjustTopBottomTrimNum) == 0){
			ppd_opt->adjust_tbtrim_num = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNPBindFinishForeTrimNum) == 0){
			ppd_opt->pb_fin_fore_trim_num = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNPBindFinishTopBottomTrimNum) == 0){
			ppd_opt->pb_fin_topbtm_trim_num = atof(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNStackCopiesNum) == 0){
			ppd_opt->stack_copies_num = atoi(opt->value);
		}else if(strcmp(opt->name, kPPD_Items_Device_CNSaddlePressAdjustment) == 0){
			ppd_opt->saddle_press_adjust = atoi(opt->value);
		}
		opt++;
	}

#ifndef __APPLE__
	if((ppd_opt != NULL) && (value != NULL)){
		SetDocName(ppd_opt, jobmode, value);
		MemFree(value);
	}
#endif

	if(cnt != 0){
	  	ResetUIDisable(ppd_opt->items_list);
		AllUpdatePPDData(data);
	}

	if(inputselect == SELECTBY_INPUTSLOT){
		ppd_opt->selectby = inputselect;
		UpdatePPDData(data, "MediaType", NULL);
		UpdatePPDData(data, "InputSlot", slot);
	}else if(inputselect == SELECTBY_MEDIATYPE){
		ppd_opt->selectby = inputselect;
		UpdatePPDData(data, "InputSlot", NULL);
		UpdatePPDData(data, "MediaType", media);
	}else{
		if(usr_select == SELECTBY_INPUTSLOT){
			ppd_opt->selectby = usr_select;
			UpdatePPDData(data, "MediaType", NULL);
			UpdatePPDData(data, "InputSlot", slot);
		}else if(usr_select == SELECTBY_MEDIATYPE){
			ppd_opt->selectby = usr_select;
			UpdatePPDData(data, "InputSlot", NULL);
			UpdatePPDData(data, "MediaType", media);
		}
	}

	if(slot)	free(slot);
	if(media)	free(media);

#ifndef	__APPLE__
	CheckJobAccount(data);
#endif
}