Free Form Programmable Image Processing with 3D Applications (Part 2)
3D Swept volume generated by the 2D carrots image segment along the vertical direction

Free Form Programmable Image Processing with 3D Applications (Part 2)

A mesh with UV coordinates allows texture mapping, well known to all. The details of which are not our concern for this discourse and yet we need to learn a few concepts in precise details.?

The texture itself is often stylized meaning the artist hand painted an image and that image was turned into a texture consumable by 3D applications.

As well, any photography could be turned into a texture with the same applications.?

In general the said images or photographs do not alter the geometry of the mesh in any way.?

In our case we seek technologies that allow the image/texture to alter the mesh geometry and actually we mandate that for a variety of applications.?

In general we call such meshes Image Mesh and we call the process/algorithm Image to Mesh.


Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

Chain: a -> b -> ...-> c

//photo of carrots can simply be dragged & dropped into the Free Form Editor;

carrots-> color distance[orange]->binarize[ ]-> mask1;

mask1 ->carrots*mask1->mesh[ ]->mesh1->mesh1*line(0,200)->segment1;

mask1 -> negative[ ]-> mask2->carrots*mask2->mesh[ ]->mesh1->mesh1*line(0,200)->segment2;

save as carrots segments;        

Overloading

In Free Form Programming language great care and innovations have been dedicated to the design concept of Operator Overloading. For example '*' is a well known arithmetic operator which acts upon what is placed on its right handside and what is on its left hand side (the Operands) to compute a new entity called the Product.

Free Form operator technology reuses the * operator with a similar syntax, however with completely different semantics namely the computed product.?

Examples of Free Form Operator Overloading

mesh1*line(0,200): swept surface or volume along a vertical line of the length 200, stretching from 0 z-coordinate to 200 z-coordinate.?

carrots*mask2: the original photo/image pixel value by pixel value is multiplied by the integers 1 or 0 which comprise the entire black and white image called mask. Where there is 1 operand then the carrots pixel is left unchanged, and where there is 0 operand the carrots pixel is blacked out and painted black.?

Source: https://en.wikipedia.org/wiki/Operator_overloading

Ad hoc: is a word that originally comes from Latin and means “for this” or "for this situation." In current American English it is used to describe something that has been formed or used for a special and immediate purpose, without previous planning.

Source: https://www.britannica.com/dictionary/eb/qa/what-does-ad-hoc-mean

  • In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations. Calls to an overloaded function will run a specific implementation of that function appropriate to the context of the call, allowing one function call to perform different tasks depending on context.

Source: https://en.wikipedia.org/wiki/Function_overloading


'+' operator

+ operands are corresponding pixels from two images at the same pixel coordinates. The sum of two pixel values is the so-called Product produced by the + operator.?

The Free Form program above is a powerful exhibition of the scant few Spoken English words that can script a sophisticated and non-trivial application of Image Processing.?

Look at the beginnings and the ends of the lines ending with ;?

  1. carrots -> …->mask1
  2. mask1-> … mesh*line…-> segment1
  3. mask1 -> … carrots *mask …-> segment2

These chains and the Free Form simplicity is the case in point. If you do not believe me then try conventional Image Processing APIs e.g. simple Python script with similar partial functionality to ours:

# importing numpy to work with pixels
import numpy as np

# importing argument parsers
import argparse

# importing the OpenCV module
import cv2


# initializing an argument parser object
ap = argparse.ArgumentParser()

# adding the argument, providing the user an option
# to input the path of the image
ap.add_argument("-i", "--image", required=True, help="Path to the image")

# parsing the argument
args = vars(ap.parse_args())

# reading the image location through args
# and reading the image using cv2.imread
image = cv2.imread(args["image"])

# adding pixels of value 255 (white) to the image
M = np.ones(image.shape, dtype="uint8") * 100
added = cv2.add(image, M)
cv2.imshow("Added", added)
cv2.waitKey(0)

# adding pixels of value 0 (black) to the image
M = np.ones(image.shape, dtype="uint8") * 50
subtracted = cv2.subtract(image, M)
cv2.imshow("Subtracted", subtracted)
cv2.waitKey(0)        

Chain Cloud-Memory

Each Free Form Chain has its own intricate Cloud-Memory! This memory system resides in a cloud container. This memory is Content-Addressable and Content-Searchable and such a memory system is called Associative Memory.

Partial Chain for constructing the 3D carrots mesh


<|"carrots"->... : the very beginning of the Associative Memory which models the chain cloud memory. The store value is the photo of the carrots.

image.1: an unnamed interim cloud variable stored in the chain's Associative Memory storing computed results by color distance[ ] function. The String 'image.1' is a 'word' address to access the image resulted by the function.

unnamed variable: a variable which is internally computed and addressed variable which the programmer has no knowledge of has access to. In Free Form language the naming format is String+'.n' where the n is an integer equal or greater than 0.

mask: a named cloud variable


<|... key->value...|>: Associative Memory for chain memory. 'key' can be an entire text document or another image or any other data type available, same as 'value'.


Content-Addressable Memory (CAM) is a special type of computer memory used in certain very-high-speed searching applications. It is also known as associative memory or associative storage and compares input search data against a table of stored data, and returns the address of matching data. Unlike standard computer memory, random-access memory (RAM), in which the user supplies a memory address and the RAM returns the data word stored at that address, a CAM is designed such that the user supplies a data word and the CAM searches its entire memory to see if that data word is stored anywhere in it.

Source: https://en.wikipedia.org/wiki/Content-addressable_memory


Image to 3D Mesh

The process of turning an image into a geometrical region is called Image to Mesh and the resulting such meshes are called ImageMesh.?


carrots-> color distance[orange]->binarize[ ]-> mask1;        


mask1
mask1 ->carrots*mask1->mesh[ ];        


3D Triangulated UV Mesh with cutout-texture
... mesh1*line(0,200)->segment1;        


segment1: The 3D cutout of the carrots swept along a vertical line
mask1 -> negative[ ]-> mask2;        
mask2
mask1 -> negative[ ]-> mask2->carrots*mask2->mesh[ ]        


Triangulated 3D Mesh
... mesh1*line(0,200)->segment2;        


segment2: The complement region, swept along a vertical line



The Bottom 3D Mesh added for visualization

Turn a simple Yarns photo into an Epic landscape


I am calling this new field of computing the Weird Processing!


Take a low resolution photograph of yarns...


Construct a Yarns landscape and build your own 3D fantasy animations ...

3D Comics Style Image to Mesh


Free Form language has many image styling options and allows access to third party Neural Nets for styling.

Take a snapshot of apples in supermarket


Image Process1: RGB to Comics Styling algorithm


Image Process2: Construct a Swept 3D Mesh with Comics texture-map overlay


Scaling up these 3D Image Processed images construct unusual landscapes




This is an AI generated image


Now looks more AI-ish!

3D Cellular Automaton Image to Mesh

A cellular automaton is a collection of "colored" cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules based on the states of neighboring cells. The rules are then applied iteratively for as many time steps as desired.

Free Form language has many image styling options and allows access to third party Neural Nets for styling.?

Free Form Programming language allows for complete access to all Cellular Automatons. Free Form scripts simply create the square patterns and Image to Mesh them for stunning 3D sci fi alien landscapes.?

Start with this pattern


A Borg like structure!


Lots of beautiful pyramid like structures



Sublime!

3D Japanese Calligraphy Image to Mesh


Click on image to view the video

The Japanese 2D calligraphy swept along a line turned into a mountain size landscape
Low quality scan of a Japanese calligraphy served as logo
2D mesh from the image
swept mesh



Triangulation of the Image to Mesh


The 2D Japanese calligraphy was swept along a base 3D curve into a volume
2D calligraphy Orthogonally swept along a base curve (rather than line)


To Be Continued ...




Next Issue: 24th of June 2024




要查看或添加评论,请登录

Darragh O'Sheada的更多文章

社区洞察

其他会员也浏览了