Select part of an image
I want to identify things in an image by 'drawing' a rectangle round them. E.g. to select a face in a crowd.开发者_StackOverflow中文版 A sign in a street etc.
How to use the mouse events to a) mousedown to start select area Grow a 'rectangle' to follow the mouse movements. b) mouseup to end selection. Retrieve the xy, xy of the box for use in further processing. I'd like x and y values of the rectangle to be relative to the img element with id value 'image' if that's possible please.
精彩评论