image-segmentation

what is the correct way to reshape image segmentation model output from 2D (num of classes, num of pixels) to 3D channel last images

半城伤御伤魂 提交于 2019-12-13 02:02:54
问题 I am using keras and python for satellite image segmentation. It is my understanding that to get (pixel level)predictions for image segmentation, model reshapes layer of dimension(-1,num_classes,height,width) to shape (-1,num_classes,height*width).This is then followed by applying activation function like softmax or sigmoid. My question is how to recover images after this step back in the format either channel first or channel last? example code o = (Reshape(( num_classes , outputHeight

How to handle the mean Intersection Over Union (mIOU) for unknown class in semantic segmentation?

旧巷老猫 提交于 2019-12-12 21:48:55
问题 I implemented a FCN network to do semantic segmentation. I am using Cityscapes as my dataset. As you know, there are some classes in Cityscapes that you ignore during the training and it is labeled as 255. I used weighted loss to ignore the loss for the unknown classes(set the loss to zero for unknown class). Now I want to exclude unknown class from my evaluation metric(mean Intersection Over Union (mIOU)).It is not clear for me how to exclude the unknown class at this point. At the moment I

OpenCV VLFeat Slic function call

泪湿孤枕 提交于 2019-12-12 08:54:52
问题 I am trying to use the vl_slic_segment function of the VLFeat library using an input image stored in an OpenCV Mat. My code is compiling and running, but the output superpixel values do not make sense. Here is my code so far : Mat bgrUChar = imread("/pathtowherever/image.jpg"); Mat bgrFloat; bgrUChar.convertTo(bgrFloat, CV_32FC3, 1.0/255); cv::Mat labFloat; cvtColor(bgrFloat, labFloat, CV_BGR2Lab); Mat labels(labFloat.size(), CV_32SC1); vl_slic_segment(labels.ptr<vl_uint32>(),labFloat.ptr

how to get an vertical histogram of an binary image and based on that histogram segment words from a row

佐手、 提交于 2019-12-12 07:27:14
问题 suppose i have an image in which there are some letters.based on those letters of the image i want to show the vertical projections of histogram of the given image in an axes: i tried imhist('image') but its not showing the projection its only giving a white box on my GUI axes a=imhist(Iedge2); imshow(a,'Parent',handles.axes2); title('HISTOGRAM OF DILATED IMAGE') in this iedge2 is the inverted binary image. after getting the vertical histogram I want to segment the inverted binary image into

How to run pretrained models of Pixel Objectness

浪尽此生 提交于 2019-12-12 06:47:17
问题 I can't run pretrained models of Pixel Objectness published by Suyog Dutt Jain et al in 2017. I referred section Using the pretrained models in README.md on GitHub, but couldn't understand the following procedures well. ・Setup: Download and install Deeplab-v1 from here ・Refer to demo.py for step-by-step instruction on how to run the code. I tryed to install and run "demo.py", but I got some errors. Though I referred solutions on Website, unsolvable error remained. /usr/bin/python2.7 /mnt/C6BF

Image segmentation and registration using SimpleITK

谁说胖子不能爱 提交于 2019-12-12 04:28:58
问题 I have some doubts regarding 3D image registration and segmentation: Load dicom images: In DCE-MRI there are 4000 slices and total 100 stacks, so 40 in each stack. How can I load them to a 4D array using GDCM simpleITK function Registration: registration is pretty straight forward, we have to register all 100 stacks to the first stack. Registration accuracy : SimpleITK overlap ratio measure or hausdroff distance need segmentation and labelling. Now segmentation using region growing or

Working with an specific region generated by BoundingBox

旧街凉风 提交于 2019-12-12 03:29:30
问题 I have n regions generated by regionprops with 'BoundingBox' and 'Image' properties. I saved the data ( [x, y, Δx, Δy] ) from a specific region (14 for example) to bb1 that I want to work on but first I need to understand the following code: bb1=floor( Ic(14,1).BoundingBox ); I1bb1=I1( bb1(2):bb1(2)+bb1(4)-1 , bb1(1):bb1(1)+bb1(3)-1 ,:); After that, also I want to understand the next code that it is from the same example: I2=I1bb1.*repmat( Ic(BB,1).Image , [1 1 3]); Where Ic contains n

code for CRF implementation in C++ or Matlab for images

六月ゝ 毕业季﹏ 提交于 2019-12-12 02:36:20
问题 I need some code for CRF implementation in C++ or Matlab for images for segmentation problem. Which is the more appropriate code library? It will be great if it supports higher order energy terms Thanks in advance. 回答1: I've had great success with Justin Domke's JGMT. It is written in C++ and can be used from Matlab. I would recommend you look at this library first. There are plenty of other options: CRFSuite which is written in C++ but easily accesible from Python and stuff. There is also

How to replace the appropriate colors with my own pallette in MATLAB?

送分小仙女□ 提交于 2019-12-12 02:24:24
问题 I am using MATLAB 2015. I want to reduce the image color count. An RGB image will be segmentated using k-means algorithm. Then mean colors will be replaced with the colors I have. The colors are (10), black - [255, 255, 255], yellow - [255, 255, 0], orange - [255, 128, 0], white - [255, 255, 255], pink - [255, 153, 255], lavender - [120, 102, 255], brown - [153, 51, 0], green - [0, 255, 0], blue - [0, 0, 255], red - [255, 0, 0]. I have succeeded clustering the image. Clustered images should

pruning image segments' leftovers

一曲冷凌霜 提交于 2019-12-12 00:50:08
问题 As you see in images below, in some of my segmentation result(segmentation done by watershed transformation method), there are some leftovers left. I want to somehow crop the images so that only the rectangles remain. This operation is only based on rectangle shape and it doesn't relate to intensity level. 回答1: Solution explanation I suggest the following approach: generate an initial guess for the 4 corners of the shape according to geometric properties (see code below for further details).