Ask Your Question

Mohamadi's profile - activity

2016-04-15 16:30:41 -0600 commented question cv::exeption ?????????

ok thank's

2016-04-15 14:29:08 -0600 commented question cv::exeption ?????????

sorry for this late

2016-04-14 13:49:33 -0600 received badge  Editor (source)
2016-04-14 13:30:22 -0600 commented question cv::exeption ?????????

ok i will edit my question

2016-04-14 13:29:26 -0600 commented question cv::exeption ?????????

yes ok i am sorry

2016-04-14 13:28:07 -0600 commented question cv::exeption ?????????

it is very lisibal to copy the code in visual studio or any envirement and i am sorry because i didn't find a way to poste my code thank you for helping

2016-04-14 13:15:19 -0600 commented question cv::exeption ?????????

yes it is very long but i will show it for you

2016-04-13 16:09:00 -0600 asked a question cv::exeption ?????????

Hi please help me to solve this problem in open cv 3.1.0 i had implemented a gaborEnhancement filter and when i call this function it generate this exeption Unhandled exception at 0x00007FFF9B925BF8 in test.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000D2BF2BDD20. and get me here --> CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));image description

and when i make this in mat.inl.hpp as a commentaire like that:

//CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));

it go normal and no error produce

here is the code in the main

/*

*

* Author: Zhongrui Li
 * Supervisor: Wonsook Lee
 * [email protected], [email protected]
 * EECS, Faculty of Engineering, University of Ottawa, Canada
 *
 * Date: March 20th, 2015
 *
 */
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "enhancedgabor.h"
#include <iostream>
#include "gabor.h"
using namespace std;
using namespace cv;

int main(int argc, char *argv[])
{
    /*enhancedGabor eng;
    Mat in = imread("seg.tif",0);
    Mat out = eng.EnhancedGaborFilter(in);
    imshow("inherenced", out);*/
    Gabor g;
    Mat in = imread("seg.tif",0);
    Mat out = g.ImagPart(in);
    imshow("inherenced", out);

    waitKey(0);
    return 0;
}


the two librery are 
in enhanceGabor.cpp

    #include "enhancedgabor.h"
#include <math.h>
#include <cmath>
#include "matlabhelper.h"
#include <iostream>
#include <map>


const double eps = 2.2204e-16;
const double PI = 3.1415926535898;
using namespace cv;
using namespace std;

enhancedGabor::enhancedGabor()
{
    blk_sze_mask = 10;
    blk_sze = 10;
    thres_h = 0.07;
}

Mat enhancedGabor::EnhancedGaborFilter(const Mat & _img)
{
    Mat img;
    _img.Mat::convertTo(img, CV_64FC1);
    /**Image enhancement (Frequency estimation for each block)***/

    /*1******************************************/
    Mat normim, maskImg;
    RidgeSegment(img,blk_sze_mask,thres_h, normim, maskImg);
    /********************************************/

    /*2******************************************/
    Mat orientim, reliability;
    RidgeOrient(normim, 0.5, 20, 5, orientim, reliability);
    /********************************************/


    /**Frequency estimation for each block***/
    /*3******************************************/
    Mat freq;
    double medianFreq = 0;
    medianFreq = RidgeFreq(normim, maskImg, orientim, blk_sze, 3, 5, 15, freq);
    /********************************************/
    multiply(medianFreq, maskImg, freq);
    divide(freq, 255, freq);

    /**Orientation calculation of blocks***/
    /*4*******************************************/
    Mat newIm;
    RidgeFilter(normim, orientim, freq, 1, 1, 1, newIm);
    /********************************************/

    Mat binIm = newIm.clone();
    double *bi;
    for(int i = 0; i<binIm.rows; i++)
    {
        bi = binIm.ptr<double>(i);
        for(int j = 0; j < binIm.cols; j++)
        {
            if(bi[j]/255 > 0.2)
                bi[j] = 255;
            else
                bi[j] = 0;
        }
    }

    /**Thresholding - Gray to Binary***/
    double *r;
    for(int i = 0; i<reliability.rows; i++)
    {
        r = reliability.ptr<double>(i);
        for(int j = 0; j < reliability.cols; j++)
        {
            if(r[j]/255 > 0.25)
                r[j] = 1;
            else
                r[j] = 0;
        }
    }
    Mat imgEnhanced;
    multiply(binIm, maskImg, imgEnhanced);
    multiply(imgEnhanced, reliability, imgEnhanced);
    divide(imgEnhanced, 255, imgEnhanced);

    /*for(int i = 0; i<imgEnhanced.rows; i++)
    {
        for(int j = 0; j<imgEnhanced.rows; j++)
        {
            if(imgEnhanced.at<unsigned int>(i,j) != 0)
                imgEnhanced.at<unsigned int>(i,j) =255;
        }
    }*/
    //std::cout<<format(imgEnhanced,"numpy")<<std::endl;

    return imgEnhanced;
}

/*1. RidgeSegment - Function to ormalise fingerprint image and segments ridge region*/
void enhancedGabor::RidgeSegment(const Mat & _im, int _blockSize, double _thresHold, Mat & normim,Mat & maskImg)
{
    double sum = 0;
    _thresHold *= 255;
    std::vector<int> maskind;

    //normalise to have zero ...
(more)
2016-04-12 00:51:09 -0600 asked a question createLinearFilter is not member of cv

hi; please i am working in project of fingerprint recognation and this code in c++ generate this error : createLinearFilter is not member of cv the instruction of code : cv::Ptr <cv::filterengine> fe = cv::createLinearFilter(CV_32FC1, CV_32FC1, gaussKernel, cv::Point(0, 0), 0, cv::BORDER_CONSTANT, cv::BORDER_CONSTANT, cv::Scalar(0)); fe->apply(freqMat, frequencyImage);

by now me i am with opencv 3.0.1 i know that FilterEngine is not member but createLinearFilter i don't know so please help to write these instructions of code using opencv 3.0.1 Thank you in first