Ask Your Question

Fiong's profile - activity

2019-04-15 15:18:23 -0600 received badge  Famous Question (source)
2018-09-24 03:51:36 -0600 received badge  Popular Question (source)
2017-11-29 11:05:41 -0600 received badge  Notable Question (source)
2017-01-26 02:38:26 -0600 received badge  Popular Question (source)
2015-05-18 03:25:44 -0600 commented question Any image labeling tool for object detection?

Hi, any document about how to use it ? Thanks

2015-05-12 03:20:09 -0600 asked a question Any suggested image annotation/labeling tool for object detection?

I want to create my own training dataset for object detection in image. Does anyone know some good image labeling tools?

p.s. Labelme is not suitable for my case as it is web-based and the data uploaded will be in public.

Thanks in advance!

2015-05-06 04:36:38 -0600 asked a question Any image labeling tool for object detection?

I want to create my own training dataset for object detection in image. Does anyone know some good image labeling tools?

p.s. Labelme is not suitable for my case as it is web-based and the data uploaded will be in public.

Thanks in advance!

2015-03-01 20:34:16 -0600 asked a question Converting Matlab code to OpenCV (C,C++) code

I would appreciate it if someone can help to covert the Matlab code below to OpenCV (c, c++) code, thanks in advance!!!

Basically, the code is used to remove the text region of a document image, results can be found: http://imgur.com/vEmpavY,dd172fr#1

   %%%%%%%%%%%%
% Set these values depending on your input image

img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/21044/6ce011abjw1elr8moiof7j20jg0w9jyt.jpg');

MinArea = 2000; % Minimum area to consider, in pixels
%%%%%%%%%
% End User inputs

gsImg = 255 - rgb2gray(img); % convert to grayscale (and invert 'cause that's how I think)
threshImg = gsImg > graythresh(gsImg)*max(gsImg(:)); % Threshold automatically

% Detect regions, using the saturation in place of 'intensity'
regs = regionprops(threshImg, 'BoundingBox', 'Area');

% Process regions to conform to area and saturation thresholds
regKeep = false(length(regs), 1);
for k = 1:length(regs)

    regKeep(k) = (regs(k).Area > MinArea);

end

regs(~regKeep) = []; % Delete those regions that don't pass qualifications for image

% Make a new blank image to hold the passed regions
newImg = 255*ones(size(img), 'uint8');

for k = 1:length(regs)

    boxHere = regs(k).BoundingBox; % Pull out bounding box for current region
    boxHere([1 2]) = floor(boxHere([1 2])); % Round starting points down to next integer
    boxHere([3 4]) = ceil(boxHere([3 4])); % Round ranges up to next integer
    % Insert pixels within bounding box from original image into the new
    % image
    newImg(boxHere(2):(boxHere(2)+boxHere(4)), ...
        boxHere(1):(boxHere(1)+boxHere(3)), :) = img(boxHere(2):(boxHere(2)+boxHere(4)), ...
        boxHere(1):(boxHere(1)+boxHere(3)), :);

end

% Display
figure()
image(newImg);
2015-02-09 04:22:20 -0600 received badge  Teacher (source)
2015-02-09 04:13:36 -0600 received badge  Self-Learner (source)
2015-02-09 04:12:12 -0600 answered a question knnMatch in version 2.4.10

Finally, I solved the problem by changing the declaration of matches :

to be:

  vector<vector<DMatch>> matches;
2015-02-05 22:25:43 -0600 commented answer knnMatch in version 2.4.10

The error is: no instance of overloaded function "cv::DescriptorMatcher::knnMatch" matches the argument list

2015-02-05 04:04:14 -0600 commented answer knnMatch in version 2.4.10

Hi, I have tried you code, but it still doesn't work. Have you tested it? Thanks!

2015-02-04 03:37:44 -0600 commented answer How to remove text region in a document image?

Thanks for you answer, quite interesting.

2015-02-04 03:35:28 -0600 received badge  Enthusiast
2015-02-01 20:13:40 -0600 asked a question How to remove text region in a document image?

How to remove text region in a document image? Given an document image (i.e. newspaper), how to extract photos in it or remove text region?

I think traditional OCR methods may not be suitable here, as I don't need to recognize the text, and OCR is not accurate and slow. I believe text region (i.e. text blocks) and image region should be distinguishable by some threshold based methods in image processing. Any suggestions or example codes in OpenCV will be appreciated. Thanks!

BTW, what if the background color is not white, or the background color of certain blocks are not white?

Example image:

image description

2015-01-28 02:58:39 -0600 asked a question knnMatch in version 2.4.10

Anyone know how to call knnMatch in version 2.4.10?

I used it in this way, but it doesn't work and met errors. Anyone know how to use it?

std::vector< DMatch > matches;  
BFMatcher matcher(NORM_L2, true); 
Mat mask;
matcher.knnMatch(descriptors_1, descriptors_2, matches, 2, mask, false);  // Find two nearest matches
2015-01-27 04:04:03 -0600 asked a question error: detector.detect, image size too large

I met errors when I extract SIFT for a large image. It is ok for smaller image.

Does anyone know how to solve it? Does the size of the image matter?

The size of the image is 2816 * 2122. The code I used is:

SiftFeatureDetector detector;    
std::vector<KeyPoint> keypoints_object;      
detector.detect(img, keypoints_object);  // Here I met errors.

The error I met:

image description

2015-01-27 02:38:58 -0600 asked a question How to constrain RANSAC when using findHomography? object detection

I want to do the matching between images, I have used SIFT as the feature and use RANSAC for improve the matching. Some results are good, but some failed. Can anyone tell me how to improve it? I think my implementation should be right as I got some good results.

The steps I do the experiment are:

Step1: Extract SIFT feature;

Step2: Use FlannBasedMatcher to do the matching;

Step3: Use RANSAC to correct the matching; // but I found too many points are matched to a single point

Below are the core code for my experiment:

 FlannBasedMatcher matcher; 

 std::vector< DMatch > matches;  

 matcher.match( descriptors_1, descriptors_2, matches );  

 double max_dist = 0;   
 double min_dist = 100;  

 for( int i = 0; i < descriptors_1.rows; i++ )  
{   
    double dist = matches[i].distance;  
    if( dist < min_dist ) min_dist = dist;  
    if( dist > max_dist ) max_dist = dist;  
}  
for( int i = 0; i < descriptors_1.rows; i++ )  
{   
    if( matches[i].distance < max_dist)
    {   
        good_matches.push_back( matches[i]);   //keep all the matches
    }  
}  

H = findHomography( tmp_obj, tmp_scene, CV_RANSAC, 3.0, Mask); 

    for (int i = 0; i< good_matches.size(); i ++)
    {

        if (Mask.at<uchar>(i) != 0)  // RANSAC selection
        {


            obj.push_back( keypoints_object[ good_matches[i].queryIdx ].pt );  
            scene.push_back( keypoints_scene[ good_matches[i].trainIdx ].pt );   

            good_matches2.push_back(good_matches[i]);

            numGood = numGood + 1;

        }

    }

some failed case:

image description

image description

2014-12-04 03:27:48 -0600 received badge  Student (source)
2014-12-03 19:04:33 -0600 commented answer ASIFT with OpenCV

Hi, I have tried your code, but it doesn't work and met errors. Is your code completed? Thanks

2014-12-03 02:19:02 -0600 asked a question ASIFT with OpenCV

I want to try ASIFT (http://www.cmap.polytechnique.fr/~yu/research/ASIFT/demo.html) with OpenCV.

I found both the python and C++ version are already done by someone :

Python version: github.com/Itseez/opencv/blob/master/samples/python2/asift.py,

C++ version: http://www.mattsheckells.com/opencv-asift-c-implementation/

I want to use the C++ version, but I cannot run the code successfully. Can anyone take a look and test it? If it works, kindly let me know the setup or the link where I can download. If not, can you also tell me the problems and how to solve it? I would really appreciate that, thanks in advance!

2014-12-03 01:03:18 -0600 asked a question ASIFT with opencv, C++

Hi all,

I want to try ASIFT (http://www.cmap.polytechnique.fr/~yu/research/ASIFT/demo.html) with OpenCV.

I found both the python and C++ version are already done by someone :

Python version: https://github.com/Itseez/opencv/blob/master/samples/python2/asift.py,

C++ version: http://www.mattsheckells.com/opencv-asift-c-implementation/

I want to use the C++ version, but I cannot run the code successfully. Can anyone take a look and test it? If it works, kindly let me know the setup or the link where I can download. If not, can you also tell me the problems and how to solve it? I would really appreciate that, thanks in advance!