C++ boost::GIL::gradient over even pixels of the image.














































C++ boost::GIL::gradient over even pixels of the image.



Computing gradient over even pixels of the image.

#include <boost/gil/gil_all.hpp>
using namespace boost::gil;

void XGradientRGB16_BGR32(int w, int h, const unsigned char* src_pixels,
int src_rowbytes, signed short* dst_pixels,int dst_rowbytes)
{
rgb16c_view_t src=interleaved_view(w,h,(const rgb16_pixel_t*)src_pix,src_rowbytes);
/*interleaved view of a source 16 bit rgb(read only image).
*/
rgb32s_view_t dst=interleaved_view(w,h,( rgb32s_pixel_t*)dst_pix,dst_rowbytes);/*
interleaved view of a destination 32-bit signed int rgb image.

*/
x_gardient(subsampled_view(src,
2,2),dst);
}


/*sub-sampled_view takes the source view and returns a view that steps over x and
over y by the specified steps.*/

/*
We can also pipe those views together.GIL can often optimize complex view transforms
for example if we can create sub-sampled view of another sub-sampled view the result
is a single sub-sampled view whose step is a product of the two input steps.
SUB-SAMPLING
This is the method of removing a sample aliquot for preparation and measuring from a
private sample or the mixture sample submitted for analysis.
*/


Image result for sub sampling

More Articles of Shikhar Vashistha:

Name Views Likes
Header File to find maximum of given three numbers 54 49
C++ boost::ublas::matrix::triangular matrix 338 4
C++ boost::ublas::matrix::scalar matrix 266 4
C++ boost ::ublas::matrix::zero matrix 441 9
C++ boost::ublas::matrix::identity matrix 326 4
C++ boost::ublas::matrix 346 1
C++ boost::ublas::binary operator 226 4
C++ boost::ublas::unary operator 246 2
C++ boost::ublas::vector_proxies::vector_slice 236 9
C++ boost::ublas::vector_proxies::vector_range 228 3
C++ boost::ublas::cordinate vector 229 5
C++ boost::ublas::compressed vector 282 2
C++ boost::ublas::mapped vector 240 7
C++ boost::ublas::scalar vector 339 68
C++ boost::ublas::zero vector 320 6
C++ boost::ublas::vector::unit vector 310 8
C++ boost::GIL::view transformation functions 319 8
tu 171 9
C++ boost::uBLAS::uBLAS vs Eigen 723 5
C++ boost::GIL::Image_parameter_resolutions 207 49
C++ boost::uBLAS::mapped_matrix 207 2
C++ boost::GIL::How to interpret errors easily 207 9
C++ boost::GIL::x_luminosity using a dynamic image 194 25
C++ boost::GIL::specific time enumerations 225 33
C++ boost::uBLAS::Why ublas 241 39
C++ boost::GIL::advantages and disadvantages of run time views 218 60
C++ boost::Ublas::Indexed two way iterator 216 6
C++ boost::uBLAS 214 93
C++ boost::GIL::Transpose image on disk 282 7
C++ Image Processing 248 6
C++ boost::GIL::gradient over even pixels of the image. 277 96
C++ boost::GIL::gradient over blue channel of RGB image 224 8
C++ boost::GIL::Y_Gradient 237 43
C++ boost ::GIL::luminosity_gradient 246 3
C++ boost::GIL::x_gradient(over any channel ordering) 273 2
Cpp program to convert a tree to forest of even nodes 249 14

Comments