它是图像梯度的x和y分量
itk x and y component of the gradient of an image
我想计算二维图像的梯度的x和y分量。如在MATLAB中计算为[dT2,dT1] = gradient(T);
ReaderType::Pointer T_g // image
FilterType::Pointer gradientFilter = FilterType::New();
gradientFilter->SetInput( T_g->GetOutput());
gradientFilter->Update();
对于这个句子,我得到了结果,但是我想要有x分量和y分量gradientFilter -> GetOutput ()有什么方法可以提取吗?我正在寻找它,但我没有积极的结果!
Thanks so much
安东尼奥gradientFilter的输出将是一个矢量图像。根据你的描述,我猜是2d图像!
ImageType::IndexType index;
index[0]=xcoord;
index[1]=ycoord;
gradientFilter->GetOutput()->GetPixel(index)[0]; // will return first component of xcoord,ycoord
http://www.vtk.org/Wiki/ITK/Examples
http://www.vtk.org/Wiki/ITK/Examples/ImageProcessing/NthElementImageAdaptor模板类itk:: NthElementImageAdaptor<TImage,>
表示图像由其像素的第n个元素组成。
假设像素为容器类型,并且在其API中定义了操作符[](unsigned int)。
根据c++默认类型转换规则的输入和输出图像类型执行额外的类型转换。
Wiki例子:All Examples
Extract a component of an itkImage with pixels with multiple components
Process the nth component/element of a vector image
相关文章:
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 如何使用OpenCV将RBG图像转换为HSV,并将H、S和V值保存为C++中的3个独立图像
- OpenCV EqualizeHist()从彩色图像创建黑白图像
- 将"打开的CV图像"中的"颜色"转换为整数格式
- 平均图像时图像损坏
- 在C++中使用GDAL可以将图像的像素坐标转换为lat,long吗
- 如何将图像传输到c++(dll)中的缓冲区,然后在c#的缓冲区中读/写
- Vulkan验证层不断在VkQueuePresentKHR()上抛出图像布局错误
- 使用FFMPEG将RGB图像序列保存到.mp4时出现问题
- 将RGB图像保存为PPM格式
- 将图像添加到资源文件夹UWP C++
- 彩色图像的卤化物处理平均值
- C++射线示踪剂ppm表示没有足够的数据来显示图像
- 重新定位图像时如何前进到下一个内存块
- 如何使用按钮更新GTK3图像以使用C++从相机捕获图片
- 为什么 BMP 图像上的 imwrite 会卡住/不返回?
- 使用OpenCV的c++中图像的绿色分量的直方图
- 在opencv 2.3中从RGB图像中分离出红色分量图像
- 它是图像梯度的x和y分量
- 三维图像中的连通分量及其指数