Ask Your Question

benz's profile - activity

2018-05-21 20:20:16 -0600 commented question classifier problem of charaters or numbers

I'm trying the first approach, berak, thanks so much

2018-05-21 01:18:48 -0600 commented question classifier problem of charaters or numbers

My expectation for the other object found by findContours should be -1, and numbers and chars returns the correct label

2018-05-21 01:12:38 -0600 commented question classifier problem of charaters or numbers

My expectation for the other object found by findContours should be -1, and numbers and chars returns the correct label

2018-05-20 20:49:39 -0600 asked a question classifier problem of charaters or numbers

classifier problem of charaters or numbers I used HOG and SVM to train and classify the charaters or numbers for OCR. Ev

2016-07-07 20:31:04 -0600 commented answer define marker and detect the number of markers

Thank you, Tetragramm, I hope I can find other way around.

2016-07-04 23:23:26 -0600 commented answer define marker and detect the number of markers

when I try to use different params as input to detect the markers, both aruco2.0.7 and contrib-3.1.0-aruco are not so good, because my print quality is not so good. so I take a look into the source code of 2.0.7, it uses findContours to find contours, then judge if it is a rectangle by check if approxCurve = 4. oh, opencv contrib can be coded like that?

I want to give up ARUCO now.

2016-07-03 09:41:57 -0600 commented answer define marker and detect the number of markers

I used code from sourceforge, because I have downloaded the source code before this thread. it seems I have made some mistakes. Thanks so much, Tetragramm, I will try to print those markers to the target then make a try tomorrow.

2016-07-03 03:59:46 -0600 commented answer define marker and detect the number of markers
2016-07-03 03:51:04 -0600 commented answer define marker and detect the number of markers

I tested aruco, the detection results are very bad. firstly, I created marker(ARUCO_MIP_36h12) file by aruco_print_marker.exe, then I used MS paint to create an image, pasted several ARUCO_MIP_36h12 markers in a white board, save it. after that, I used aruco_simple.exe to detect, only one is found. This is unacceptable.

2016-07-02 10:55:41 -0600 received badge  Editor (source)
2016-07-02 10:52:13 -0600 asked a question define marker and detect the number of markers

We need print several shape or marker in a special object, then we do a detection to calculate the number of markers. After research from many tutorials, I have the following questions,

  • What marker should I print.

The object is a rectangle shape, I can define the marker to print, I think it's better to print circles on the surface, what shape do you recommend?

  • How to find the markers

I learnt a lot from feature2d, historam match and template match, as well as ORB, LBP, BRISK,FREAK,SIFT, SURF etc. But these detect and compute methods seems not so good for this case.

  • How to define the features?

can we use pre-defined feature set to detect the target markers?

  • How to find the ROI

I have an idea, I don't know if it is feasible. I use the camera to take an background image firstly, then after capture the object, use minus to get the object. Mat background (from camera); Mat withObject (from camera); Mat target = withObject - background; after do that, I can see there is no background now. However, I don't how to figure out the shape of object. seems I can use the following code:

int threhold = 1;//the original background is 0

threhold(withObject , outputMat, threhold, 255, CV_BINARY_INV);

findContours(....)

Thanks a lot for your advices in advanced.

EDITS. This is my object to be detected. The marker is ARUCO markers image description

EDITS 2. My print version of image by ARUCO marker image description

2016-06-19 02:46:23 -0600 received badge  Enthusiast
2016-03-31 21:01:16 -0600 received badge  Scholar (source)
2016-03-31 20:59:02 -0600 commented answer Detect numbers and calculate it in box

Thank you very much, Tetragramm, now I can remove lines, and use findCoutours to remove specks. Finally, I set the ROI by the location of vertical line.

2016-03-31 20:56:03 -0600 commented answer Detect numbers and calculate it in box

Thank you very much

2016-03-29 01:45:05 -0600 commented answer Detect numbers and calculate it in box

the pic is taken by AVT Manta Camera, and the direction of bundle will change a little bit, so the vertical or horizontal lines are not that straight forward, sometimes inclined, I tried to remove lines, but morphologyEx give me too much of specks and some inclined line, seems hard to remove.

2016-03-23 21:52:39 -0600 asked a question Detect numbers and calculate it in box

I'm a beginer for OpenCV, currently I'm working on a project to detect the numbers in a box on the banknote bundle. The objective for machine vision is to count the amount of numbers printed in the bundle.

A bundle has ten packages, which as 100 banknotes. Each package has an encapsulated with the printed number(1,2,...9), and the numbers are the same in one bundle. plus, there is a plastic film cover on the bundle.

Sample as follow

image description

There may be some reflected light on it under illumination condition.

A friend told me a method how to do it. The approach so far is the following:

  1. grayscale
  2. mean filter (boxFilter)
  3. binarization (adaptive threshold)
  4. remove noise in connected components, kernel less then 10 (I don't know how to do it)
  5. dilate (with structure Mat (-4, 4, -12, 12) )
  6. remove noise in connected components, (remove the little things)
  7. count connected components.

The followings are the steps. 1. gray 2. boxFilter(src, outMat, -1, Size(1, 1)); the channel is 1. 3. adaptiveThreshold(src, outMat, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY_INV, 35, 13); image description this result seems very good, if I dilate it right here, it seems I can easily get the connected components, then I can use findContours to calculate the amount of number "2".

However my friend prefers to follow his steps, and get a result like

image description

My questions list as follows,

  1. what is the good approach ? I'm care about the performance, the total calculate time should less then 300ms
  2. should I use connected components to do it, or use findCoutours ? Actually, I don't know how to calculate connected components, I think it use findContours also.
  3. how to remove noises ?
  4. should I use equalizeHist to equalize the source because different illumination condition ?

Thank you in advance, I'm very appreciated for your advices.