Grasshopper

algorithmic modeling for Rhino

hello everyone,

im trying to create a topographic surface\ mesh from a color image so that each RGB value will correspond to a certain height 

i tried using an image sampler on a gradient that represents the heights (for example 0-96cm) so that i will get 2 lists with the same number of items one representing an RGB value and the other a height value.

then im using another image sampler with a color coded topographic map. what im trying to do is assign a certain height according to the RGB value of the first gradient to the height map in the second image sampler so that i can create the surface..

so far i had no success so any help will be appreciated. 

niv

Views: 10630

Replies to This Discussion

Ok, so it looks like the image you have has a gradient that goes across hue values, so I thought I new how to solve it. But it only kind of works.

 

If you sample the file for HUE values instead of RGB, it kind of works. See attached image and definition.

The problem I encountered is that the hue specrum loops from red back to red, so that's the cause for the spikes in the red zones... but it may work better for you since you have no red areas in your image.

Maybe someone will have a better answer than me! : )

 

 

 

Attachments:

It may be a bit faster by using mesh instead of surface. You can even get the same colors on it.

Attachments:

True.
Now, do you have any ideas for normalizing the irregular spikes in the red zone?

1. Truncate (in more "statistics" way)

2. Interpolate - smooth.

3. Ban some values larger than some maximal value.

Will the question is f(color)=height?

The color grandient presented the height value grandient,it shouldn`t have terrible value break at the part of yellow gradual change to red. 

thank you for the replay.

i already tried sampling hue values but i got the same result as you did.

the thing is that i need the accuracy.

so far i've been having trouble with the height assignment it doesnt have a smooth transition 

if anyone has any suggestion for a solution let me know!

thanks again,

niv

Could you upload the image?

It worked fairly well for me... but I don't know if I can say it is "accurate"
I guess it depends what you plan on using this for.

(I also think I messed something up when I painted since the color looks shifted)

 

Also, I am not sure what happens if the image had red... in the previous test I did it was a problem.
Since we were just measuring Hues, and for some reason that I don't know, HUE's wrap from Red back to red...

Attachments:

Hi All, 

Firstly Im new to grasshopper and Rhino, so sorry if this has already been covered of is an really simple question. 

I am trying to use this script work with an image that is 1500px by 500px. And cant seem to change any of the components to display this? Can anyone point this out to me? I've tried changing the first slider in Guis script, from 100 to two sliders of 1500 and 500 but no joy. Any help greatly recieved. 

Sam

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service