pixel

PictureBox not refreshing properly?

匆匆过客 提交于 2019-12-20 07:12:30
问题 I am new to programming pardon me if i am asking a dumb question. I am trying to display real time image that i obtained from a live camera. When i start the program, the picturebox is able to show the object(refer to picture1). When i remove the object, it display this image(refer to picture2). But the problem is that when i put back the object, i should be able to get an image that is similar to picture1 but instead it look like picture2. Is it because the pictureBox is not refreshing

Problem reconstituting UIImage from RGBA pixel byte data

与世无争的帅哥 提交于 2019-12-20 07:08:33
问题 I need to create 12 coloured images from a single greyscale image ( red orange yellow etc ) Source image is actually a PNG, RGBA: I'm using a library I found ( https://github.com/PaulSolt/UIImage-Conversion/ ) to break the UIImage into a RGBA byte array which I then process pixel by pixel, and use the same library to reconstitute a new UIImage. This is my code: - (UIImage*) cloneWithTint3: (CGColorRef) cgTint { enum { R, G, B, A }; // - - - assert( CGColorGetNumberOfComponents( cgTint ) == 4

Mapping pixels of two matrices

别说谁变了你拦得住时间么 提交于 2019-12-20 06:26:53
问题 Say that I have two matrices of the following sizes: matrix_1 = 30090x2 matrix_2 = 170x177 Assume here that the number of rows n matrix_1 represents the number of pixels . You can see that the size of matrix_2 is equal to the number of pixels. What I'm trying to do is map the pixels in matrix_1 to the pixels in matrix_2 , such that for example: matrix_1(1) = matrix_2(1) matrix_1(2) = matrix_2(2) matrix_1(3) = matrix_2(3) ...... ...... matrix_1(n) = matrix_2(n) How can I do that in matlab ?

Convert pixel to percentage using javascript

一世执手 提交于 2019-12-19 12:05:35
问题 I have a table header's width in pixel. on click of a function i need to convert pixel to percentage. <th field="Column1" id="Column1" noresize="true" width="100px"> <label id="Column1" onclick="getCustomGridColName(this.id,'inner__fghgh');" style="cursor:pointer; font-family: Times; font-size:12pt;"> Column1 </label> </th> 回答1: percentage is a relative value. with one value like 100px you cannot make a percentage. you need to have relative value like screenWidth (for suppose) 1366px so that

How to NSLog pixel RGB from a UIImage?

烂漫一生 提交于 2019-12-19 09:38:32
问题 I just want to: 1) Copy the pixel data. 2) Iterate and Modify each pixel (just show me how to NSLog the ARGB values as 255) 3) Create a UIImage from the new pixel data I can figure out the the gory details if someone can just tell me how to NSLog the RGBA values of a pixel as 255. How do I modify the following code to do this? Be Specific Please! -(UIImage*)modifyPixels:(UIImage*)originalImage { NSData* pixelData = (NSData*)CGDataProviderCopyData(CGImageGetDataProvider(originalImage.CGImage))

OpenCV: read matrix value

心已入冬 提交于 2019-12-19 09:12:14
问题 I want to count the number of white points in a background image which is only black and white. I have a code like this: int count = 0; for ( int j = 0; j < Image.rows; j ++ ) { for ( int i = 0; i < Image.cols; i ++ ) { if ( Image.at<int>(i,j) >= 150 ) { count ++ ; } } } For some reason, the above code doesn't work, it just stops reacting. I checked, and the line" if ( Image.at(i,j) >= 150 ) " causes the problem. My "Image" is a "cv::Mat", with "CV_8UC3" type. Is there someone can help me?

OpenCV: read matrix value

两盒软妹~` 提交于 2019-12-19 09:11:21
问题 I want to count the number of white points in a background image which is only black and white. I have a code like this: int count = 0; for ( int j = 0; j < Image.rows; j ++ ) { for ( int i = 0; i < Image.cols; i ++ ) { if ( Image.at<int>(i,j) >= 150 ) { count ++ ; } } } For some reason, the above code doesn't work, it just stops reacting. I checked, and the line" if ( Image.at(i,j) >= 150 ) " causes the problem. My "Image" is a "cv::Mat", with "CV_8UC3" type. Is there someone can help me?

How to measure the pixel width of a digit in a given font / size (C#)

时光总嘲笑我的痴心妄想 提交于 2019-12-18 21:21:30
问题 I am trying to calculate the pixel width of Excel columns, as described in this post, using the official formula from the OpenXML specification. However, in order to apply this formula, I need to know the Maximum Digit Width of the Normal font, which is the pixel width of the widest numeric digit. The OpenXML specification gives this example as a clarification: Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). I have checked that this

分辨率、DPI、PPI和屏幕尺寸,你都知道是啥么?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 18:36:25
分辨率、DPI、PPI和屏幕尺寸 分辨率 DPI/PPI 坑爹的屏幕尺寸 Reference 手机开发中不免会遇到分辨率、DPI、PPI和屏幕尺寸等术语,那就弄弄清楚这些概念的真正含义。 分辨率 分辨率这个词在很多地方都有,比如相机、视频、扫描仪。这里说的就是显示器的分辨率。显示器是由一个个像素点(pixel)所组成的,一般所说的显示器分辨率是1280x720就表示这个显示器水平方向有1280个像素,垂直方向上有720个像素。但是并非分辨率越高屏幕显示效果越好,还需要根据屏幕的大小来决定。也就是要看像素的密度(pixel density),这个指标就是DPI(Dots Per Inch)或者PPI(Pixels Per Inch),即英尺屏幕上像素或者是点的个数。 DPI/PPI DPI = Dots Per Inch PPI = Pixel Per Inch 两个参数的区别就在于Dot和Pixel的区别,dot值的是显示器上每一个物理的点,而pixel指的是屏幕分辨率中的最小单位。这个两个难道会不一样么?会!当一个像素需要多于一个屏幕上的物理点来显示的时候dot就跟pixel不一样了。这个有另一个叫法叫做dppx(dot per pixel),即每个像素中有多少个点。大部分的显示器中一个像素即一个点,但目前一些比较好的屏幕和一些手机屏幕中dppx会大于1。比如说Mac

Converting long/lat to pixel x/y, given a zoom-level

北城余情 提交于 2019-12-18 16:10:15
问题 I'm trying to develop a page in ASP.NET that will act as a tile-server for a Google Map It will pull a collection of latitude/longitude points from the database, then render them as small red dots on a transparent background, given a zoom-level (default: 15). It will then return the result as a GIF-type image. Have any algorithms or libraries been developed that allow me to take this set of latitudes/longitudes and convert them to a set of 2D pixel co-ordinates, given a zoom level? (This is