I'm using Magick++ in a project to load a image, grayscale the image, then pass pixel color/intensity info into VLfeats' mser functions. Problem is that the VLFeat requires what is basically a uint8 array (vl_mser_pix if you're familiar) of pixel color. The code needs to compile and run on any machine regardless of what QuantumDepth installation there is
Here is the general idea of what I'm trying to do
Code: Select all
#include <Magick++.h>
#include "vlmser.h"
int main()
{
Magick::Image myImg;
//Load Image, get pixels
myImg.read("Completely_White_Image.png");
Magick::PixelPacket *magickPix = myImg.getPixels(0,0,myImg.columns(),myImg.rows());
//pixel array for VLFeat function
vl_mser_pix vlPix[myImg.columns() * myImg.rows()]; //vl_mser_pix is essentially unit8
//Copy magickPix into vlPix
[b]This is where I need help[/b]
}
'equivalent' of this number. I know I could do something like multiply it by 256/65536 and round the result to do this, but this code needs to compile and run properly on any system. If my buddy wants to compile this with QuantumnDepth=8, that conversion factor would need to be changed manually, which I don't want to deal with.
Thank you for your help! Sorry if this is a really stupid question, until now I've only done image analysis in Matlab