First of all, let me explain the whole idea to make easy to focus my question:
I would like to analyze color from a group of images acquired by a time-lapse camera, for example studing the pizel colors like this (just a simple example):
https://forum.lazarus.freepascal.org/index.php?topic=37242.0or showing the color histograms.
To do it, i have a TPicture where one of the images is loaded as the base where the user should be able to draw one or more areas of interest on runtime (that could be saved to be loaded latter without requiring to draw them again). Each polygon should be able to have as many nodes as required, and they should be able to be added, deleted or moved (the nodes and the polygons) as many times as desider. The polygons could be filled or not (just only showing the perimeter, or even showed as a "hole" meanwhile the rest of the image is partially covered). Of course, the images should be not modified. Moreover, the user should be able to zoom in and out of the image, and the polygon should zoom in the same ration keeping it in position over the image. Finally, the program should analyze the pixels of each image "included" into each polygon defined by the user.
Here are some examples of what i would like to do:
https://www.researchgate.net/publication/331602837/figure/fig1/AS:734257630679040@1552072069130/Phenocam-regions-of-interest-ROIs-for-the-pinyon-and-juniper-woodland-valley.pnghttps://www.researchgate.net/profile/Yingying-Xie-3/publication/322575501/figure/fig1/AS:584151702970369@1516284027909/Camera-system-and-examples-of-ROI-region-of-interest-selection-for-four-canopy-trees-at.pngSo, in this context,
my question is how to do the polygon drawing on top of the image and manage their nodes. Wait, wait, wait... i am not asking to you to write the code for me! Not at all! My question if how to head this task of drawing the polygons.
I saw some ideas about it:
https://stackoverflow.com/questions/15534947/draw-polygon-on-imagehttps://wiki.lazarus.freepascal.org/Graphics_-_Working_with_TCanvasSo, the problem is not how to draw them in a canvas. In fact i know how to draw polygons and how to save/load the nodes' coordinates to be used in othee datasets. The problem is that I do not see how to select a node i order to move/delete it, or to add a new node in between other two.
Then, i am lost in the starting point: I do not know if i should do it drawing in the tpicture canvas, or if to overlap the image with a Tpaintbox, neither how to be able to manage the nodes, or if to use a svg-like component, or if there is a component that could help me on this work (i didn´t found after a long research)...
So, could you give some idea about how to start with this?
Sorry for this very long post, and thanks so much in advance!