Home General Discussion

Texture /photo straightening techniques?

gnoop
sublime tool
Offline / Send Message
gnoop sublime tool
I often  need to make straight  a  piece of photogrammetry  or just a photo I want to project onto certain regular geometry .   With "straightening" I mean something  irregular and slightly deformed to become something  having equal intervals and X/Y alignment typical for a texture.  A baroque building facade for example or a road turn armco rail.
Through years  i used:
1)  mesh deform in Photoshop  or puppet warp( inconvenient   as hell , never precise,)
2)  mesh deform brush in Zbrush   with a transparency slider and a grid on desktop picture
3)  retopo of flat plane with image  in 3d max or Blender  > uv projection > straightening  horizontal and vertical loops.> setting equal intervals  > ortho render  . Too much of a hassle in a word
4)  Draw vector curves  in Affinity > export as SVG > chat GPT python script .  ( slow and never worked fine)
5)  mesh deform in Substance painter ( same as in Photoshop . inconvenient, tedious)



Does anyone know an easy simple  way ?  Like putting a few vector curves on an image  ( not a mesh ) and have it perfectly straight and regular?     Blender addon or just a nice geometry node rig to do it maybe?    AI  that would work not only on a pattern/fabric details.     Maybe  Designer  node where I could put an arbitrary number of points  that turn  into vertical and horizontal curves and it would output perfect  deforming UV .   

It's one of those things   you thought would be convenient  soon 30 years ago  but it never did.   If I missed it  please point it to me. 

   

Replies

  • Sempoo
    Offline / Send Message
    Sempoo triangle
    There are straightening tools in Photoshop - Camera Raw filter, also in Adobe Lightroom and in DxO ViewPoint.

  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Sempoo said:
    There are straightening tools in Photoshop - Camera Raw filter, also in Adobe Lightroom and in DxO ViewPoint.

    Thank you Sempoo    From what I remember this tool is not very helpful  because  doesn't allow to draw curves as guides   to be then straightened, doesn't allow to  distribute points and image details equi-spacial.  Doesn't allow to straighten  bent subjects etc.     Just merely a rough perspective correction.      Does it have something  extra  i might  have missed ?  A hidden menu with extra options?       
         I hardly ever use Lightroom and RAW photos  so had to  install it still  can't find this tool there . Does it have more options then  camera raw plugin in Photoshop?
    I actually recall some photoshop plugin from 90th  where you could draw multiple  Bezier curves  on image as guides  but it was expensive and not very well working.  Can't recollect the name now. 


  • Eric Chadwick
    Shoebox Texture Ripper has some nice bezier controls. Pretty easy to use.
    https://renderhjs.net/shoebox/textureRipper.htm

    You can download it here for free: https://renderhjs.net/shoebox/

    Shoebox was built on Adobe Air, which was then sold off to Samsung, so the runtimes are now here: https://airsdk.harman.com/runtime
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    - There is no difference between "straightening" and straightening.
    - Just post an actual test case of a element you are currently in the process of straightening out. That way you'll get actual practical solutions matching your need, rather than just suggestions.
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Thanks Eric ,   Unfortunately it looks mostly like same simple planar perspective correction .   Doesn't help to make an image of armco rail  slightly bent in real world  to match straight mesh  without precise Bezier curves based  rig.    Wonder why decades later we still use those tedious mesh deforms things in every image editing programm.
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    pior said:
    - There is no difference between "straightening" and straightening.
    - Just post an actual test case of a element you are currently in the process of straightening out. That way you'll get actual practical solutions matching your need, rather than just suggestions.
     Sorry,  with "straightening" I didn't want to sound odd in any way, my apologies, I merely tried to use it in a wider sense as an umbrella term describing  not only unwrapping perspective  projection into front ortho one  but also  making the image ready for tile-able texture  and have regularly  spaced repeating details , eliminating  random shape inconsistency in actual subject.  Not just making something straight.      

    Unfortunately posting any images  of my current tasks  or company photos in general requires special permissions.         So I found something on google image search instead.    
      Imaging it rusted  and matte , having more weathering details.  I want it do a perfect projection on a straight mesh  and need to turn it into front ortho image  with equal regular spaces in between posts bolts  , size of cap bends etc.     

        Usually I draw vector curves  perfectly following horizontal and vertical  details > import them in Blender as SVG >construct a patch>convert to mesh > project image> straighten edge loops > ortho render.     Doing mesh deform in Zbrush or Painter  to make an image match geometry is equally tiresome  and I lose more image quality usually.   Beside using distance fading/proportional  tools  always keep some tiny waviness whatever you try .     
        So I am  curious if any modern tools surfaced to do it quickly and easily, perhaps perfectly automated? 

       I am trying to go back  from procedural materials   that  lets be honest,  almost always look a bit fake   back to  old style photo projection way and try to find  quicker way to match worn edges or any details to mesh edges  etc. 

  • pior
    Offline / Send Message
    pior grand marshal polycounter
    You could simply apply the source photo to a plane, cut in the the needed topology using the Knife tool and leveraging Preserve UVs on/off ("Correct Face Atttributes" in Blender) to match details ; removing the background ; then straightening things as needed. And then of course capturing the result to get the needed texture.

    It only takes minutes and is doable in any 3d software without the need for any specialized toolkit (which would be likely limited to perspective correction alone and wouldn't let you straighten out a bent object). And since you get a regular, real mesh as a result, further edits are possible even before the final 2d touchups - like duplicating bolts, copy-pasting bits here and there, and so on.



  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Thanks pior for the nice idea .  it's a bit more straight forward over that bezier curves approach i do    but requires more precise  vertex placement.    Even in your example the upper one is not perfectly straight having some points off .   I sometimes need to straighten big chunk of a racing track Ariel image from a drone  to map it as macro layer  along track turns  and its a hell of a points placing.   

  • pior
    Offline / Send Message
    pior grand marshal polycounter
     "the upper one is not perfectly straight having some points off"

    Yeah that's precisely why I think this barebones approach is interesting IMHO, as while the first pass involves straightening things on Z after placing the meshing, a later second pass is is always possible. Points can be added as needed and they can be fine-tuned either in UV space or in 3D space (or both).
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    yeah, it's a nice quick approach for simple things  but quickly gets tiresome when you need to put lots of points precisely .   I still would like something  curve node control based with automatic tessellation.  
  • Eric Chadwick
    You could try pior's idea, but using nurbs or patch modeling for a larger ref like that.
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    You could try pior's idea, but using nurbs or patch modeling for a larger ref like that.
    Yeah, thanks  Eric    I am trying to figure out if it's perhaps easier to do on 3dmax patch  with texture projection


  • Celosia
    Offline / Send Message
    Celosia greentooth
    Something like this?



    This is a mesh transformed into curves then filled and passed through a triangle tessellation group, all with Blender's geonodes.




    Corners are preserved in the conversion to curves by being marked with a Boolean x Point attribute so they get temporarily split. You may need to tweak the Corner Angle option in the 2D Triangular Remesher group. This group was created by Higgsas, you can get it there in his tris to quads file.



    I'm using Catmull Rom because they're very convenient and will keep the corners without extra work. You'll have to check out the attributes of other types of splines to recreate them in a way they match the results you'd get with a true Curve object if you want to use other types, then figure out the best approach to keep corners. Attributes example for a default NURBS:



    It's possible to create a quads mesh instead, Higgas has a handy patch node group for this, but you'll have to either hunt it down in the thread or just buy his nodes, which are great.

    You can unwrap it in many ways, my favorite is to position it over a 0-1 plane with the image (could be the same you're tracing over) and capture the vertices positions relative to it as the UV. Then you pick how you'll straighten the mesh, by hand, geonodes, whatever.
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Thanks a lot Celosia.    I use a lot of Higgas groups too :)     Have started something like this a while ago, then stacked and fallen deep into a rabbit hole.     Your split sharp corners by attribute gave me a fresh idea.  So simple.          
Sign In or Register to comment.