I have a network of a power grid where the edge are the power lines and the vertices are loads or generators. I was wondering how I can import an image into Mathematica to derive some sort of coordinate system to calculate some topological properties that are related to distance and position using Monte Carlo Cooling methods and other methods of this sort. The code below is giving me back errors that are shown below.
im = Import["C:\Research\Pictures\FloridaPowerGrid.jpg"];
Module[{picturesize, i, bigger, imagesizes},
picturesize = {1038, 1386};
values = {};
i = 1;
imagesizes = ImageDimensions[im]; bigger = 1;
DynamicModule[{pt = {0, 0}},
If[imagesizes[[1]] < imagesizes[[2]], bigger = 2];
TableForm@{
Button["Record!", AppendTo[values, {i, pt}]; i++;],
LocatorPane[Dynamic@pt,
Dynamic @ Graphics[
Join[
{Inset[im, {0, 0}, {0, 0}, {1, 1}]},
Flatten[{Blue, Disk[#[[2]], .01], White, Text[#[[1]], #[[2]]]} & /@ values]],
PlotRange ->
{{0, imagesizes[[1]]/imagesizes[[bigger]]},
{0, imagesizes[[2]]/imagesizes[[bigger]]}},
ImageSize -> picturesize]],
Dynamic[N @ pt],
Dynamic[MatrixForm@values]}]]
Module
values that you intend to use dynamically. Get rid of Module and bring everything into your dynamic module and try again $\endgroup$