Image Area Tagging
Created by: Lester Caine, Last modification: 13 May 2010 (11:37 UTC)
One of the facilities that I've been waiting to implement is something which Facebook seems to think they have invented ... Identifying the people on the group photos of my genealogical content. I have a number of pictures that have been mapped 'manually', but obviously automating this process will make this process easier. Ideally I want to be able to click on a person, or place and either produce a drop down of other related information, or simply jump to another content item.
view_image_tagged.php has picked up the jquery.ui locatable box and in theory allows a number of these to be added to an image. There is a little problem at the moment as the box position is not being passed back to the post data. I'm just getting the default position back.
One of the other things that need doing is to create a table for the attached tags. This is just a list of size and position and only need four numbers per tag. I am fairly happy that the tags themselves are simply comment elements, which provides more than enough structure for each tag. And 'thread_forward_sequence' could store the size and position of the boundary box. Alternatively should this be added to liberty as part of mime, since these tagged images should ideally be usable in other content. Editing tags need not be available when creating a simple image view.
Another use of this facility would be to either crop images or create new images by cropping an element of a larger picture. Thumbnails for each tagged element. One of the pictures I have digitized is a large secondary school picture, and showing each pupil individually would be a nice addition.
Source material for image tagging
CREATE TABLE LIBERTY_ATTACHMENT_TAGS
(
ATTACHMENT_ID Integer NOT NULL,
COMMENT_ID Integer NOT NULL,
TAG_TOP Integer DEFAULT 0 NOT NULL,
TAG_LEFT Integer DEFAULT 0 NOT NULL,
TAG_WIDTH Integer DEFAULT 100 NOT NULL,
TAG_HEIGHT Integer DEFAULT 100 NOT NULL,
PRIMARY KEY (ATTACHMENT_ID,COMMENT_ID)
);
ALTER TABLE LIBERTY_ATTACHMENT_TAGS ADD CONSTRAINT LIB_ATTACHMENT_TAGS_ID_REF
FOREIGN KEY (ATTACHMENT_ID) REFERENCES LIBERTY_ATTACHMENTS (ATTACHMENT_ID);
ALTER TABLE LIBERTY_ATTACHMENT_TAGS ADD CONSTRAINT LIB_ATTACHMENT_TAGS_CID_REF
FOREIGN KEY (COMMENT_ID) REFERENCES LIBERTY_COMMENTS (COMMENT_ID);
I have added a new mime handler for taggedimage, and am slowly working through getting it to update things to this table. The intention would be that we could 'edit' an existing image to add area tags, and that would simply change it's mime type to 'mimetaggedimage'. The tagged items would then be displayed using an alternative template file, and tags would be loaded via the handler.
view_image_tagged.php has picked up the jquery.ui locatable box and in theory allows a number of these to be added to an image. There is a little problem at the moment as the box position is not being passed back to the post data. I'm just getting the default position back.
One of the other things that need doing is to create a table for the attached tags. This is just a list of size and position and only need four numbers per tag. I am fairly happy that the tags themselves are simply comment elements, which provides more than enough structure for each tag. And 'thread_forward_sequence' could store the size and position of the boundary box. Alternatively should this be added to liberty as part of mime, since these tagged images should ideally be usable in other content. Editing tags need not be available when creating a simple image view.
Another use of this facility would be to either crop images or create new images by cropping an element of a larger picture. Thumbnails for each tagged element. One of the pictures I have digitized is a large secondary school picture, and showing each pupil individually would be a nice addition.
Source material for image tagging
Initial proposal for table
CREATE TABLE LIBERTY_ATTACHMENT_TAGS
(
ATTACHMENT_ID Integer NOT NULL,
COMMENT_ID Integer NOT NULL,
TAG_TOP Integer DEFAULT 0 NOT NULL,
TAG_LEFT Integer DEFAULT 0 NOT NULL,
TAG_WIDTH Integer DEFAULT 100 NOT NULL,
TAG_HEIGHT Integer DEFAULT 100 NOT NULL,
PRIMARY KEY (ATTACHMENT_ID,COMMENT_ID)
);
ALTER TABLE LIBERTY_ATTACHMENT_TAGS ADD CONSTRAINT LIB_ATTACHMENT_TAGS_ID_REF
FOREIGN KEY (ATTACHMENT_ID) REFERENCES LIBERTY_ATTACHMENTS (ATTACHMENT_ID);
ALTER TABLE LIBERTY_ATTACHMENT_TAGS ADD CONSTRAINT LIB_ATTACHMENT_TAGS_CID_REF
FOREIGN KEY (COMMENT_ID) REFERENCES LIBERTY_COMMENTS (COMMENT_ID);
I have added a new mime handler for taggedimage, and am slowly working through getting it to update things to this table. The intention would be that we could 'edit' an existing image to add area tags, and that would simply change it's mime type to 'mimetaggedimage'. The tagged items would then be displayed using an alternative template file, and tags would be loaded via the handler.