Convert raw image into mosaic-image representation
Hi, this is my first time using opencv and i'm beginner in C++. what i want to:
- Read an image.
- Convert image into tiles image.
- Read color value on each tile.
almost like figure below.
I have through forum and i found out a few way that maybe can be use to do this. It is possible to split image into block first or using kernel and convolution concept to convert image into mosaic-represantation. or there is other way/function that is more direct and simple?
I don't know if it is for you school project or not but that's a funny project. About read image read docs and look on github. you can try this sample
After you can resize your image without interpolation to result size and look for nearest color in your tile images.
Ok, so you found a few ways to go...Why not implement them, see the time it takes each one and then come back if you are not pleased with it and ask for help? What I find a little hard is to do the thing of not having the same tile one next to another
take a look at this post
yeah @LBerger..actually this is my school project..
@sturkmen thanks...that actually output that i want...but actually i also need to reduce a pixel number such as every group of pixel is compress to become a pixel(tile) because my project use this image output for robot arm pick and place actual tile to become exactly like the image..then i think i need to go through each pixel through it's column follow by it's row and read and average pixel value one by one by using img.at<uchar>(Point(x,y)). But i have problem when i test to set value on pixel of image by using this code
i have image test of 600x600 pixel..I was expecting it to cover the entire image in white, but unfortunately is not. right side image is not cover by white.
can somebody help me with this problem...i thought my loop is correct but i dont know why the output like that.i already stuck at my first step.. so how i can modify my code so the img.at<char> can read all pixel in image through column and follow by row.?
It seem that i need to times 3 on img.col to make entire image is white
why it should be like that..can someone give me clear explanation about this issue??