Gimp-Forum.net
define polygons on image and export points? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: define polygons on image and export points? (/Thread-define-polygons-on-image-and-export-points)



define polygons on image and export points? - mixedup - 01-15-2021

Could GIMP help me out with the following?  (re a tool that could do this).  If yes any pointers re what GIMP feature to dive into to try: 

  1. Open a background image and scale to standard background size I need.
  2. Define Areas - Define multiple areas on the image (e.g. Rect, Circle, Polygon) by tracing around key items (e.g. light, button, chair etc).
  3. Export Area Data - Can export the data that describes these tracings (e.g. x,y co-ordinates for Polygon, position & radius for circle) when required.  Would provide a list of data for each traced object, then can import into my application and read this.    [could be just polygons only]
  4. Export images for the areas defined from (2) - so after exporting for one images there might be several smaller images that would be exported (e.g. clipped image of the chair)
  5. Can come back later and load/still have the areas defined, and adjust them and re-export data and images.
  6. Overall output from one background image with areas defined on the image:
    • Exports a data file defines the different areas (polygons etc)
    • Exports the “cut out” images for each of these 



RE: define polygons on image and export points? - Ofnuts - 01-15-2021

(01-15-2021, 03:16 AM)mixedup Wrote: Could GIMP help me out with the following?  (re a tool that could do this).  If yes any pointers re what GIMP feature to dive into to try: 

  1. Open a background image and scale to standard background size I need.
  2. Define Areas - Define multiple areas on the image (e.g. Rect, Circle, Polygon) by tracing around key items (e.g. light, button, chair etc).
  3. Export Area Data - Can export the data that describes these tracings (e.g. x,y co-ordinates for Polygon, position & radius for circle) when required.  Would provide a list of data for each traced object, then can import into my application and read this.    [could be just polygons only]
  4. Export images for the areas defined from (2) - so after exporting for one images there might be several smaller images that would be exported (e.g. clipped image of the chair)
  5. Can come back later and load/still have the areas defined, and adjust them and re-export data and images.
  6. Overall output from one background image with areas defined on the image:
    • Exports a data file defines the different areas (polygons etc)
    • Exports the “cut out” images for each of these 

1, 2, 3: Define a path that encloses each object then export to CSV with my path-csv script. The CSV will contain among other things the X-Y coordinates of the path anchors. This will do polygons only...

4: Currently my best shot at it would be to make a selection from your path (Select>From path), invert it (Select>Invert), hit [delete] to delete the background, and then use my ofn-extract-objects script to export the non-transparent areas. It wouldn't be too hard to chnage the script a bit to work with an existing path, though.

5: The path you define is saved with the image (if you use the XCF format) and can be edited further.


RE: define polygons on image and export points? - mixedup - 01-16-2021

thanks - I'll try this out