Draw contours into chain code

asked 2018-04-28 20:44:58 -0500

ugurcabuk gravatar image


I have absolute chain code(freeman) that was converted from the image. At the same time, I have also relative chain code that was converted from absolute chain code. So, the question is that I could draw contours from absolute chain code. But on the other hand, I couldn't draw contours from relative chain. So, what's wrong ? If the question is not clear, I can upload them which exists results.

edit retag flag offensive close merge delete


I couldn't draw contours from relative chain.

you would need an offset, the 1st point of the contour

berak gravatar imageberak ( 2018-04-29 01:36:15 -0500 )edit

Okay, I saw it and check it. Using absolute chain code, It is okay. I could draw but ıt doesn't work for relative chain code. Let me show you.

ugurcabuk gravatar imageugurcabuk ( 2018-04-29 07:52:16 -0500 )edit

https://image.slidesharecdn.com/image.... Here, firstly, you convert chain code into image,which is called as absolute chain code. Then, you have to think that the image have different rotates, I mean images can be vertical, horizantal sth like that. So, you have to convert differential(relative) chain into absolute chain. There is no problem for chain code, but the other,which is first difference, I couldn't draw. Is it normal ? By the way, in the picture, there is four rotate, you just think original rotate, which is 8,.

ugurcabuk gravatar imageugurcabuk ( 2018-04-29 08:02:44 -0500 )edit

i still wonder, what an "absolute chaincode" might be. the contour itself ? please explain.

also, 4 or 8 connected chaincode ? (the img in your link has 4, the link below the answer has 8)

rotation also matters (cw / ccw)

berak gravatar imageberak ( 2018-04-29 08:22:07 -0500 )edit

I just couldn't find 8-connected about relative chain code on the internet. Normally, there is two chain code algorithm 4 and 8. I also use 8-connected It's my mistake, I couldn't explain :) Check this video from 26:10 to 33:00. It's very clear. https://www.youtube.com/watch?v=Dd3xW...

ugurcabuk gravatar imageugurcabuk ( 2018-04-29 08:32:25 -0500 )edit