bits-per-pixel

How does PDF's BitsPerComponent translate to Bits Per Pixel for images?

你离开我真会死。 提交于 2019-12-24 08:26:55
问题 My goal is to convert a PDF into an image (specifically in TIFF). There is a PDF property called BitsPerComponent And According to description on the page, This property can take the value 1, 2, 4, 8 or 16. Other values are not supported in the PDF Specification Does that mean, 1, 2, 4, 8 or 16 translates to bits per pixel in images? 回答1: Sounds more like bits per color component, where color component is one of either (Alpha)/Red/Green/Blue or Grey. So take the bits per component and

How to convert an 8-bit OpenCV IplImage* to a 32-bit IplImage*?

*爱你&永不变心* 提交于 2019-11-26 23:14:49
问题 I need to convert an 8-bit IplImage to a 32-bits IplImage. Using documentation from all over the web I've tried the following things: // general code img2 = cvCreateImage(cvSize(img->width, img->height), 32, 3); int height = img->height; int width = img->width; int channels = img->nChannels; int step1 = img->widthStep; int step2 = img2->widthStep; int depth1 = img->depth; int depth2 = img2->depth; uchar *data1 = (uchar *)img->imageData; uchar *data2 = (uchar *)img2->imageData; for(h=0;h