Exemple #1
0
void MainWindow::on_bGenerate_clicked()
{
    int from = ui->sbFrom->value();
    int to = ui->sbTo->value();
    if (from>to)
        return;//error
    

    //QString importCall= "C:/bin/curl.exe -X POST http://127.0.0.1:8000/SILT/default/add_images -d\"imageId=%1&_formkey=3db667ed-9e17-47a3-9b35-94ef9aca9c50&_formname=image/create\"";
    QPainter p;
    for (int i=from; i<to; ++i)
    {
	   QImage outImg = _img;
	   p.begin(&outImg);
       p.setFont(QFont("Arial",50));
       p.setBrush(QBrush(Qt::blue));
       p.setPen(QColor(Qt::blue));
       p.drawText(QPoint(100,100),"Image:"+QString::number(i));
       p.end();
	   QString imgName = importImage( outImg );

	   QString curl = ui->tImgLabelCurl->toPlainText();
	   curl.replace("$IMG",imgName);
	   curl.replace("$CNT",QString::number(i));
	   QProcess::startDetached(curl);
       qApp->processEvents();       
    }
}
Exemple #2
0
void AutoImportWindow::executeImport(bool execute) {
    if (!execute) {
        int choice = QMessageBox::question(this, "Confirm stop", QString("Please select how you want to stop\n\nIf you stop now, the images which are ") +
                "being copied will be stopped.\n", "Finish current and stop", "Stop now", "Continue importing", 0, 2);
        if(choice == 0) {
            continuous->setChecked(false);
            toBeImported_.clear();
            resetState();
        } else if(choice == 1) {
            if (process_.state() == QProcess::Running) {
                disconnect(&process_, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, &AutoImportWindow::continueExecution);
                process_.kill();
                while (!process_.waitForFinished()) process_.kill();
                connect(&process_, static_cast<void(QProcess::*)(int)>(&QProcess::finished), this, &AutoImportWindow::continueExecution);
            }
            finishExecution();
        } else {
            resetState();
        }
    } else if(currentlyExecuting_) {
        // qDebug() << "Currently importing, skipping this import";
        return;
    } else if(toBeImported_.isEmpty()) {
        resetState();
        return;
    } else {
        currentlyExecuting_ = true;
        resetState();

        importImage();
    }
}
VehicleTemplateExportDialog::VehicleTemplateExportDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::VehicleTemplateExportDialog), m_autopilotConnected(false)
{
    ui->setupUi(this);
    connect(ui->ImportButton, SIGNAL(clicked()), this, SLOT(importImage()));
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    m_uavoManager = pm->getObject<UAVObjectManager>();
    ui->Photo->setScene(new QGraphicsScene(this));
    ui->Type->setText(setupVehicleType());
    ui->selectionWidget->setTemplateInfo(m_type, m_subType);

    connect(ui->Name, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Owner, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->ForumNick, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Size, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
    connect(ui->Weight, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));

    connect(ui->exportBtn, SIGNAL(clicked()), this, SLOT(exportTemplate()));
    connect(ui->saveAsBtn, SIGNAL(clicked()), this, SLOT(saveAsTemplate()));
    connect(ui->importBtn, SIGNAL(clicked()), this, SLOT(importTemplate()));
    connect(ui->cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->cancelBtn_2, SIGNAL(clicked()), this, SLOT(reject()));

    TelemetryManager *telemManager = pm->getObject<TelemetryManager>();
    if (telemManager->isConnected()) {
        onAutoPilotConnect();
    } else {
        onAutoPilotDisconnect();
    }

    connect(telemManager, SIGNAL(connected()), this, SLOT(onAutoPilotConnect()));
    connect(telemManager, SIGNAL(disconnected()), this, SLOT(onAutoPilotDisconnect()));
}
Exemple #4
0
KritaShape::KritaShape(const KUrl& url, const QString & profileName)
        : m_d(new Private())
{
    m_d->url = url;
    m_d->doc = 0;
    if (!url.isEmpty()) {
        importImage(url);
    }
    m_d->displayProfile = KoColorSpaceRegistry::instance()->profileByName(profileName);
    setKeepAspectRatio(true);
    moveToThread(QCoreApplication::instance()->thread()); // it's a QObject; lets make sure it always has a proper thread.
}
void
ImageReader::readImage() {

	// get information about the image to read
	vigra::ImageImportInfo info(_filename.c_str());

	// abort if image is not grayscale
	if (!info.isGrayscale()) {

		UTIL_THROW_EXCEPTION(
				IOError,
				_filename << " is not a gray-scale image!");
	}

	// allocate image
	_image = new Image(info.width(), info.height());
	_image->setIdentifiyer(_filename);

	try {

		// read image
		importImage(info, vigra::destImage(*_image));

	} catch (vigra::PostconditionViolation& e) {

		UTIL_THROW_EXCEPTION(
				IOError,
				"error reading " << _filename << ": " << e.what());
	}

	if (strcmp(info.getPixelType(), "FLOAT") == 0)
		return;

	// scale image to [0..1]

	float factor;
	if (strcmp(info.getPixelType(), "UINT8") == 0)
		factor = 255.0;
	else {

		factor = 1.0;
		LOG_DEBUG(imagereaderlog) << _filename << " has pixel format " << info.getPixelType() << ", will not scale values" << std::endl;
	}

	vigra::transformImage(
			vigra::srcImageRange(*_image),
			vigra::destImage(*_image),
			vigra::linearIntensityTransform<float>(1.0/factor));
}
Exemple #6
0
void Editor::dropEvent( QDropEvent* event )
{
    if ( event->mimeData()->hasUrls() )
    {
        for ( int i = 0; i < event->mimeData()->urls().size(); i++ )
        {
            if ( i > 0 ) scrubForward();
            QUrl url = event->mimeData()->urls()[ i ];
            QString filePath = url.toLocalFile();
            if ( filePath.endsWith( ".png" ) || filePath.endsWith( ".jpg" ) || filePath.endsWith( ".jpeg" ) )
                importImage( filePath );
            if ( filePath.endsWith( ".aif" ) || filePath.endsWith( ".mp3" ) || filePath.endsWith( ".wav" ) )
                importSound( filePath );
        }
    }
}
Exemple #7
0
void AutoImportWindow::continueExecution() {
    if (!commandExecuting_.isEmpty() && commandExecuting_.startsWith("SCRIPT:")) {
        QString resultsFile = QFileInfo(commandExecuting_.split(":")[1]).fileName().remove(QRegExp("\\.script$")) + ".results";
        qDebug() << "Saving results from file: " << resultsFile;

        ResultsData resultsData(imageExecuting_->workingPath());
        resultsData.load(imageExecuting_->workingPath() + "/LOGS/" + resultsFile);
        resultsData.save();
    }
    
    if (scriptsToBeExecuted_.isEmpty()) {
        commandExecuting_ = "";
        QStringList selectedScripts = selectedScriptPaths();
        if(imageExecuting_ && !selectedScripts.isEmpty()) {
            //qDebug() << "Adding to processing queue: " << imageExecuting_->toString();
            projectData.addImageToQueue(imageExecuting_, selectedScripts, priorityQueueOption_->isChecked());
        }
        importImage();
        return;
    }

    QString scriptPath = scriptsToBeExecuted_.first();
    commandExecuting_ = scriptPath;
    //qDebug() << "Import is executing: " << scriptPath;
    scriptsToBeExecuted_.removeFirst();

    if(scriptPath.startsWith("SCRIPT:")) {
        scriptPath = scriptPath.split(":")[1];
        QString scriptName = QFileInfo(scriptPath).fileName().remove(QRegExp("\\.script$"));
        if (QFileInfo(scriptPath).exists()) {
            //qDebug() << "Executing script: " << scriptPath;
            ScriptParser parser(imageExecuting_->workingPath());
            parser.parse(scriptPath, imageExecuting_->workingPath() + "/proc/" + scriptName + ".com");
            process_.setWorkingDirectory(imageExecuting_->workingPath());
            process_.setStandardOutputFile(imageExecuting_->workingPath() + "/LOGS/" + scriptName + ".log");
            process_.start('"' + parser.executionString() + '"', QIODevice::ReadOnly);
        }
    }
    else {
        process_.start(scriptPath, QIODevice::ReadOnly);
    }
}
Exemple #8
0
void Editor::importMovie( QString filePath, int fps )
{
    int i = 0;
    QSettings settings( PENCIL2D, PENCIL2D );

    qDebug() << "-------IMPORT VIDEO------" << filePath;

    // --------- Import all the temporary frames ----------
    QDir::temp().mkdir( "pencil" );
    QString tempPath = QDir::temp().absolutePath() + "/pencil/";

    if ( QFile::exists( QDir::current().currentPath() + "/plugins/ffmpeg.exe" ) == true )
    {
        QProgressDialog progress( "Importing movie...", "Abort", 0, 100, NULL );
        progress.setWindowModality( Qt::WindowModal );
        progress.show();
        progress.setValue( 10 );
        QProcess ffmpeg;
        qDebug() << "./plugins/ffmpeg.exe -i \"" << filePath << "\" -r " << QString::number( fps ) << " -f image2 \"" << tempPath << "tmp_import%4d.png\"";
        ffmpeg.start( "./plugins/ffmpeg.exe -i \"" + filePath + "\" -r " + QString::number( fps ) + " -f image2 \"" + tempPath + "tmp_import%4d.png\"" );
        progress.setValue( 20 );
        if ( ffmpeg.waitForStarted() == true )
        {
            if ( ffmpeg.waitForFinished() == true )
            {
                qDebug() << "stdout: " + ffmpeg.readAllStandardOutput();
                qDebug() << "stderr: " + ffmpeg.readAllStandardError();
            }
            else
            {
                qDebug() << "ERROR: FFmpeg did not finish executing.";
            }
        }
        else
        {
            qDebug() << "ERROR: Could not execute FFmpeg.";
        }
        progress.setValue( 50 );
        QDir dir1( tempPath );
        int nFiles = dir1.entryList().count();
        i = 1;
        QString frameNumberString = QString::number( i );
        while ( frameNumberString.length() < 4 ) frameNumberString.prepend( "0" );
        while ( QFile::exists( tempPath + "tmp_import" + frameNumberString + ".png" ) )
        {
            progress.setValue( 50 + i * 50 / nFiles );
            if ( i>1 ) scrubForward();
            importImage( tempPath + "tmp_import" + frameNumberString + ".png" );
            i++;
            frameNumberString = QString::number( i );
            while ( frameNumberString.length() < 4 ) frameNumberString.prepend( "0" );
        }
        progress.setValue( 100 );
        // --------- Clean up temp directory ---------
        QDir dir( tempPath );
        QStringList filtername( "*.*" );
        QStringList entries = dir.entryList( filtername, QDir::Files, QDir::Type );
        for ( int e = 0; e < entries.size(); e++ )
            dir.remove( entries[ e ] );
    }
    else
    {
        qDebug() << "Please place ffmpeg.exe in plugins directory";
    }
}
Exemple #9
0
void MainWindow2::createMenus()
{
    // ---------- File Menu -------------
    connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newDocument()));
    connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openDocument()));
    connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(saveAsNewDocument()));
    connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveDocument()));
    connect(ui->actionPrint, SIGNAL(triggered()), editor, SLOT(print()));
    connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(close()));

    /// --- Export Menu ---
    connect(ui->actionExport_X_sheet , SIGNAL(triggered()), editor, SLOT(exportX()));
    connect(ui->actionExport_Image_Sequence, SIGNAL(triggered()), editor, SLOT(exportSeq()));
    connect(ui->actionExport_Image, SIGNAL(triggered()), editor, SLOT(exportImage()));
    connect(ui->actionExport_Movie, SIGNAL(triggered()), editor, SLOT(exportMov()));

    //exportFlashAct = new QAction(tr("&Flash/SWF..."), this);
    //exportFlashAct->setShortcut(tr("Ctrl+Alt+F"));
    //connect(exportFlashAct, SIGNAL(triggered()), editor, SLOT(exportFlash()));

    connect(ui->actionExport_Palette, SIGNAL(triggered()), this, SLOT(exportPalette()));

    /// --- Import Menu ---
    connect(ui->actionExport_Svg_Image, SIGNAL(triggered()), editor, SLOT(saveSvg()));
    connect(ui->actionImport_Image, SIGNAL(triggered()), editor, SLOT(importImage()));
    connect(ui->actionImport_Image_Sequence, SIGNAL(triggered()), editor, SLOT(importImageSequence()));
    connect(ui->actionImport_Movie, SIGNAL(triggered()), editor, SLOT(importMov()));
    connect(ui->actionImport_Sound, SIGNAL(triggered()), editor, SLOT(importSound()));
    connect(ui->actionImport_Palette, SIGNAL(triggered()), this, SLOT(importPalette()));

    /// --- Edit Menu ---
    connect(ui->actionUndo, SIGNAL(triggered()), editor, SLOT(undo()));
    connect(ui->actionRedo, SIGNAL(triggered()), editor, SLOT(redo()));
    connect(ui->actionCut, SIGNAL(triggered()), editor, SLOT(cut()));
    connect(ui->actionCopy, SIGNAL(triggered()), editor, SLOT(copy()));
    connect(ui->actionPaste, SIGNAL(triggered()), editor, SLOT(paste()));
    connect(ui->actionDelete, SIGNAL(triggered()), editor, SLOT(clearCurrentFrame()));
    connect(ui->actionCrop, SIGNAL(triggered()), editor, SLOT(crop()));
    connect(ui->actionCrop_To_Selection, SIGNAL(triggered()), editor, SLOT(croptoselect()));
    connect(ui->actionSelect_All, SIGNAL(triggered()), editor, SIGNAL(selectAll()));
    connect(ui->actionDeselect_All, SIGNAL(triggered()), editor, SLOT(deselectAll()));
    connect(ui->actionPreference, SIGNAL(triggered()), this, SLOT(showPreferences()));

    ui->actionRedo->setEnabled(false);

    /// --- Layer Menu ---
    connect(ui->actionNew_Bitmap_Layer, SIGNAL(triggered()), editor, SLOT(newBitmapLayer()));
    connect(ui->actionNew_Vector_Layer, SIGNAL(triggered()), editor, SLOT(newVectorLayer()));
    connect(ui->actionNew_Sound_Layer, SIGNAL(triggered()), editor, SLOT(newSoundLayer()));
    connect(ui->actionNew_Camera_Layer, SIGNAL(triggered()), editor, SLOT(newCameraLayer()));
    connect(ui->actionDelete_Current_Layer, SIGNAL(triggered()), editor, SLOT(deleteCurrentLayer()));

    /// --- View Menu ---
    connect(ui->actionZoom_In, SIGNAL(triggered()), editor, SLOT(setzoom()));
    connect(ui->actionZoom_Out, SIGNAL(triggered()), editor, SLOT(setzoom1()));
    connect(ui->actionRotate_Clockwise, SIGNAL(triggered()), editor, SLOT(rotatecw()));
    connect(ui->actionRotate_Anticlosewise, SIGNAL(triggered()), editor, SLOT(rotateacw()));
    connect(ui->actionReset_Windows, SIGNAL(triggered()), this, SLOT(dockAllPalettes()));
    connect(ui->actionReset_View, SIGNAL(triggered()), editor, SLOT(resetView()));
    connect(ui->actionHorizontal_Flip, SIGNAL(triggered()), editor, SLOT(toggleMirror()));
    connect(ui->actionVertical_Flip, SIGNAL(triggered()), editor, SLOT(toggleMirrorV()));

    ui->actionPreview->setEnabled(false);
    //#	connect(previewAct, SIGNAL(triggered()), editor, SLOT(getCameraLayer()));//TODO: Preview view

    ui->actionGrid->setEnabled(false);
    connect(ui->actionGrid, SIGNAL(triggered()), editor, SLOT(gridview())); //TODO: Grid view

    connect(ui->actionOnionPrevious, SIGNAL(triggered(bool)), editor, SIGNAL(toggleOnionPrev(bool)));
    connect(editor, SIGNAL(onionPrevChanged(bool)), ui->actionOnionPrevious, SLOT(setChecked(bool)));

    connect(ui->actionOnionNext, SIGNAL(triggered(bool)), editor, SIGNAL(toggleOnionNext(bool)));
    connect(editor, SIGNAL(onionNextChanged(bool)), ui->actionOnionNext, SLOT(setChecked(bool)));

    /// --- Animation Menu ---
    connect(ui->actionPlay, SIGNAL(triggered()), editor, SLOT(play()));
    connect(ui->actionLoop, SIGNAL(triggered(bool)), editor, SLOT(setLoop(bool)));
    connect(ui->actionLoop, SIGNAL(toggled(bool)), editor, SIGNAL(toggleLoop(bool))); //TODO: WTF?
    connect(editor, SIGNAL(loopToggled(bool)), ui->actionLoop, SLOT(setChecked(bool)));

    connect(ui->actionAdd_Frame, SIGNAL(triggered()), editor, SLOT(addKey()));
    connect(ui->actionRemove_Frame, SIGNAL(triggered()), editor, SLOT(removeKey()));
    connect(ui->actionNext_Frame, SIGNAL(triggered()), editor, SLOT(playNextFrame()));
    connect(ui->actionPrevious_Frame, SIGNAL(triggered()), editor, SLOT(playPrevFrame()));
    connect(ui->actionNext_Keyframe, SIGNAL(triggered()), editor, SLOT(scrubNextKeyframe()));
    connect(ui->actionPrev_Keyframe, SIGNAL(triggered()), editor, SLOT(scrubPreviousKeyframe()));
    connect(ui->actionDuplicate_Frame, SIGNAL(triggered()), editor, SLOT(duplicateKey()));

    /// --- Tool Menu ---
    connect(ui->actionClear, SIGNAL(triggered()), editor, SLOT(clearCurrentFrame()));

    connect(ui->actionMove, SIGNAL(triggered()), m_toolSet, SLOT(moveOn()));
    connect(ui->actionSelect, SIGNAL(triggered()), m_toolSet, SLOT(selectOn()));
    connect(ui->actionBrush, SIGNAL(triggered()), m_toolSet, SLOT(brushOn()));
    connect(ui->actionPolyline, SIGNAL(triggered()), m_toolSet, SLOT(polylineOn()));
    connect(ui->actionSmudge, SIGNAL(triggered()), m_toolSet, SLOT(smudgeOn()));
    connect(ui->actionPen, SIGNAL(triggered()), m_toolSet, SLOT(penOn()));
    connect(ui->actionHand, SIGNAL(triggered()), m_toolSet, SLOT(handOn()));
    connect(ui->actionPencil, SIGNAL(triggered()), m_toolSet, SLOT(pencilOn()));
    connect(ui->actionBucket, SIGNAL(triggered()), m_toolSet, SLOT(bucketOn()));
    connect(ui->actionEyedropper, SIGNAL(triggered()), m_toolSet, SLOT(eyedropperOn()));
    connect(ui->actionEraser, SIGNAL(triggered()), m_toolSet, SLOT(eraserOn()));

    connect(ui->actionResetToolsDefault, SIGNAL(triggered()), this, SLOT(resetToolsSettings()));

    /// --- Help Menu ---
    connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(helpBox()));
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutPencil()));

    // --------------- Menus ------------------
    openRecentMenu = new QMenu(tr("Open recent"), this);

    connect(ui->menuEdit, SIGNAL(aboutToShow()), this, SLOT(undoActSetText()));
    connect(ui->menuEdit, SIGNAL(aboutToHide()), this, SLOT(undoActSetEnabled()));


}
void
ImageReader::readImage() {

    if (_filename.find(".feat") == _filename.size() - 5) {

        LOG_DEBUG(imagereaderlog) << "found simple image file, using own importer" << std::endl;

        uint32_t width, height;

        FILE* f = fopen(_filename.c_str(),"r");
        if (!fread(&width,sizeof(uint32_t),1,f))
            return;
        if (!fread(&height,sizeof(uint32_t),1,f))
            return;

        LOG_DEBUG(imagereaderlog) << "reading image of size " << width << "x" << height << std::endl;

        _imageData.reshape(vigra::MultiArray<2, float>::size_type(width, height));

        *_image = _imageData;

        float value;
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                if (!fread(&value,sizeof(float),1,f))
                    return;
                (*_image)(x, y) = value;
            }
        }

        fclose(f);

        LOG_DEBUG(imagereaderlog) << "Read data  (0,0): " << _imageData[0,0] << std::endl;
        LOG_DEBUG(imagereaderlog) << "Read image (0,0): " << (*_image)(0,0) << std::endl;
        return;
    }

    // get information about the image to read
    vigra::ImageImportInfo info(_filename.c_str());

    // abort if image is not grayscale
    if (!info.isGrayscale()) {

        LOG_ERROR(imagereaderlog) << _filename << " is not a gray-scale image!" << std::endl;
        return;
    }
    _imageData.reshape(vigra::MultiArray<2, float>::size_type(info.width(), info.height()));

    // resize image
    *_image = _imageData;

    // read image
    importImage(info, vigra::destImage(*_image));

    if (strcmp(info.getPixelType(), "FLOAT") == 0)
        return;

    // scale image to [0..1]

    float factor;
    if (strcmp(info.getPixelType(), "UINT8") == 0)
        factor = 255.0;
    else if (strcmp(info.getPixelType(), "INT16") == 0)
        factor = 511.0;
    else {

        LOG_ERROR(imagereaderlog) << _filename << " has a unsupported pixel format: " << info.getPixelType() << std::endl;
    }

    vigra::transformImage(
        vigra::srcImageRange(*_image),
        vigra::destImage(*_image),
        vigra::linearIntensityTransform<float>(1.0/factor));
}
int main(int argv, char** argc)
{
	std::string fInPath;
	fInPath += argc[1];
	int length = atoi(argc[2]);
	int width = atoi(argc[3]);

	unsigned char **origImage = (unsigned char **)malloc(sizeof(unsigned char *)*length);
	for(int i = 0; i<length; i++)
	{
		origImage[i] = (unsigned char *)malloc(sizeof(unsigned char)*width);
		for(int j = 0; j<width; j++)
			origImage[i][j] = 0;
	}

	//Import Image
	importImage(fInPath, origImage, length, width);
	printf("Importing image\n");

	//Copy Image for Horz and Vertical Sobels
	unsigned char **horizImage = (unsigned char **)malloc(sizeof(unsigned char *)*length);
	for(int i = 0; i<length; i++)
	{
		horizImage[i] = (unsigned char *)malloc(sizeof(unsigned char)*width);
		for(int j = 0; j<width; j++)
			horizImage[i][j] = 0;
	}
	
	unsigned char **vertiImage = (unsigned char **)malloc(sizeof(unsigned char *)*length);
	for(int i = 0; i<length; i++)
	{
		vertiImage[i] = (unsigned char *)malloc(sizeof(unsigned char)*width);
		for(int j = 0; j<width; j++)
			vertiImage[i][j] = 0;
	}

	printf("coping images to horizImage and vertiImage\n");
	copyImage(origImage, length, width, horizImage);
	copyImage(origImage, length, width, vertiImage);

	printf("getting horiz\n");
	//Apply Horiz Sobel
	HorizSobel(horizImage, length, width);
	std::string horizPath;
	horizPath += fInPath;
	horizPath += "_Horiz";

	saveImage(horizPath, horizImage, length, width);
	viewImage(horizPath, length, width);
	
	printf("getting verti\n");
	//Apply Vertical Sobel
	VertiSobel(vertiImage, length, width);
	std::string vertiPath;
	vertiPath += fInPath;
	vertiPath += "_Verti";

	saveImage(vertiPath, vertiImage, length, width);
	viewImage(vertiPath, length, width);
	
	//Add together
	unsigned char **sobelImage = (unsigned char **)malloc(sizeof(unsigned char *)*length);
	for(int i = 0; i<length; i++)
	{
		sobelImage[i] = (unsigned char *)malloc(sizeof(unsigned char)*width);
		for(int j = 0; j<width; j++)
			sobelImage[i][j] = 0;
	}

	AddImages(sobelImage, horizImage, length, width);
	AddImages(sobelImage, vertiImage, length, width);

	//Save and View Image
	std::string fOutPath;
	fOutPath += fInPath;
	fOutPath += "_Sobel";

	saveImage(fOutPath, sobelImage, length, width);
	viewImage(fOutPath, length, width);
	/**/

}