opencv,图片像素和尺寸大小
答案:2 悬赏:0 手机版
解决时间 2021-11-28 18:15
- 提问者网友:箛茗
- 2021-11-28 02:07
opencv,图片像素和尺寸大小
最佳答案
- 五星知识达人网友:野味小生
- 2021-11-28 03:21
同一尺度?还是同一尺寸?
尺度跟像素没有任何关系。尺度空间是通过数字变化得到的一个概念上的空间。
实际图像中,你直接得不到尺度空间的。
常见的有:线性尺度空间、近似线性尺度空间和非线性尺度空间。
分辨率是单位尺寸上的像素个数。如每英寸多少像素。
如果图片分辨率是60PPI,你图片大小是1x2英寸.
那么这幅图像的像素点数为1x60x2x60=720个点。
尺度跟像素没有任何关系。尺度空间是通过数字变化得到的一个概念上的空间。
实际图像中,你直接得不到尺度空间的。
常见的有:线性尺度空间、近似线性尺度空间和非线性尺度空间。
分辨率是单位尺寸上的像素个数。如每英寸多少像素。
如果图片分辨率是60PPI,你图片大小是1x2英寸.
那么这幅图像的像素点数为1x60x2x60=720个点。
全部回答
- 1楼网友:长青诗
- 2021-11-28 04:51
OpenCV中获取图像某一像素值 This is a basic example for the OpenCV.First we must know the structure of IplImage:IPL image:IplImage |-- int nChannels; // Number of color channels (1,2,3,4) |-- int depth; // Pixel depth in bits: | // IPL_DEPTH_8U, IPL_DEPTH_8S, | // IPL_DEPTH_16U,IPL_DEPTH_16S, | // IPL_DEPTH_32S,IPL_DEPTH_32F, | // IPL_DEPTH_64F |-- int width; // image width in pixels |-- int height; // image height in pixels |-- char* imageData; // pointer to aligned image data | // Note that color images are stored in BGR order |-- int dataOrder; // 0 - interleaved color channels, | // 1 - separate color channels | // cvCreateImage can only create interleaved images |-- int origin; // 0 - top-left origin, | // 1 - bottom-left origin (Windows bitmaps style) |-- int widthStep; // size of aligned image row in bytes |-- int imageSize; // image data size in bytes = height*widthStep |-- struct _IplROI *roi;// image ROI. when not NULL specifies image | // region to be processed. |-- char *imageDataOrigin; // pointer to the unaligned origin of image data | // (needed for correct image deallocation) | |-- int align; // Alignment of image rows: 4 or 8 byte alignment | // OpenCV ignores this and uses widthStep instead |-- char colorModel[4]; // Color model - ignored by OpenCV//------------------------------------------------------------------------------int main(int argc, char* argv[])...{ IplImage *img=cvLoadImage("c://fruitfs.bmp",1); CvScalar s; for(int i=0;iheight;i++)...{ for(int j=0;jwidth;j++)...{ s=cvGet2D(img,i,j); // get the (i,j) pixel value printf("B=%f, G=%f, R=%f ",s.val[0],s.val[1],s.val[2]); s.val[0]=
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯