image processing in vc++ using MFC - visual-c++

I want to perform the following artistic effect with my MFC app.
Can anyone tell me, how to perform it ?
Input Image :
alt text http://img255.imageshack.us/img255/1351/11input.jpg
Output Image :
alt text http://img255.imageshack.us/img255/7939/43output.jpg
Waiting for the reply...
Thanks in advance...

As far as I know, MFC doesn't include image processing functions (except some basic GDI functions). So you will need to use an image processing library, or implement everything on your own.

How did you do the artistic effect?
Its probably just some form of convolution applied to the image. If so this post may help:
How do I gaussian blur an image without using any in-built gaussian functions?
All you need to do is modify that filter matrix I supply and you'll get all sort of novel effects ...

Related

How to draw custom shapes with draw2d?

I am using draw2d javascript library for drawing predefined shapes and custom shapes in it's canvas.
As I don't have any example made yet, I am trying to copy from it's documentation but doesn't seem to find a good way to research it as it contains a whole lot of it.
Here is the circle example.
http://www.draw2d.org/draw2d_touch/jsdoc_6/#!/api/draw2d.shape.basic.Circle
and here are some more documentation with examples.
http://www.draw2d.org/draw2d_touch/jsdoc_6/
I have premade shapes with html and css and I am trying to drag and drop and render them on canvas like these in this image. Also when dropped, they should have input and output ports too.
Is it possible to convert this html/css to draw2d shapes?
So here this is made possible via extending draw2d's SVGFigure and thus we have ability to provide custom svg to render it as a custom shape.
Below links were useful in this context.
http://www.draw2d.org/draw2d_touch/jsdoc/#!/guide/extending_svg_figure-section-live-example
https://github.com/freegroup/draw2d/tree/master/examples/shape_custom_svg
http://www.draw2d.org/draw2d_touch/jsdoc_6/#!/api/draw2d.SetFigure
https://github.com/freegroup/draw2d/tree/master/examples/shape_labeld
https://github.com/freegroup/draw2d/tree/master/examples/shape_custom_markdown

Triangulate unstructured grid in vtk

I work with UnstructuredGrid and I want to triangulate it like in Paraview (when I clicked for model).
How I can do it?
I tried vtkDelaunay3D, vtkDelaunay2D and vtkTriangleFilter.
vtkDelaunay3D :
I've transformed UnstructuredGrid to vtkPolyData, after used vtkCleanPolyData and vtkDelaunay3D. It's not worked. It's crushed with this warning :
vtkMath.cxx: Unable to factor linear system
vtkDelaunay2D :
Similarly I used vtkDelaunay2D, but result is not good for me.
Also I use vtkTriangleFilter, it's result not good for me too.
When you click (or interact) in ParaView, ParaView is rendering a simplified geometry -- not simply a triangulated geometry. The filter it uses to do that is vtkQuadricClustering. Apply the vtkGeometryFilter first to your unstructured grid to convert your vtkUnstructuredGrid to a vtkPolyData. Then connect it to vtkQuadricClustering. You can play with parameters in vtkQuadricClustering to control the simplification.

How can I use a vtkFollower with a PNG image source?

I've been searching through the vtk documentation but I cannot see how I can use a PNG image with a vtkFollower.
In order to do so, I seem to need to obtain a vtkMapper with the image data. However, there does not seem to be a mapper for this purpose (i.e. loading of images).
How can I get a vtkFollower of type image?
Note: vtkFollower.SetMapper expects vtkMapper. Since vtkImageMapper does not inherit from vtkMapper, using vtkImageMapper is not possible.
You have to use PNG reader and pass it to texture.
Then, In vtkfollower object "settexture" should be called.
Please refer to links below.
https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/PNGReader
https://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TextureMapPlane
https://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Follower

Creating a synthetic camera in vtk and manipulating the intrinsic parameters and extrinsic interactively

I want to render a scene interactively. The controls are already provided so that you can position the camera with mouse but you never know the exact value.
I want to manipulate the internal camera values as well e.g focal length.
Externally I want to set the translation and rotation of the camera.
I want to give all the values manually. Could anyone please help to point to such a demo or a code snippet to do it. Preferably in python.
Thanks a lot.
You can get the camera from the renderer with renderer->GetActiveCamera(). Then you can manipulate it using the class functions: http://www.vtk.org/doc/nightly/html/classvtkCamera.html
Here is a simple Python example: http://www.vtk.org/Wiki/VTK/Examples/Python/Camera

How to allow the user to zoom and rotate 3D objects in Opengl and Visual C++

I am new to opengl and visual c++. I have done a sample application which rotates 3D shapes in opengl. I want to allow the user to rotate and zoom the object. Please give me an example of how to do this.
I have tried NeHe tutorial: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=48
I can't understand the class structure in the example. Is there anysimple way to achieve this?
I have found a library as well: http://www.nigels.com/glt/gltzpr/
But still can't figure out how to do this.
Please help me.
Zooming is usually done through gluLookAt. The third parameter is the view distance.
Here is some basic example running this :
http://graphics.stanford.edu/courses/cs248-01/OpenGLHelpSession/code_example.html
Look in display() to see how the viewing distance is used and in MouseMotion() to see how the value is modified and the painting updated.

Resources