pixel

Change a color in a UIImage

旧城冷巷雨未停 提交于 2019-12-05 07:05:52
问题 I will like to know how I can change just one color in a image. Like saying: if the color in this pixel is "red" change it to "blue". 回答1: The technical approach is straightforward: get all pixel values (explained here) Look for the pixel values you don't like and change them Draw the image using the changed pixel values (explained here) Keep in mind, if you mix the three steps into one method, without creating UIColor objects but changing them and immediately afterwards drawing the changed

Checking image feature alignment

北城余情 提交于 2019-12-05 07:03:43
问题 I have written my own software in C# for performing microscopy imaging. See this screenshot. The images that can be seen there are of the same sample but recorded through physically different detectors. It s crucial for my experiments that these images be exactly aligned. I thought the easiest would be to somehow blend/substract the two bitmaps but this doesn't give me good results. Therefore I am looking for a better way to do this. It might be useful to point out that the images exist as

Image Magick / Detect colors contained on a image

折月煮酒 提交于 2019-12-05 05:16:19
What would be the simple process that would gives an array of the colors contained in an image ? ImageMagick's "convert" command can generate a histogram. $ convert image.png -define histogram:unique-colors=true -format %c histogram:info:- 19557: ( 0, 0, 0) #000000 gray(0,0,0) 1727: ( 1, 1, 1) #010101 gray(1,1,1) 2868: ( 2, 2, 2) #020202 gray(2,2,2) 2066: ( 3, 3, 3) #030303 gray(3,3,3) 1525: ( 4, 4, 4) #040404 gray(4,4,4) . . . Depending on your language of choice and how you want the colors represented, you could go lots of directions from here. Here's a quick Ruby example though: out =

python计算不规则图形面积算法

末鹿安然 提交于 2019-12-05 05:15:06
介绍:大三上做一个医学影像识别的项目,医生在原图上用红笔标记病灶点,通过记录红色的坐标位置可以得到病灶点的外接矩形,但是后续会涉及到红圈内的面积在外接矩形下的占比问题,有些外接矩形内有多个红色标记,在使用网上的opencv的fillPoly填充效果非常不理想,还有类似python计算任意多边形方法也不理想的情况下,自己探索出的一种效果还不错的计算多圈及不规则图形的面积的算法。 医生提供的病灶标记图和原图,大部分长这样 但也有一些多圈情况 很明显,这些图片都是非常需要计算面积占比的,对样本需要筛选 通过百度,用opencv的填充来计算面积,一部分效果很差,单圈画不全,多圈都是错(用将面积计算结果上色,方便观察) 通过此算法之后,无论单圈,多圈,面积计算准确度提高许多 能较为准确的计算出不规则图形的面积 正文:算法的思想很简单,遍历图片每一列,通过色差判断是否遇到标记圈,将坐标全部记录,对每一列的坐标都进行最小行和最大行记录,确定每一列的最小和最大的坐标,然后上色(类似opencv的fillPoly的实现,但是细节有些区别),只是这样效果并不好,将图片旋转90度,再做一边,将两个图片的结果放在一起做与操作,得到结果就能很好的处理多圈的标记问题和多算面积的问题(比如上面的08-LM), 算法实现 全程只用pillow库 首先先用屏幕拾色器获取目标颜色的rgb值,我这种情况下就是(237

Why is wrap_content bigger than real pixel size?

孤街醉人 提交于 2019-12-05 04:55:58
问题 I am trying to understand something. A weird thing that I see is that when I put wrap_content in the width and hight, the image is bigger than the the real px (pixel) size of the image which is inserted. Why is that so? My code with wrap_content : <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="false" android:src="@drawable/header" /> and thats my code with exact pixel size of the image: <ImageView

Rewarded By Qualcomm && Google Android Security Bulletin

泄露秘密 提交于 2019-12-05 03:18:25
我们有一部分漏洞是通过高通转报谷歌的, 在高通漏洞榜公开致谢, 在谷歌漏洞榜以匿名的形式致谢, 整理如下 总数: 74 CVE Google Android 致谢榜 Qualcomm 致谢榜 CVE-2018-5904 CVE-2018-5908 CVE-2018-5909 CVE-2018-5910 201808 Android Pixel Bulletin 201811 Qualcomm Bulletin CVE-2018-11293 CVE-2018-11301 CVE-2018-11295 CVE-2018-11276 CVE-2018-11273 CVE-2018-11270 201809 Android Pixel Bulletin 201809 Qualcomm Bulletin CVE-2018-11297 CVE-2018-3570 201807 Android Pixel Bulletin 201809 Qualcomm Bulletin CVE-2018-5864 CVE-2018-5865 CVE-2018-5855 CVE-2018-5858 201807 Android Pixel Bulletin 201807 Qualcomm Bulletin CVE-2017-15856 CVE-2018-3577 CVE-2018-5830 201806

How do I correctly translate pixel coordinates to canvas coordinates in Android?

廉价感情. 提交于 2019-12-05 02:45:53
I am capturing a MotionEvent for a long click in an Android SurfaceView using a GestureListener . I then need to translate the coordinates of the MotionEvent to canvas coordinates, from which I can generate custom map coordinates (not Google Maps). From what I have read, I take that given MotionEvent e , e.getX() and e.getY() get pixel coordinates. How can I convert these coordinates to the SurfaceView 's canvas coordinates? Here is my GestureListener for listening for long clicks: /** * Overrides touch gestures not handled by the default touch listener */ private class GestureListener extends

How to draw OpenCL calculated pixels to the screen with OpenGL?

别等时光非礼了梦想. 提交于 2019-12-05 01:25:26
I wan't to do some calculated pixelart with OpenCL and display this directly on the display without CPU roundtripping. I could use interoperability of OpenCL with OpenGL and write to the texture-banks of the GPU and display the texture with OpenGL. I was wondering what would be the best way to do this, since I do not need any 3d stuff, just 2d pixelart. The best way would be to use OpenCL/OpenGL interop, if your OpenCL implementation supports it. This allows OpenCL to access certain OpenGL objects (buffer objects and textures/renderbuffers). You won't be able to directly access the default

How does bicubic interpolation work?

流过昼夜 提交于 2019-12-05 01:22:05
问题 After reading text about this said topic, i found out that it considers 16 of the original neighboring pixels. What i want to know is how does it compute the color value of the new pixel. If the color values of the 16 pixels are known, how could you compute the value of the new one? 回答1: I think it's pretty well explained in Wikipedia. You need the intensity values of 4*4=16 pixels, from which you can calculate the interpolated value at any point within that 4*4 grid. If you mean how to do

Read pixel colors of an image

落爺英雄遲暮 提交于 2019-12-04 23:59:50
问题 In VBA, how can I read the color value of each pixel of in an image? I found this solution in VB 6.0 but it doesn't apply directly in VBA. 回答1: Try the solution posted on this site here : http://sim0n.wordpress.com/2009/03/27/vba-q-how-to-get-pixel-colour/ I had to change a ByRef to a ByVal but apart from that it works well. Insert a picture using Insert > Picture and assign a macro to the on click event . I've just made it set the colour of cell A1 to the colour you click on, but I'm sure