Falha na segmentação (Image of the taxed nucleus). Can someone help me? [fechada]

include

include

include

include

include

include

include

// Declaração de variáveis
int Nx = 383;
int Nz = 121;
int Na = 100;
int ntotal = 6000;
int cut = 30;
float Dt = 0.0006;
int h = 10;
int pos_fonte_X = 192;
int pos_fonte_Z = 4;
int jobs = 5;
int num_rec = 383;
int vel_max = 5500;
int vel_min = 1500;
char model_name (100) = "marmousi_vp_383x121.bin";

// Declaration of methods
void bin_model_write (char extended_model_name (50), floating * extended_model, int Nxx, int Nzz);
int bin_read (char * model_name, int Nx, int Nz, float model);
empty modeling (int Nxx, int Nzz, int Nf, int pos_fonte_X, int pos_fonte_Z, float
P2, float * P3, float * coef_bd, float * coef_be, float * coef_bi, float * coef_bs, float * fonte, float * extended_model, float * C, float * A, FILE * snapshot, float * sis);
null bordas_Reynolds (floating * P2, floating * P3, floating * A, int Nxx, int Nzz);
empty bordas_Cerjan (float * P2, float * P3, int Nxx, int Nzz, float * coef_be, float * coef_bd, float * coef_bi, float * coef_bs);
null coef_absorcao (int Nxx, int Nzz, float * coef_bi, float * coef_bs, float * coef_be, float * coef_bd);
void generate_fonte (int Nf, int fcorte, float * fonte);
void add_bordas (floating model *, floating model * extended, int Nxx, int Nzz);

// Start two methods
void loop_principal () {

int Nxx, Nzz;
int Nf, k, i;
char extended_model_name(50);

Nxx = 2 * Na + Nx;
Nzz = 2 * Na + Nz;

// Criação de matrizes
float * model = (float*) calloc(Nx * Nz, sizeof(float));
float * extended_model = (float*) calloc(Nx * Nz, sizeof(float));
float * P2 = (float*) calloc(Nxx * Nzz, sizeof(float));
float * P3 = (float*) calloc(Nxx * Nzz, sizeof(float));
float * sis = (float*) calloc(num_rec * ntotal, sizeof(float));
float * C = (float*) calloc(Nxx * Nzz, sizeof(float));
float * A = (float*) calloc(Nxx * Nzz, sizeof(float));
float * fonte = (float*) calloc (Nf, sizeof(float));

// Coeficientes das bordas absortivas
float * coef_bs = (float*) calloc (Nxx * Nzz, sizeof(float));
float * coef_bi = (float*) calloc (Nxx * Nzz, sizeof(float));
float * coef_be = (float*) calloc (Nxx * Nzz, sizeof(float));
float * coef_bd = (float*) calloc (Nxx * Nzz, sizeof(float));

generate_fonte(Nf, fcorte, fonte);

bin_read(model_name, Nx, Nz, model);

add_bordas(model, extended_model, Nxx, Nzz);

for (k = 0; k < Nxx; k++) {
    for (i = 0; i < Nzz; i++) {
        A(Nzz * k + i) = (extended_model(Nzz * k + i) * Dt) / h;
        C(Nzz * k + i) = -(pow(A(Nzz * k + i), 2)) / 12;
    }
}   

sprintf(extended_model_name, "extended_model_%dx%d.bin", Nxx, Nzz);

bin_model_write(extended_model_name, extended_model, Nxx, Nzz);

FILE *snapshot  = NULL;
snapshot = fopen ("snapshot.bin","wb");

modelagem(Nxx, Nzz, Nf, pos_fonte_X, pos_fonte_Z, P2, P3, coef_bd, coef_be, coef_bi, coef_bs, fonte, extended_model, C, A, snapshot, sis);

FILE * file_sis = NULL;
file_sis = fopen ("sismograma.bin","wb"); 

fwrite (sis, sizeof(float), num_rec * ntotal, file_sis);

P2=NULL;
P3=NULL;
model=NULL;
extended_model=NULL;
A=NULL;
C=NULL;
sis=NULL;
coef_bs=NULL;
coef_be=NULL;
coef_bd=NULL;
coef_bi=NULL;
fonte=NULL;

free(P2);
free(P3);
free(model);
free(extended_model);
free(A);
free(C);
free(sis);
free(coef_be);
free(coef_bd);
free(coef_bi);
free(fonte);

fclose(snapshot);
fclose(file_sis);

}

void bin_model_write (char extended_model_name (50), float * extended_model, int Nxx, int Nzz) {

FILE * file_borda;
file_borda = fopen (extended_model_name,"wb");

if (Nz != 0) {
    fwrite (extended_model, sizeof(float), Nxx * Nzz, file_borda);
}
if (Nz == 0) {
    fwrite (extended_model, sizeof(float), Nxx, file_borda);
}

fclose(file_borda);

}

void modelagem (int Nxx, int Nzz, int Nf, int pos_fonte_X, int pos_fonte_Z, float * P2, float * P3, float * coef_bd, float * coef_be, float * coef_bi, float * coef_bs, float * fonte, float * extended_model, floating * C, floating * A, FILE * snapshot, floating * sis) {

int k, i, n;
float P1;

pos_fonte_X += Na;
pos_fonte_Z += Na;

coef_absorcao(Nxx, Nzz, coef_bi, coef_bs, coef_be, coef_bd);

for(n = 0; n = ntotal; n++){

    if (n < Nf){

        P2(Nzz * pos_fonte_X + pos_fonte_X) = P2(Nzz * pos_fonte_X + pos_fonte_Z) + fonte(n) * pow((Dt / h), 2) * pow(extended_model(Nzz * pos_fonte_X + pos_fonte_Z), 2);
    }

    for (k = 2; k < Nxx - 2; k++){
        for (i = 2; i < Nzz - 2; i++){

            P3(Nzz * k + i) = C(Nzz * k + i) * (P2(Nzz * (k - 2) + i) + P2(Nzz * (k + 2) + i) + P2(Nzz * k + (i + 2)) + P2(Nzz * k + (i - 2)) - 16 * (P2(Nzz * (k - 1) + i) + P2(Nzz * (k + 1) + i) + P2(Nzz * k + (i - 1)) + P2(Nzz * k + (i + 1))) + 60 * P2(Nzz * k + i)) + 2 * P2(Nzz * k + i) - P3(Nzz * k + i);            
        }
    }

    bordas_Cerjan(P2, P3, Nxx, Nzz, coef_be, coef_bd, coef_bi, coef_bs);
    bordas_Reynolds(P2, P3, A, Nxx, Nzz);

    for (k = 0; k < Nxx; k++)
    {

        for (i = 0; i < Nzz; i++)
        {
            P1 = P2(Nzz * k + i);
            P2(Nzz * k + i) = P3(Nzz * k + i);
            P3(Nzz * k + i) = P1;
        }
    }

    if (n % 100 == 0){
         fwrite(&P2(0), sizeof(float), Nxx * Nzz, snapshot);
    }


    sis(ntotal * k + n)   =  P2(Nzz * k + jobs);


}

}

null bordas_Reynolds (floating * P2, floating * P3, floating * A, int Nxx, int Nzz) {

int k, i;


for (k = 2; k < Nxx - 2; k++){

    // Interface superior
    for (i = 0; i < 2; i++) {
        P3(Nzz * k + i) = P2(Nzz * k + i) + A(Nzz * k  + i) * (P2(Nzz * k + (i + 1)) - P2(Nzz * k + i));
    }

    // Interface inferior
    for (i = Nzz - 2; i < Nzz; i++) {
        P3(Nzz * k + i) = P2(Nzz * k + i) - A(Nzz * k + i) * (P2(Nzz * k + i) - P2(Nzz * k + (i - 1)));
    }
}

for (i = 2; i < Nzz - 2; i++) {

    // Interface esquerda
    for (k = 0; k < 2; k++) {
        P3(Nzz * k + i) = P2(Nzz * k + i) + A(Nzz * k + i) * (P2(Nzz * (k + 1) + i) - P2(Nzz * k + i));
    }

    // Interface direita
    for (k = Nxx - 2; k < Nxx; k++) {
        P3(Nzz * k + i) = P2(Nzz * k + i) - A(Nzz * k + i) * (P2(Nzz * k + i) - P2(Nzz * (k - 1) + i));
    }
}  

}

empty bordas_Cerjan (float * P2, float * P3, int Nxx, int Nzz, float * coef_be, float * coef_bd, float * coef_bi, float * coef_bs) {

int k, i;
const float fat = 0.0025;

for (k = 2; i < Nxx - 2; k++) {

    // Borda superior
    if (Na != 0){
        for (i = 0; i < Na; i++){
            P2(Nzz * k + i) = coef_bs(Nzz * k + i) * P2(Nzz * k + i);
            P3(Nzz * k + i) = coef_bs(Nzz * k + i) * P3(Nzz * k + i);
        }
    }

    // Borda inferior
    if (Na != 0){
        for (i =  Nzz - Na; i < Nzz; i++) {
            P2(Nzz * k + i) = coef_bi(Nzz * k + i) * P2(Nzz * k + i);
            P3(Nzz * k + i) = coef_bi(Nzz * k + i) * P3(Nzz * k + i);
        }
    }
}


if (Na!= 0){

    // Borda lateral esquerda
    for (k = 0; k < Na; k++) {
        for (i = 2; i < Nzz - 2; i++) {
            P2(Nzz * k + i) = coef_be(Nzz * k + i) * P2(Nzz * k + i);
            P3(Nzz * k + i) = coef_be(Nzz * k + i) * P3(Nzz * k + i);
        }
    }

    // Borda lateral direita
    for (k = Nxx - Na; k < Nxx; k++) {
        for (i = 2; i < Nzz - 2; i++) {
            P2(Nzz * k + i) = coef_bd(Nzz * k + i) * P2(Nzz * k + i);
            P3(Nzz * k + i) = coef_bd(Nzz * k + i) * P3(Nzz * k + i);
        }
    }
}

}

null coef_absorcao (int Nxx, int Nzz, float * coef_bi, float * coef_bs, float * coef_be, float * coef_bd) {

int k, i;
const float fat = 0.0010;

for (k = 0; k < Nxx; k++) 
{
    // Borda superior
    if (Na != 0)
    {
            for (i = 0; i < Na; i++) 
            {
                coef_bs(Nzz * k + i) = exp(-pow(fat * (Na - i), 2));
            }
    }

    // Borda inferior
    if (Na != 0)
    {
            for (i = Nzz - Na; i < Nzz; i++)
            {
                    coef_bi(Nzz * k + i) = exp(-pow(fat * (Nzz - Na - i), 2));
            }
    }
}

if (Na != 0)
{
    // Borda lateral esquerda
    for (k = 0; i < Na + 1; k++)
    {
        for (k = 0; k < Nzz; k++) 
        {
            coef_be(Nzz * k + i) = exp(-pow(fat * (Na - k), 2));
        }
    }
    // Borda lateral direita
    for (k = Nxx - Na; k < Nxx; k++)
    {
        for (i = 0; i < Nzz; i++) 
        {
            coef_bd(Nzz * k + i) = exp(-pow(fat * (Nxx - Na - k), 2));
        }
    }
}

}

void add_bordas (floating model *, floating model * extended, int Nxx, int Nzz) {

int k, i;

for (k = Na; k < Nx + Na; k++) {
    for (i = Na; i < Nz + Na; i++) {
        extended_model(Nzz * k + i) = model(Nz * (k - Na) + (i - Na));
    }
}

// Borda superior
for (k = Na; k < Nx + Na; k++) {
    for (i = 0; i < Na; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * k + Na + 1);
    }
}

// Borda inferior
for (k = Na; k < Nx + Na; k++) {
    for (i = Nz + Na; i < Nzz; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * k + Na + Nz - 1);
    }
}

// Borda lateral esquerda
for (k = 0; k < Na; k++) {
    for (i = Na; i < Nz + Na ; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * (Na + 1) + i);
    }
}

// Direct side edge
for (k = Na + Nx; k <Nxx; k ++) {
for (i = Na; i <Nz + Na; i ++) {
Extended_model (Nzz * k + i) = Extended_model (Nzz * (Nx + Na - 1) + i);
}
}

// Borda quina superior esquerda
for (k = 0; k < Na; k++) {
    for (i = 0; i < Na; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * (Na + 1) + Na + 1);
    }
}

// Borda quina superior direita
for (k = Na + Nx; k < Nxx; k++) {
    for (i = 0; i < Na; i++) {
       extended_model(Nzz * k + i) = extended_model(Nzz * (Nx + Na - 1) + Na);
    }
}

// Borda quina inferior esquerda
for (k = 0; k < Na; k++) {
    for (i = Nz + Na; i < Nzz; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * (Na + 1) + Nz + Na - 1);
    }
}

// Borda quina inferior direita
for (k = Nx + Na; k < Nxx; k++) {
    for (i = Nz + Na; i < Nzz; i++) {
        extended_model(Nzz * k + i) = extended_model(Nzz * (Nx + Na) + Nz + Na - 1);
    }
}

}

int bin_read (char * model_name, int Nx, int Nz, float * model) {

struct stat buf;

errno = 0;

if(stat(model_name, &buf) != 0 && errno == ENOENT){
    fprintf(stderr, "O arquivo: %s não foi encontrado.n", model_name);
    exit(EXIT_FAILURE);
}

FILE * file;
file = fopen (model_name, "rb");
fread(model, sizeof(float), Nx * Nz, file);
fclose(file);

return(EXIT_FAILURE);

}

void generate_fonte (int Nf, int fcorte, float * fonte) {

float fc, t, tf;
int n;

fc = fcorte / (3 * sqrt(M_PI));
tf = 2 * sqrt(M_PI) / fcorte;

for(n = 0; n < Nf; n++){
    t = (n * Dt) - tf;
    fonte(n) = exp(-M_PI * pow((M_PI * fc * t), 2)) * (1. - (2.* M_PI * pow(M_PI * fc * t, 2)));
}

}

int main () {

loop_principal();
return 0;

}

Or degub shows that in "add_borda" tem algum erro de memória. Or err:
The program received the SIGSEGV signal, segmentation failure.
0x00005555555555b4 in loop_principal () in sis.cpp: 69
69 Extended_model (Nzz * k + i) = model (Nz * (k - Na) + (i - Na));

redhat enterprise linux – What is the driver update image file?

I am running an installation of RHEL 5.11 on my server. Since my server's DVD-ROM does not work, I have decided to create a multi-boot USB disk using YUMI. Everything works during disk creation, I select the RHEL5 ISO file to load it into the USB disk.

Problems that occur after starting on the RHEL installation page. You are asking me to select the driver disk source, which I have no idea on which device the USB disk is mounted. I tried to randomly select all the options and it seems that device / dev / sda4 works for me. But then he asks me to choose the driver update image file, I have no idea what it is.

Can anyone help me with this?

How to get a sharp but connected image skeleton

How can I get a straight skeleton of an image?

1 @ only use vertical and horizontal lines in the image situation1.
2 @ includes inclined lines in image situation2.

enter the description of the image here

Background, using minimal lines to rebuild the window flower.
The question is something like getting a good structure of a 3D model,
I want to build a 3D model of metal structure from the image.

enter the description of the image here

How to get a smooth contour

enter the description of the image here

SEO – Benefit of adding image by URL in wordpress?

In WordPress we can add images by three methods. 1.Upload, 2.Media Lib. and 3.Insert the image url. My question is, what is the benefit of SEO when you choose option 3 (Insert image URL)? because I use the first option (upload) in my blog Web page. so increase the speed of your page.

8 – twig check if image style or view mode exists

I have a site design that I need to implement.
In this design I have a grid and in the grid I can put any content (node ​​/ paragraph) that I choose.
the image of the content changes in size and proportion in relation to its location in the grid.
I created display modes for the nodes and use twig tweak to represent it in the correct display mode, for example:

{{ drupal_entity('node', content('#node').id , 'box_grid_1x2') }}

For paragraphs I add my image style directly in the paragraph template:

{{ content.field_image.0 | merge({'#image_style': 'box_grid_1x2'}) }}

because it's a bit more dynamic than this and my & # 39; box_grid_1x2 & # 39; It is actually a variable that the user can configure. I want to verify that my image styles of view modes exist before printing them and, if they don't, I want to print a backup copy. show image style.

how would you do it?
Thanks for your help.

javascript – How to change the src of an image with onclick

enter image description hereI have this pop up but what I want is to click on one of the 6 photos on the right to change to the large image on the left and I know that I can use JavaScript


...

html: How to insert images or write to an image through javascript or asp.net?

Hi
How is it possible to add elements to an image after loading it?
As an example in this image: https://ibb.co/6D1rJ5L.
Where can I add arrows, lines, write? For example: https://ibb.co/SmzkCQd

Ways to invest your money User money image

python: save an image in an incorrect folder using opencv

Directory would need to save:

    DataBase-Facesname 

Directory where it is stored:

  DataBase-Faces

My code:

  cv2.imwrite("DataBase-Faces\"+name+str(frames)+".png",Faceimage)

My program creates a folder with the written name, I have to record these images in that folder, and the name of each image will be called Nome Typed + (frame number) .png

python – "Error" when saving an image obtained by Opencv

Directory where I need to save

    Banco-de-Facesnome 

Directory where you are saving:

  Banco-de-Faces

My code:

  cv2.imwrite("Banco-de-Faces\"+nome+str(framesObtidos)+".png",imagemRosto)

My program creates a folder with the written name, I have to save these images inside that folder, and the name of each image will be called NomeDigited + (frame number) .png