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.
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.?
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.
'+' 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 ;?
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.
<|"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.
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 ->carrots*mask1->mesh[ ];
... mesh1*line(0,200)->segment1;
mask1 -> negative[ ]-> mask2;
mask1 -> negative[ ]-> mask2->carrots*mask2->mesh[ ]
... mesh1*line(0,200)->segment2;
领英推荐
Turn a simple Yarns photo into an Epic landscape
I am calling this new field of computing the Weird Processing!
3D Comics Style Image to Mesh
Free Form language has many image styling options and allows access to third party Neural Nets for styling.
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.?
3D Japanese Calligraphy Image to Mesh
Click on image to view the video
To Be Continued ...
Next Issue: 24th of June 2024