<div>I've taken a look at the digikam database design. I want to be able to save a tag position within the picture; positions just need to be rectangles - no fancy shapes needed - so I need to store two opposite corners, that is four integer fields (or one text field). This kind of information is needed for face recognition.</div>
<div><br></div><div>Option 1: </div><div>There's an imagetags table with fields imageid, tagid which have to be unique. That's a problem because someone may want to use a tag more than once in the same picture (if region tagging is available, of course). So I can't just add the four position fields to the imagetags table... or can I?</div>
<div><br></div><div>Advantage of this approach --> regional tagging would be enabled for every possible tag.</div><div><br></div><div> </div><div>Option 2: </div><div>Make the face tag a special kind of tag. That way two new tables would be needed:</div>
<div>- faces: faceid, tagid (could be null)</div><div>- imagefaces: imageid, faceid, x1, y1, x2, y2</div><div><br></div><div>The second option is better suited to the face recognition problem:</div><div>1. A face detection algorithm would fill the faces table giving 0 to the faceid field in the imagefaces table.</div>
<div>2. Once faces are detected, some clustering technique is needed to look for different faces, so it would assign a positive value to face id. It then would ask the user to assing tags to faces.</div><div><br></div><div>
<br></div><div>What database approach is better? </div><div> </div><br>-- <br>Claudio<br>