Project1--Marker Detection--

08/11/2012 17:00

Want to do marker detection on OpenCV: marker position, pose, distinguish between several kinds of marker...

Found a topic on the reference book, however, not to easy to implement for my case.

 

Now, start with the basic things as same as things on the book.

On reference book pp.69, it says:

"Here is the workflow of the marker detection routine:"

1. Convert the input image to grayscale.

2. Perform binary threshold operation.

3. Detect contours.

4. Search for possible markers.

5. Detect and decode markers.

6. Estimate marker 3D pose.

 

1. I'll modify on the project0.

Points:       cv::cvtColor

need input mat, output mat, option, channel number.

 

2. As mentioned in the book, the binarization prefers adaptive binarization.

I copyed the book's code.

 

3. use cv::findContours function.

However, what does the std::vector> says?

cv::Point というベクトルを指すポインターという意味かしら。

contours.push_backはallContours[i]をcoutoursの末尾に追加するようです。So, this function must be renewing the countours function with the newly defined one which was modified by threshold minContourPointsAllowed.

I copyed the code for checking contours from the original source at "https://github.com/MasteringOpenCV/code/blob/master/Chapter2_iPhoneAR/Example_MarkerBasedAR/Example_MarkerBasedAR/MarkerDetector.cpp"

 

4. This search was tough. First, check for vertices, then, distance between consecutive points.

 

 

My first code to implement marker detection will be uploaded as "code1" in "Codes" section.

...This making process tires me, for I've never done this complicated steps...

ちょっと複雑なので、初めから考えてみることにします。