modifying pixel value
Hello every body, after loading picture, i would like to modify the pixel values and write it back i.e. the modified image. Could any one give me some hint how can that be done. Thanks.
Hello every body, after loading picture, i would like to modify the pixel values and write it back i.e. the modified image. Could any one give me some hint how can that be done. Thanks.
Hi,I use Mat format. If you have a gray picture & change a pixel. like:
image.at<uchar>(i,j)=valve// where i is image row & j is image cols & 0<=value<=255
if you want to change all picture value:
for(int y = 0; y < image.row; y++)
for(int x = 0 < image.col; x++)
{
..............
imageB.at<uchar>(y,x)=saturate_cast<uchar>(operator(image.at<uchar>(y,x)))
//where operator is image processing algorithm
............
}
& please ref Mat::isContinuous and other Mat operator :http://docs.opencv.org/modules/core/doc/basic_structures.html
If you want lower cost time. I think you should ref opencv code:SSE & AVX or CUDA
how can i modify pixel value from 0 to 0.01 ?
Asked: Apr 26 '13
Seen: 11,915 times
Last updated: Apr 27 '13