image

implement 3d sobel operator

帅比萌擦擦* 提交于 2021-02-19 06:46:46
问题 I am currently working on inhomogeniety removal from MRI data volume which contains voxels. I want to apply sobel operator on those volumes to find the gradient. I am familiar with 2d sobel mask and the neighbourhood of 2d images. sobel mask: 1 2 1 0 0 0 -1 -2 -1 1 0 -1 2 0 -2 1 0 -1 neighbourhood of(x,y): (x+1,y-1) (x+1,y) (x+1,y+1) (x,y-1) (x,y) (x,y+1) (x-1,y-1) (x-1,y) (x-1,y+1) Now I want to apply it on 3d. Please suggest me how should I proceed?? Thank you. 回答1: Wikipedia has a nice

Creating a random image generator with Swift

佐手、 提交于 2021-02-19 05:25:31
问题 I'm trying to make a random image appear on the screen, but I'm new to Swift and am not sure how to do this. I have three images which I want have randomly shown in the image view, when the app is opened. How do I do this? 回答1: Generate a ramdom number from 0 to 2 and show the image by randomly generated number. var random = arc4random_uniform(3) //returns 0 to 2 randomly switch random { case 0: //show first image case 1: //show second image default: //show third image } 回答2: If the images

How to make icon with pink background transparent?

落爺英雄遲暮 提交于 2021-02-19 05:18:29
问题 I'm using Visual Studio icon library (VS2008ImageLibrary), there are some BMP files with a pink background. How can I make the pink background become transparent? What software can I use to do this? Any free one? Thanks 回答1: You can try it online provided you can transform your bmp into a gif first. Or you can grab PAINT.Net (freeware), and apply a transparent background by following this video instructions. 回答2: I used IrfanView's batch conversion tool. It's still some work, because you have

How to attach multi images in email body in windows application?

若如初见. 提交于 2021-02-19 04:39:05
问题 I am working on windows application for email sending. For text formatting i used tinymce editor for email body. Used tinymce insert image functionality for adding image in email body but when email is sent to user. Images does not appear in user email body. Then i tried to add base64 image manually as below: <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAABLCAYAAABk6PuLAAAACXBIWXMAASdHAAEnRwEEDs /'> Which is failed to load images. Can we use linked resources and alternate view

How to OCR image with Tesseract

浪子不回头ぞ 提交于 2021-02-19 03:33:12
问题 I am starting to learn OpenCV and Tesseract, and have trouble with what seems to be a very simple example. Here is an image that I am trying to OCR, that reads "171 m": I do some preprocessing. Since blue is the dominant color of the text, I extract the blue channel and apply simple thresholding. img = cv2.imread('171_m.png')[y, x, 0] _, thresh = cv2.threshold(img, 150, 255, cv2.THRESH_BINARY_INV) The resulting image looks like this: Then throw that into Tesseract, with psm 7 for single line:

What is android:contentDescription=“@string/desc” in ImageView's xml?

天大地大妈咪最大 提交于 2021-02-19 03:18:23
问题 I added an imageView in GraphicalLayout but it looks different on my real device than on AVD. I found that I need to add contentDescription in a layout .xml , but when I add: contentDescription="@string/desc" there is an error: "No resource found that matches the given name (at 'contentDescription' with value '@string/desc')" What is this string "desc"? What should it looks like? 回答1: You need to add it in your string.xml file: <string name="desc">your desc goes here</string> Although I don't

What is android:contentDescription=“@string/desc” in ImageView's xml?

别说谁变了你拦得住时间么 提交于 2021-02-19 03:13:42
问题 I added an imageView in GraphicalLayout but it looks different on my real device than on AVD. I found that I need to add contentDescription in a layout .xml , but when I add: contentDescription="@string/desc" there is an error: "No resource found that matches the given name (at 'contentDescription' with value '@string/desc')" What is this string "desc"? What should it looks like? 回答1: You need to add it in your string.xml file: <string name="desc">your desc goes here</string> Although I don't

How to mask image with binary mask

与世无争的帅哥 提交于 2021-02-19 02:40:21
问题 Suppose I have a greyscale image here: And a binary masked image here: With the same dimensions and shape. How do I generate something like this: Where the values indicated by the 1 in the binary mask are the real values, and values that are 0 in the mask are null in the final image. 回答1: Use cv2.bitwise_and to mask an image with a binary mask. Any white pixels on the mask (values with 1) will be kept while black pixels (value with 0) will be ignored. Here's a example: Input image (left),

How to retrieve image files from mongodb to html page

我的未来我决定 提交于 2021-02-19 02:27:07
问题 I have successfully stored image files in mongdb in binary format.but when i m getting image from mongodb i m getting the same banary format.But i need this image file.Please someone could help This is the code i used def retrieve(request): db=pymongo.connection.Connection('localhost',27017).demo1 grid=gridfs.GridFS(db) output=grid.get_last_version(filename='shiva.jpg') return HttpResponse(output) 回答1: Hi i have successfully inserted and retrieved image from mongodb with python.. def insert

Find images with certain extensions recursively

隐身守侯 提交于 2021-02-18 22:33:50
问题 I am currently trying to make a script that will find images with *.jpg / *.png extensions in directories and subdirectories. If some picture with one of these extensions is found, then save it to an array with path, name, size, height and width. So far I have this piece of code, which will find all files, but I don't know how to get only jpg / png images. class ImageCheck { public static function getDirectory( $path = '.', $level = 0 ){ $ignore = array( 'cgi-bin', '.', '..' ); // Directories