I am trying to display extracted features from an Image using Histogram of Oriented Gradients (HOG) on interface.
I need guidance how to display it; as for histogram we need to use (QWidget) and promote it to (Histogram class ) so how could I display histogram of oriented gradient to display extracted features
Any help in this case would be grateful
hog = cv2.HOGDescriptor(qImg, (16,16), (8,8), (8,8), 9)
hist = hog.compute(image)
sample.append(hist)
plt.plot(hist)
plt.show()
I want to display HOG at interface ..for this I need guidance how to do that
Related
i am trying to build arcgis scene with my custom 3d models with ModelSceneSymbol but when the model finally loaded(.dae format) it appeared pure white when i explicitly designed it red, also most of the other formats like .fbx,obj etc. don't seem to get rendered on the scene, can anyone give me a solution for the color part alone, i am using vectary for 3d model creation btw
I am developing on an application based on VTK and GDCM for viewing medical (DICOM) images.
The application has three windows that respectively show XY, YZ and XZ orientations (axial, coronal and sagittal). This is similar to the 2D views here. I use vtkImageViewer2 for this. The voxel values of the DICOM images are passed on to an instance of vtkImageData. The instance of the vtkImageData is the passed on the to three instances of vtkImageViewer2 (let's use imageViewerXY, imageViewerYZ and imageViewerXZ). The orientation of each instance of vtkImageViewer2 is then set using SetSliceOrientationToXY(), SetSliceOrientationToYZ() and SetSliceOrientationToXZ(). Without the mask, I can see the slices, couple the windows and scroll through the images perfectly fine.
To add the mask so that it is shown in the three views, I use vtkImageActor. For the XY view, which is the default view, this works fine. I update the instance of vtkImageActor, which I call maskActorXY based on the mouse events of XY window as follows:
int extent[6];
imageViewerXY->GetImageActor->GetDisplayExtent(extent);
maskActorXY->SetDisplayExtent(extent);
maskActorXY->Update();
imageViewerXY->GetRenerer->Render();
Now, when I do the same for the other two windows so that I can see the 3D mask in the other two orientations, for example for the YZ orientation,
imageViewerYZ->GetImageActor->GetDisplayExtent(extent);
maskActorYZ->SetDisplayExtent(extent);
maskActorYZ->Update();
imageViewerYZ->GetRenerer->Render();
I get an error message that traces to vtkImageData and accessing pixel values outside of the extent set for the mask actor.
I have a limited familiarity with VTK, but looking at the source code of vtkImageViewer2 (see UpdateDisplayExtent() on line 341), I don't understand why pixel values out side of the specified display extent are requested from my instances of vtkImageActor that represent the mask.
I found a solution. Since I am not familiar with VTK, I may not be able to provide a clear explanation. All that I needed were the following two lines for each mask to force its mappers to face the camera:
maskActorYZ->GetMapper()->SetAtFocalPointOn();
maskActorYZ->GetMapper()->SliceFacesCameraOn();
(see [vtkImageMapper3D][1] class.)
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.
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
I would like to use the QGraphicsView control and QGraphicsScene to layout GraphViz generated graphs using pydot. Is there a way to generate the graph in pydot, have GraphViz do the layout, and then extract the layout information (such as is included in the various output formats generated by pydot.write_xyz)? So far in my testing the get_pos() functions for Nodes, etc. return None.
As you already said, you have to first output the graph with create_dot to a string, then generate the graph layout by passing that string to graph_from_dot_data:
graphWithPositions = pydot.graph_from_dot_data(graph.create_dot())