Any CLI tool to perform 3d texture mapping on the fly - bash

I'm currently looking for a way to create a 'configurator' for a upholsters, similar to http://digitaldraping.com/configurator/furniture-sofa/?Cushions_Plain-Cream.png,Sofa_Stripe-Orange.png - you select your fabrics and they are 'drawn' on the sofa automatically.
Unfortunately, all the sites I've looked at seem to use pre-rendered transparent PNGs that are overlaid over each other to build up the full picture. The problem here is that we've figured out that we'd require over 120,000 different images to cover all models, fabrics etc!!
I've looked at a few 3d texture tools such as http://www.arahne.si/products/arah-drape.html, hoping that one of them would have a CLI option where you give it a pre-created wireframe, and a fabric to overlay, and it generates the required image on the fly, but so far everything seems to require real-time use of the GUI to use it.
So, is there a CLI tool that would do what I'm after, or can anyone suggest a way to manipulate the GUI automatically? (from a tech point of view, I'm comfortable with C, Bash, Python or PHP as a solution!)
Thanks!

ArahDrape 2.2 can now work from a command line without any GUI interface. You can also call ArahDrape as a C library. In this way, it can be used in a web server to create texture mapped images on the fly. The command line options are explained below.
ArahDrape 2.2j command line version, ©2015 Arahne
usage:
adCommand -o /tmp/outputImage.png -tN /home/user/texture.png [-hidemodel] [-divide 2] [-filterPNG] [-compressPNG 2] [-m /home/user/model.png] -owner name -activation 174b3cfb49e9 /home/user/project.drape
Input and output images can have png, .tif or .jpg extensions
-o output_image_file
-tN texture_image_file [N goes from 0 to 199]
-hidemodel will render all areas not in region as white
-divide N [N goes from 2 to 5] divide resulting image pixel size
-filterPNG if you do not filter it, rendering is faster
-compressPNG N [N goes from 0 to 9] lower number saves faster, but bigger files
-m model_image_file use this if you want to replace model image from the project; must have same pixel size
-owner owner_name pass the given owner name
-activation activation_code pass the given activation code
last parameter should be ArahDrape project file
All files should be entered with full path.
If you need spaces in filenames, use quotes "" around the filename.
If you provide only Owner name, without activation code, program returns registration code.

ArahDrape supports batch export.
Open ArahDrape project, click on texture you wish to replace, put all your texture in a directory, select from menu
Textures > Browse textures, and as you click the texture to load it, program will save the draped picture. If you have thousands of images, use keyboard shortcut = and program will automatically do them all.
Alpha channel transparency is supported in loading model images or textures, and saving the draped images, as long as you use PNG or TIFF.
Please check this video to see how
ArahDrape works in batch mode.

we (http://digitaldraping.com/) can do just what you are asking. We have two options creating images and rendering a meshed image on the fly. Just get in touch if you still need this solution.

Related

Isolate OpenSCAD view

I occasionally do some work in OpenSCAD on Fiverr. Instead of sending 100 screenshots each day I would like to provide my clients with a live 3D preview of the object. But I need to do this without giving the source away (in the past I have been naive enough to get scammed this way).
I want my clients to be able look at the live 3D view without being able to see the source code.
For example, the following is a possible solution I was thinking of: hardcode the contents of the .scad file into a string inside an executable. Then start OpenSCAD with this string but only show the preview window, without the client being to look at the code.
You can, in fact, use the openscad.exe to generate a preview from a .scad file:
& "C:\Program Files\OpenSCAD\openscad.exe" --preview --camera=0,0,0,45,45,0,200 test.scad -o test.png
However, there are two problems with this method. 1. It only generates a PNG, I need my clients to be able to pan and zoom. 2. It needs a local file. I could generate a tmp file, open it with above command and then quickly delete the file.
Consider sending an STL file for them to look at. OpenSCAD can export to STL. There are two versions of STL: ascii and binary. OpenSCAD outputs the binary form. Your clients could view your STL file in something like viewstl.com.
Since they could 3d print from the STL you might consider adding some watermark type textures or features that would be difficult to remove. Another option would be to change some key dimensions enough to make it unusable but not so much that it looks bad.

Processing: save color and depth images

I just started working with Processing, because I need to get a sequence of images, color and depth. When I save does images while drawing, so for each image I get I save it. I have around 2fps. Is there a way to improve this?
My thought was to store the image in an array list. I thought there is a function setup() so there would be also a function shutdown() or something. So When i hit the Esc button or close the window which is getting cold. Like a decompiler. Where I can run a loop trough that lists and save them. But I don't find such a function.
I am working on a MacBook Air (2013)
If you use OpenNI/SimpleOpenNI I recommend a nicer option: use the the .oni format (which stores both depth and rgb streams). All you have to do is:
Record to an .oni file (fast/realtime)
Read the depth/color streams from the recorded .oni streams when you need to.
To record to an .oni file you've got two options:
Use the Examples > Contributed Libraries > SimpleOpenNI > OpenNI > RecorderPlay sketch to record (some explanations at the bottom of this answer)
Use OpenNI SDK's NiViewer utility which can also save/load .oni files. (You can easily install this using homebrew: brew install homebrew/science/openni2. The path in this case will be something like /usr/local/Cellar/openni2/2.2.0.33/share/openni2/tools/NiViewer)
Once you have your .oni file, you can easily read it/play it back at different rate and access depth/rgb streams to save to disk.
Regarding your existing program
The frame rate drops because in the same thread it's encoding and writing two images to disk per frame. You can improve this by:
saving to an uncompressed format (like tiff)
threading the image save operation (see the bottom of this answer for some ideas)

Magento Image processing extension

Is there any extension which is specifically goes for fill image color like module. I have 1000's of images which all same size but have white space around all image, instead of using photoshop can i use PHP to process that image to have different(brown color - sine it is background) instead of white. If there is any extension please suggest me.
Thanks in advance
If you want to have same background for all images,you can override the magento class that applies background color.
File is app/code/core/Mage/Catalog/Model/Product/Image.php
Find the code that looks like this protected $_backgroundColor = array(255, 255, 255); and specify the RGB value of the colour that you want.
Check out ImageMagick. I haven't used it for exactly what you are trying to do, but I have used it for other kinds of batch image processing. It can be ran from the commandline, but also has APIs for several programming languages.
For what you are trying to do, I'd take a look at the -fill, -floodfill, and -fuzz options.
http://www.imagemagick.org/script/command-line-options.php#fill
I got solution for my problem by the following method.
<?php
echo $this->helper('catalog/image')->init($_product, 'image')
->constrainOnly(TRUE)
->keepAspectRatio(TRUE)
->keepFrame(FALSE)
->resize(600,null)
?>
I got it from here.
http://blog.chapagain.com.np/magento-resize-image/
You should consider getting rid of that white space unless you have other reason for it, e.g. to have product images to scale.
This is best achieved with Photoshop if you have got it, if the white is absolutely, definitely white then you can take the top-left pixel and crop from that.
Another option you may wish to consider is using png images, again this depends on your images and skill in Photoshop, however, you can use transparency in png and have no border on your images.
Also, in photoshop or imagemagick you may want to consider making your own thumbnail images, separate to the product page image. This will enable you to apply filters such as sharpen to get product page images that are a cut above your competitors.
As noted by #jmspldnl you can use imagemagick on the command line as well as php extension. On the command line you can work out the process and string together lots of steps, when happy with your options, rather than re-work it in php code you can use 'passthru()' and run what you worked out from the command line.
For going forward you can put a cron job that monitors your images folder and processes and images that have been changed/added in the last day. This will make it easier to just upload images and have your system do the work.

3D image comparison in TestComplete

HOw ot compare 3D image files in testcomplete. My application processes some 3D images i want it to be compared with the reference. Image file types are .spt, .vtk, .mdb ,.dcm.
Someone help me.
You can probably use checkpoints for this purpose. For example:
To verify an image displayed on screen, use a region checkpoint.
To verify the actual file that holds the image data, use a file checkpoint.
Well, for DICOM images you could think about converting those into bitmaps and have TestComplete compare the bitmaps. Admitted, there is one additional step that you have to take care of, and this is the choice of a (command line) tool that does the conversion for you. I think IrfanView does the job. Give it a try and post your results.

Very large images in web browser

We would like to display very large (50mb plus) images in Internet Explorer. We would like to avoid compression as compression algorithms are not what CSI would have us believe that they are and the resulting files are too lossy.
As a result, we have come up with two options: Silverlight Deep Zoom or a Flash based solution (such as Zoomify). The issue is that both of these require conversion to a tiled output and/or conversion to a specific file type (Zoomify supports a single proprietary file type, PFF).
What we are wondering is if a solution exists which will allow us to view the image without a conversion before hand.
PS: I know that you can write an application to tile the images (as needed or after the load process) and output them; however, we would like to do this without chopping up the file.
The tiled approach really is the right way to do it.
Your users don't want to download a 50mb file before they can start viewing the image. You don't want to spend the bandwidth to serve 50 megs to every user who might only view a fraction of your image.
If you serve the whole file, users will eventually be able to load and view it, but it won't run smoothly for most of them.
There is no simple non-tiled way to serve just a portion of an image unless you want to use a server-side library like imagemagik or PIL to extract a specific subset of the image for each user. You probably don't want to do that because it will place a significant load on your server.
Alternatively, you might use something like google's map tool to provide zooming and scaling. Some comments on doing that are available here:
http://webtide.wordpress.com/2008/08/27/custom-google-maps/
Take a look at OpenSeadragon. To make a image can work with OpenSeadragon, you should generate a zoomable image format which mentioned here. Then follow starting guide here
The browser isn't going to smoothly load a 50 meg file; if you don't chop it up, there's no reasonable way to make it not lag.
If you dont want to tile, you could have the server open the file and render a screen sized view of the image for display in the browser at the particular zoom resolution requested. This way you arent sending 50 meg files across the line when someone only wants to get an overview of the image. That is, the browser requests a set of coordinates and an output size in pixels, the server opens the larger image and creates a smaller image that fits the desired view, and sends that back to the web browser.
As far as compression, you say its too lossy, but if thats what you are seeing you are probably using the wrong compression algorithm or setting for the type of image you have. The jpg format has quality settings to control lossiness, and PNG compression is lossless (the pixels you get after decompressing are the exact values you had prior to compression). So consider changing what you are using as compression, and dont just rely on the default settings in an image editor.

Resources