image-segmentation

How to modify batch normalization layers (DeconvNet) to be able to run with caffe?

人盡茶涼 提交于 2019-12-02 03:49:39
I wanted to run the Deconvnet on my data, however it seemd it has been written for another version of caffe . Does anyone know how to change batch_params ? The one that is in Deconvnet layers { bottom: 'conv1_1' top: 'conv1_1' name: 'bn1_1' type: BN bn_param { scale_filler { type: 'constant' value: 1 } shift_filler { type: 'constant' value: 0.001 } bn_mode: INFERENCE } } And the one that Caffe provides for cifar10 example: layer { name: "bn1" type: "BatchNorm" bottom: "pool1" top: "bn1" batch_norm_param { use_global_stats: true } param { lr_mult: 0 } param { lr_mult: 0 } param { lr_mult: 0 }

How to build a multi-class convolutional neural network with Keras

三世轮回 提交于 2019-12-02 03:08:54
I am trying to implement a U-Net with Keras with Tensorflow backend for an image segmentation task. I have images of size (128,96) as input to the network together with mask images of size (12288,6) since they are flattened. I have 6 different classes (0-5) which gives the second part of the mask images' shape. They have been encoded to one-hot labels using the to_categorical() function. At the moment I use just one input image and also use the same one as validation and test data. I would like the U-Net to perform image segmentation, where class 0 corresponds to the background. When I now

Is there any way to control the concatenation of the blockproc output?

假如想象 提交于 2019-12-02 00:51:31
This is a follow up to the question: Overlapping sliding window over an image using blockproc or im2col? So by using the code : B = blockproc(A, [1 1], @block_fun, 'BorderSize', [2 2], 'TrimBorder', false, 'PadPartialBlocks', true) I was able to create an overlapping sliding window over my image and calculate the dct2 for each window. But the problem is that blockproc concatenates the output in a way that I cannot use. The output greatly depends on the block size and the size of the output matrix is different because of it every time. My dct2 function creates a 1 x 200 vector for every block

how to split image and fill different color

微笑、不失礼 提交于 2019-12-01 21:46:37
As this picture, how to use matlab code to split it into different parts, and then fill color in it? In addition, how to set gradient color in the second code ??? Here is the picture segmentation code: clc rgb=imread('sample1.bmp'); bw=im2bw(rgb2gray(rgb),.8); bw=medfilt2(bw); planes=bwareaopen(bw,800); D=mat2gray(bwdist(imcomplement(planes))); stats=regionprops(D>.8,'Centroid'); planes_centroid=cat(1,stats.Centroid); planes_mask=false(size(bw)); planes_mask(sub2ind(size(bw),round(planes_centroid(:,2)),... round(planes_centroid(:,1))))=1; M=imimposemin(imcomplement(D),planes_mask); L=watershed

What is the meaning of “history” inside BackgroundSubtractorMOG2?

流过昼夜 提交于 2019-12-01 17:55:41
I'm on OpenCV for java (but that's not relevant I guess). I'm using the BackgroundSubtractorMOG2 class which is (poorly) referenced here . I have read and understood the Zivkovic paper about the algorithm which you can find here . BackgroundSubtractorMOG2 takes in its constructor a parameter called history . What is it, and how does it influence the result? Could you point me to its reference inside the paper, for example? From the class source code , line 106, it is said that alpha = 1/history . That would mean that history is namely the T parameter inside the paper, i.e. (more or less) the

Adjacent and non-adjacent superpixels for an superpixel in an image

六眼飞鱼酱① 提交于 2019-12-01 16:54:30
After segmenting an image into N superpixels, I need to specify the superpixels that are adjacent or non-adjacent to one superpixel and determine this relationship for all superpixels. [L,NumLabels] = superpixels(A,200); How can I specify the adjacent superpixels for each of superpixels ? Update I have tried the solution @Cris Luengo introduced. However the following errors arised : B=imread('H.jpg'); [L,N] = superpixels(B,200); glcms=graycomatrix(L); k=glcms(:,50); %SupNum=50 [r,~]=find(k>0); aa=find(r==50); r(aa)=[]; Update 2 I followed the instruction in MATLAB help but it doesn't work for

Adjacent and non-adjacent superpixels for an superpixel in an image

回眸只為那壹抹淺笑 提交于 2019-12-01 15:54:24
问题 After segmenting an image into N superpixels, I need to specify the superpixels that are adjacent or non-adjacent to one superpixel and determine this relationship for all superpixels. [L,NumLabels] = superpixels(A,200); How can I specify the adjacent superpixels for each of superpixels ? Update I have tried the solution @Cris Luengo introduced. However the following errors arised : B=imread('H.jpg'); [L,N] = superpixels(B,200); glcms=graycomatrix(L); k=glcms(:,50); %SupNum=50 [r,~]=find(k>0)

Is there a way in MATLAB to compute which discrete image regions enclose or are enclosed by another region?

雨燕双飞 提交于 2019-12-01 06:34:53
Given the following image: I'd like to identify which colored regions are enclosed by or enclose which other colored regions. How might this be computed? Is there a way to create a sort of tree or table that shows this information? Example: All the red pixels are within the yellow region. There's no built-in function I know of that can perform this calculation, but here's an idea for how you might get at the information you want... First, you'll want to take your RGB image from above and turn it into an indexed image and a color map. Here's one way to do it: img = double(imread('nested_regions

Is there a way in MATLAB to compute which discrete image regions enclose or are enclosed by another region?

佐手、 提交于 2019-12-01 05:32:43
问题 Given the following image: I'd like to identify which colored regions are enclosed by or enclose which other colored regions. How might this be computed? Is there a way to create a sort of tree or table that shows this information? Example: All the red pixels are within the yellow region. 回答1: There's no built-in function I know of that can perform this calculation, but here's an idea for how you might get at the information you want... First, you'll want to take your RGB image from above and

Separate two overlapping circles in an image using MATLAB

浪子不回头ぞ 提交于 2019-12-01 04:03:56
问题 How do I separate the two connected circles in the image below, using MATLAB? I have tried using imerode , but this does not give good results. Eroding does not work, because in order to erode enough to separate the circles, the lines disappear or become mangled. In other starting pictures, a circle and a line overlap, so isolating the overlapping objects won't work either. The image shows objects identified by bwboundaries , each object painted a different color. As you can see, the two