Convert Image to Circles/Dots

Hi All,

We are currently investigating placing an image on an acoustic panel. We were intending to use 7 different hole diameters to create the pattern.

We have broken the image down to a simple grey tonal range and now would like to draw a grid and in each grid box analysis what colour is dominate then place a circle at the centre of the grid box.

Do you think this is something we can use GC for?

Thanks

Wayne

Parents
  • Hi Karol, 
    Thank you for the response. I located the old script today and managed to get it working. 

    Tomorrow I might post some questions on how to refine the results. I may need to use a rounding function or try and spread the results between to limits. For example I might need to set the maximum size to say 14mm and the minimum to 2mm. 

    Thanks
    Wayne. 
  • Hi All,

    I have been working with the image sampler with some success. I have generated a good pattern however I would like to try and normalize the results to a set range. (Sorry I think that is what you call it)

    At the moment I have a range between 0.1 and 1 (which I accomplished by using a Round function)but I would like to map that to a range from a minimum of 3mm to 14mm (the smallest to largest hole I would need)

    Is there a function l can use to do this. I thought Limit might do it but that does exactly what it says and makes the min a value but does not rescale all the values to within the min max.

    To give you an idea this for an acoustic panel and we need a minimum size hole to make it work technically but limit it to a max size hole so the panel does not fall apart :)

    Thanks

    Wayne

  • Hi Wayne,

    For a range of values "rv" from rv = 0.0 to rv = 1.0 you could use Round(rv * 11.99999 + 2.5, 0) to generate numbers from (inclusive) 3 to 14 with statistically even distribution.  In the argument to Round, you would generate values from 2.5 to 14.49999, which would round to values from 3 to 14. 

    For a range of values "rv" from rv = 0.1 to rv = 1.0 you could use Round((rv - 0.1) * 16.1111 + 2.5, 0) to generate the same range of values in the argument to Round, which would yield values from 3 to 14, too.

    The idea is that you scale the range you have so it fits in whichever gap you need it to fit.  Usually, this is easiest with a "normalized" range from 0 to 1.  For non-zero low values, you'd first scale the normalized range to the range you need and then offset by adding or subtracting the desired start value, respectively.  Because Round() rounds up for values greater or equal to .5 and down for values less than .5 I suggest above to generate a range that in an even distribution would generate approximately the same amount of values rounding up and down to the lowest and highest desired numbers in the range, respectively.

    HTH and best regards,

         Volker

       

    Answer Verified By: Wayne Dickerson 

  • Hi Volker,

    Just updated with the code above and it all worked well.

    I was looking for a more complex solution investigating statistic and normalising data in excel :)

    In the end it is a simple scale exercise.

    Thanks again,

    Wayne

  • Hi Wayne,

    Marvelous!

    You are welcome.

         Volker

       

Reply Children
No Data