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
Asked: 2013-04-26 17:08:42 -0600
Seen: 11,892 times
Last updated: Apr 27 '13
Extracting a vector of pixel values across multiple frames
How to estimate the noiselevel of an image?
Reading pixel values from a frame of a video
How to find a match between 2 shifted hue histograms?
Single Image Depth Map / Sharpness Map
How to match two images and find out mistakes
Remove buttons from their background so I can re-use button image
Image stitching from a live video stream
Which matcher is best for SURF?
Classification of object from a video/Image ( human, animals, others(cars etc.,))